@adaptabletools/adaptable-cjs 18.0.0-canary.1 → 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 (259) hide show
  1. package/agGrid.d.ts +4 -21
  2. package/agGrid.js +5 -21
  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 +2 -6
  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 +107 -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 +71 -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 +18 -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 +60 -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 +18 -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 +8 -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 +5 -1
  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 +4 -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 +22 -1
  91. package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
  92. package/src/Redux/ActionsReducers/NotesRedux.js +10 -8
  93. package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -0
  94. package/src/Redux/ActionsReducers/SystemRedux.js +16 -3
  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 +3 -2
  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 +6 -1
  154. package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
  155. package/src/Utilities/Helpers/AdaptableHelper.js +20 -60
  156. package/src/Utilities/Helpers/Helper.d.ts +2 -0
  157. package/src/Utilities/Helpers/Helper.js +6 -1
  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 +33 -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 +4 -1
  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 +6 -2
  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 +199 -0
  194. package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
  195. package/src/View/Notes/NotesPopup.js +8 -10
  196. package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
  197. package/src/View/Theme/ThemeSelector.js +2 -2
  198. package/src/agGrid/ActionColumnRenderer.js +7 -6
  199. package/src/agGrid/Adaptable.d.ts +3 -455
  200. package/src/agGrid/Adaptable.js +7 -5291
  201. package/src/agGrid/AdaptableAgGrid.d.ts +351 -0
  202. package/src/agGrid/AdaptableAgGrid.js +3941 -0
  203. package/src/agGrid/AdaptableLogger.js +78 -13
  204. package/src/agGrid/AgGridAdapter.d.ts +62 -0
  205. package/src/agGrid/AgGridAdapter.js +582 -0
  206. package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
  207. package/src/agGrid/AgGridColumnAdapter.js +829 -0
  208. package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
  209. package/src/agGrid/AgGridMenuAdapter.js +276 -0
  210. package/src/agGrid/AgGridOptionsService.d.ts +12 -0
  211. package/src/agGrid/AgGridOptionsService.js +58 -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} +73 -10
  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 +6 -4
  228. package/src/components/Select/Select.d.ts +2 -0
  229. package/src/components/Select/Select.js +2 -2
  230. package/src/components/icons/index.js +2 -0
  231. package/src/components/icons/rows.d.ts +3 -0
  232. package/src/components/icons/rows.js +7 -0
  233. package/src/env.js +2 -2
  234. package/src/metamodel/adaptable.metamodel.d.ts +74 -11
  235. package/src/metamodel/adaptable.metamodel.js +147 -34
  236. package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
  237. package/src/migration/AdaptableUpgradeHelper.js +52 -0
  238. package/src/migration/VersionUpgrade.d.ts +8 -0
  239. package/src/migration/VersionUpgrade.js +15 -0
  240. package/src/migration/VersionUpgrade17.d.ts +18 -0
  241. package/src/migration/VersionUpgrade17.js +347 -0
  242. package/src/migration/VersionUpgrade18.d.ts +5 -0
  243. package/src/migration/VersionUpgrade18.js +10 -0
  244. package/src/parser/src/types.d.ts +5 -0
  245. package/src/types.d.ts +7 -3
  246. package/tsconfig.cjs.tsbuildinfo +1 -1
  247. package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
  248. package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
  249. package/src/Utilities/Services/Interface/IRowEditService.js +0 -2
  250. package/src/View/Components/ScopeComponent.d.ts +0 -24
  251. package/src/View/Components/ScopeComponent.js +0 -138
  252. package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
  253. package/src/View/Export/Wizard/ReportScopeWizard.js +0 -52
  254. package/src/agGrid/agGridHelper.d.ts +0 -57
  255. package/src/agGrid/agGridHelper.js +0 -691
  256. package/src/agGrid/agGridMenuHelper.d.ts +0 -46
  257. package/src/agGrid/agGridMenuHelper.js +0 -673
  258. /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
  259. /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
@@ -4,6 +4,7 @@ exports.aggregatedScalarExpressionFunctionNames = exports.aggregatedScalarExpres
4
4
  const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
5
5
  const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
6
6
  const TypeExtensions_1 = require("../Extensions/TypeExtensions");
7
+ const ArrayExtensions_1 = require("../Extensions/ArrayExtensions");
7
8
  exports.aggregatedExpressionFunctions = [
8
9
  'SUM',
9
10
  'PERCENTAGE',
@@ -14,6 +15,11 @@ exports.aggregatedExpressionFunctions = [
14
15
  'WEIGHT',
15
16
  'COL',
16
17
  'GROUP_BY',
18
+ 'MEDIAN',
19
+ 'MODE',
20
+ 'DISTINCT',
21
+ 'ONLY',
22
+ 'STD_DEVIATION',
17
23
  ];
18
24
  exports.cumulativeAggregatedExpressionFunctions = [
19
25
  'CUMUL',
@@ -80,6 +86,8 @@ exports.aggregatedScalarExpressionFunctions = {
80
86
  field: sumColumnName,
81
87
  initialValue: 0,
82
88
  reducer: (totalSum, rowValue) => {
89
+ // TODO: see why error are not concole logged
90
+ // debuger = 'Adaptable:*'
83
91
  if (isUndefinedValue(rowValue)) {
84
92
  return totalSum;
85
93
  }
@@ -89,6 +97,7 @@ exports.aggregatedScalarExpressionFunctions = {
89
97
  },
90
98
  },
91
99
  rowFilterFn: context.filterFn,
100
+ getRowNodes: context.getRowNodes,
92
101
  };
93
102
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
94
103
  const result = {
@@ -151,6 +160,7 @@ exports.aggregatedScalarExpressionFunctions = {
151
160
  100);
152
161
  },
153
162
  rowFilterFn: context.filterFn,
163
+ getRowNodes: context.getRowNodes,
154
164
  };
155
165
  addGroupByParams(groupByColumnNames, aggregationExpressionEvaluation);
156
166
  const result = {
@@ -225,6 +235,7 @@ exports.aggregatedScalarExpressionFunctions = {
225
235
  },
226
236
  },
227
237
  rowFilterFn: context.filterFn,
238
+ getRowNodes: context.getRowNodes,
228
239
  };
229
240
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
230
241
  if (weightParameter) {
@@ -249,6 +260,284 @@ exports.aggregatedScalarExpressionFunctions = {
249
260
  examples: ['AVG([colA])', 'AVG([colA], GROUP_BY([colB]))', 'AVG([colA], WEIGHT([colB]))'],
250
261
  category: 'aggregation',
251
262
  },
263
+ MEDIAN: {
264
+ handler(args, context) {
265
+ const medianColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('MEDIAN', args);
266
+ const medianColumnName = medianColumnParameter.value;
267
+ (0, expressionFunctionUtils_1.validateColumnType)(medianColumnName, ['Number'], 'MEDIAN', context.adaptableApi);
268
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MEDIAN', 'operand', ['GROUP_BY'], args, {
269
+ isOptional: true,
270
+ });
271
+ const getCellValue = (rowNode) => {
272
+ return context.adaptableApi.gridApi.getNormalisedValueFromRowNode(rowNode, medianColumnName);
273
+ };
274
+ const aggregationExpressionEvaluation = {
275
+ aggregationParams: {
276
+ reducers: {
277
+ MEDIAN: {
278
+ name: 'MEDIAN',
279
+ field: medianColumnName,
280
+ initialValue: [],
281
+ reducer: (aggregatedValue, value, rowNode) => {
282
+ aggregatedValue.push(rowNode);
283
+ return aggregatedValue;
284
+ },
285
+ done: (aggregatedValue) => {
286
+ if (aggregatedValue.length === 0) {
287
+ return null;
288
+ }
289
+ if (aggregatedValue.length === 1) {
290
+ return getCellValue(aggregatedValue[0]);
291
+ }
292
+ const lenght = aggregatedValue.length;
293
+ const middle = Math.floor((lenght - 1) / 2);
294
+ if (lenght % 2) {
295
+ return getCellValue(aggregatedValue[middle]);
296
+ }
297
+ else {
298
+ return ((getCellValue(aggregatedValue[middle]) +
299
+ getCellValue(aggregatedValue[middle + 1])) /
300
+ 2.0);
301
+ }
302
+ },
303
+ },
304
+ },
305
+ },
306
+ rowFilterFn: context.filterFn,
307
+ getRowNodes: context.getRowNodes,
308
+ };
309
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
310
+ const result = {
311
+ name: 'MEDIAN',
312
+ type: 'aggregationScalar',
313
+ value: aggregationExpressionEvaluation,
314
+ };
315
+ return result;
316
+ },
317
+ description: 'Aggregates a column over multiple rows by computing the median of the column values\nOptionally the aggregation may be grouped.',
318
+ signatures: [
319
+ 'MEDIAN( [colName] )',
320
+ 'MEDIAN( COL(name: string))',
321
+ 'MEDIAN( [colNameA], GROUP_BY( [colNameB] ))',
322
+ 'MEDIAN( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
323
+ ],
324
+ examples: ['MEDIAN([colA])', 'MEDIAN([colA], GROUP_BY([colB]))'],
325
+ category: 'aggregation',
326
+ },
327
+ MODE: {
328
+ handler(args, context) {
329
+ const modeColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('mode', args);
330
+ const modeColumnName = modeColumnParameter.value;
331
+ (0, expressionFunctionUtils_1.validateColumnType)(modeColumnName, ['Number'], 'mode', context.adaptableApi);
332
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MODE', 'operand', ['GROUP_BY'], args, {
333
+ isOptional: true,
334
+ });
335
+ const aggregationExpressionEvaluation = {
336
+ aggregationParams: {
337
+ reducers: {
338
+ MODE: {
339
+ name: 'MODE',
340
+ field: modeColumnName,
341
+ initialValue: new Map(),
342
+ reducer: (aggregatedValue, rowValue, rowNode) => {
343
+ var _a;
344
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
345
+ return;
346
+ }
347
+ aggregatedValue.set(rowValue, ((_a = aggregatedValue.get(rowValue)) !== null && _a !== void 0 ? _a : 0) + 1);
348
+ return aggregatedValue;
349
+ },
350
+ done: (aggregatedValue) => {
351
+ const sorted = [...aggregatedValue.entries()].sort(([aVal, aFreq], [bVal, bFreq]) => {
352
+ if (aFreq < bFreq) {
353
+ return 1;
354
+ }
355
+ else if (aFreq > bFreq || aVal < bVal) {
356
+ return -1;
357
+ }
358
+ else {
359
+ return aVal === bVal ? 0 : 1;
360
+ }
361
+ });
362
+ return sorted[0][0];
363
+ },
364
+ },
365
+ },
366
+ },
367
+ rowFilterFn: context.filterFn,
368
+ getRowNodes: context.getRowNodes,
369
+ };
370
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
371
+ const result = {
372
+ name: 'MODE',
373
+ type: 'aggregationScalar',
374
+ value: aggregationExpressionEvaluation,
375
+ };
376
+ return result;
377
+ },
378
+ description: 'Aggregates a column over multiple rows by computing the mode of the column values\nOptionally the aggregation may be grouped.',
379
+ signatures: [
380
+ 'MODE( [colName] )',
381
+ 'MODE( COL(name: string))',
382
+ 'MODE( [colNameA], GROUP_BY( [colNameB] ))',
383
+ 'MODE( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
384
+ ],
385
+ examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
386
+ category: 'aggregation',
387
+ },
388
+ DISTINCT: {
389
+ handler(args, context) {
390
+ const distinctColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('DISTINCT', args);
391
+ const distinctColumnName = distinctColumnParameter.value;
392
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MODE', 'operand', ['GROUP_BY'], args, {
393
+ isOptional: true,
394
+ });
395
+ const aggregationExpressionEvaluation = {
396
+ aggregationParams: {
397
+ reducers: {
398
+ DISTINCT: {
399
+ name: 'DISTINCT',
400
+ field: distinctColumnName,
401
+ initialValue: new Set(),
402
+ reducer: (aggregatedValue, rowValue, rowNode) => {
403
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
404
+ return aggregatedValue;
405
+ }
406
+ aggregatedValue.add(rowValue);
407
+ return aggregatedValue;
408
+ },
409
+ done: (aggregatedValue) => {
410
+ return aggregatedValue.size;
411
+ },
412
+ },
413
+ },
414
+ },
415
+ getRowNodes: context.getRowNodes,
416
+ };
417
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
418
+ const result = {
419
+ name: 'DISTINCT',
420
+ type: 'aggregationScalar',
421
+ value: aggregationExpressionEvaluation,
422
+ };
423
+ return result;
424
+ },
425
+ description: 'Aggregates a column over multiple rows by computing the distinct number of the column values\nOptionally the aggregation may be grouped.',
426
+ signatures: [
427
+ 'DISTINCT( [colName] )',
428
+ 'DISTINCT( COL(name: string))',
429
+ 'DISTINCT( [colNameA], GROUP_BY( [colNameB] ))',
430
+ 'DISTINCT( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
431
+ ],
432
+ examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
433
+ category: 'aggregation',
434
+ },
435
+ ONLY: {
436
+ handler(args, context) {
437
+ const distinctColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('ONLY', args);
438
+ const onlyColumnName = distinctColumnParameter.value;
439
+ (0, expressionFunctionUtils_1.validateColumnType)(onlyColumnName, ['Number'], 'ONLY', context.adaptableApi);
440
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('ONLY', 'operand', ['GROUP_BY'], args, {
441
+ isOptional: true,
442
+ });
443
+ const aggregationExpressionEvaluation = {
444
+ aggregationParams: {
445
+ reducers: {
446
+ ONLY: {
447
+ name: 'ONLY',
448
+ field: onlyColumnName,
449
+ initialValue: new Set(),
450
+ reducer: (aggregatedValue, rowValue, rowNode) => {
451
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
452
+ return aggregatedValue;
453
+ }
454
+ aggregatedValue.add(rowValue);
455
+ return aggregatedValue;
456
+ },
457
+ done: (aggregatedValue) => {
458
+ return aggregatedValue.size === 1 ? aggregatedValue.values().next().value : null;
459
+ },
460
+ },
461
+ },
462
+ },
463
+ rowFilterFn: context.filterFn,
464
+ getRowNodes: context.getRowNodes,
465
+ };
466
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
467
+ const result = {
468
+ name: 'ONLY',
469
+ type: 'aggregationScalar',
470
+ value: aggregationExpressionEvaluation,
471
+ };
472
+ return result;
473
+ },
474
+ description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
475
+ signatures: [
476
+ 'ONLY( [colName] )',
477
+ 'ONLY( COL(name: string))',
478
+ 'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
479
+ 'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
480
+ ],
481
+ examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
482
+ category: 'aggregation',
483
+ },
484
+ STD_DEVIATION: {
485
+ handler(args, context) {
486
+ const columnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('STD_DEVIATION', args);
487
+ const columnName = columnParameter.value;
488
+ (0, expressionFunctionUtils_1.validateColumnType)(columnName, ['Number'], 'STD_DEVIATION', context.adaptableApi);
489
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('STD_DEVIATION', 'operand', ['GROUP_BY'], args, {
490
+ isOptional: true,
491
+ });
492
+ const aggregationExpressionEvaluation = {
493
+ aggregationParams: {
494
+ reducers: {
495
+ STD_DEVIATION: {
496
+ name: 'STD_DEVIATION',
497
+ field: columnName,
498
+ initialValue: { sumOfValues: 0, values: [] },
499
+ reducer: (aggregatedValue, rowValue, rowNode) => {
500
+ // TODO: getNumericValue; allow numeric strings
501
+ if (typeof rowValue !== 'number' || isNaN(rowValue)) {
502
+ return aggregatedValue;
503
+ }
504
+ aggregatedValue.sumOfValues = aggregatedValue.sumOfValues + rowValue;
505
+ aggregatedValue.values.push(rowValue);
506
+ return aggregatedValue;
507
+ },
508
+ done: (aggregatedValue) => {
509
+ const { sumOfValues, values } = aggregatedValue;
510
+ if (values.length === 0) {
511
+ return 0;
512
+ }
513
+ const mean = sumOfValues / values.length;
514
+ const variance = (0, ArrayExtensions_1.SumArray)(values.map((value) => Math.pow(value - mean, 2))) / values.length;
515
+ return Math.sqrt(variance);
516
+ },
517
+ },
518
+ },
519
+ },
520
+ rowFilterFn: context.filterFn,
521
+ getRowNodes: context.getRowNodes,
522
+ };
523
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
524
+ const result = {
525
+ name: 'STD_DEVIATION',
526
+ type: 'aggregationScalar',
527
+ value: aggregationExpressionEvaluation,
528
+ };
529
+ return result;
530
+ },
531
+ description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
532
+ signatures: [
533
+ 'ONLY( [colName] )',
534
+ 'ONLY( COL(name: string))',
535
+ 'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
536
+ 'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
537
+ ],
538
+ examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
539
+ category: 'aggregation',
540
+ },
252
541
  MIN: {
253
542
  handler(args, context) {
254
543
  const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('MIN', args);
@@ -280,6 +569,7 @@ exports.aggregatedScalarExpressionFunctions = {
280
569
  },
281
570
  },
282
571
  rowFilterFn: context.filterFn,
572
+ getRowNodes: context.getRowNodes,
283
573
  };
284
574
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
285
575
  const result = {
@@ -330,6 +620,7 @@ exports.aggregatedScalarExpressionFunctions = {
330
620
  },
331
621
  },
332
622
  rowFilterFn: context.filterFn,
623
+ getRowNodes: context.getRowNodes,
333
624
  };
334
625
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
335
626
  const result = {
@@ -448,6 +739,7 @@ exports.aggregatedScalarExpressionFunctions = {
448
739
  const rowValue = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, quantileColumnName);
449
740
  return isDefinedValue(rowValue);
450
741
  },
742
+ getRowNodes: context.getRowNodes,
451
743
  aggregationParams: {
452
744
  reducers: {
453
745
  QUANT: Object.assign({ name: 'QUANT', field: quantileColumnName }, quantReducer),
@@ -526,6 +818,7 @@ exports.aggregatedScalarExpressionFunctions = {
526
818
  },
527
819
  },
528
820
  rowFilterFn: context.filterFn,
821
+ getRowNodes: context.getRowNodes,
529
822
  };
530
823
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
531
824
  const result = {
@@ -748,6 +1041,7 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
748
1041
  },
749
1042
  rowValueGetter,
750
1043
  rowFilterFn: aggregationEvaluation.rowFilterFn,
1044
+ getRowNodes: context.getRowNodes,
751
1045
  };
752
1046
  return cumulationExpressionEvaluation;
753
1047
  };
@@ -11,7 +11,7 @@ function aggregate(aggregateParams, data) {
11
11
  const deepMap = new deepMap_1.DeepMap();
12
12
  let currentGroupKeys = [];
13
13
  const getInitialReducerValue = () => {
14
- return JSON.parse(JSON.stringify(initReducers(reducers)));
14
+ return structuredClone(initReducers(reducers));
15
15
  };
16
16
  const globalReducerResults = getInitialReducerValue();
17
17
  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;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ArrayExtensions = exports.createCommaSeparatedString = exports.groupArrayBy = exports.sortCellValueArrayDates = exports.sortCellValueArrayNumeric = exports.sortCellValueArray = exports.sortArray = exports.sortArrayWithProperty = exports.areArraysEqualWithOrderandProperties = exports.areArraysEqualWithOrder = exports.areArraysNotEqual = exports.areArraysEqual = exports.moveArray = exports.hasItemsOfCount = exports.hasOneItem = exports.getOccurrence = exports.HasSingleEmptyValue = exports.IsNotNullOrEmptyNorContainsSingleEmptyValue = exports.IsNullOrEmptyOrContainsSingleEmptyValue = exports.IsNotNullOrEmpty = exports.IsNullOrEmpty = exports.IsNotEmpty = exports.IsEmpty = exports.IsNotNull = exports.IsNull = exports.RetrieveDistinct = exports.NotContainsItem = exports.ContainsAnyItem = exports.ContainsItem = exports.AddItem = exports.NotCorrectLength = exports.CorrectLength = exports.GetLength = void 0;
3
+ exports.ArrayExtensions = exports.SumArray = exports.createCommaSeparatedString = exports.groupArrayBy = exports.sortCellValueArrayDates = exports.sortCellValueArrayNumeric = exports.sortCellValueArray = exports.sortArray = exports.sortArrayWithProperty = exports.areArraysEqualWithOrderandProperties = exports.areArraysEqualWithOrder = exports.areArraysNotEqual = exports.areArraysEqual = exports.moveArray = exports.hasItemsOfCount = exports.hasOneItem = exports.getOccurrence = exports.HasSingleEmptyValue = exports.IsNotNullOrEmptyNorContainsSingleEmptyValue = exports.IsNullOrEmptyOrContainsSingleEmptyValue = exports.IsNotNullOrEmpty = exports.IsNullOrEmpty = exports.IsNotEmpty = exports.IsEmpty = exports.IsNotNull = exports.IsNull = exports.RetrieveDistinct = exports.NotContainsItem = exports.ContainsAnyItem = exports.ContainsItem = exports.AddItem = exports.NotCorrectLength = exports.CorrectLength = exports.GetLength = void 0;
4
4
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
5
5
  function GetLength(arrayToCheck) {
6
6
  return IsNotNull(arrayToCheck) ? arrayToCheck.length : 0;
@@ -289,6 +289,10 @@ function createCommaSeparatedString(values) {
289
289
  return values.join(', ');
290
290
  }
291
291
  exports.createCommaSeparatedString = createCommaSeparatedString;
292
+ function SumArray(array) {
293
+ return array.filter((num) => typeof num === 'number' && !isNaN(num)).reduce((a, b) => a + b, 0);
294
+ }
295
+ exports.SumArray = SumArray;
292
296
  exports.ArrayExtensions = {
293
297
  GetLength,
294
298
  CorrectLength,
@@ -322,5 +326,6 @@ exports.ArrayExtensions = {
322
326
  sortCellValueArrayDates,
323
327
  sortArrayWithProperty,
324
328
  createCommaSeparatedString,
329
+ SumArray,
325
330
  };
326
331
  exports.default = exports.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,68 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AdaptableHelper = exports.addUuidAndSource = exports.runAdaptableComparerFunction = exports.getAppropriateAccessLevel = exports.AdaptableObjectExistsInState = exports.checkValidPrimaryKey = exports.initPredefinedConfigWithUuids = exports.assignAdaptableOptions = void 0;
3
+ exports.AdaptableHelper = exports.removeUuidAndSource = exports.addUuidAndSource = exports.runAdaptableComparerFunction = exports.getAppropriateAccessLevel = exports.AdaptableObjectExistsInState = exports.checkValidPrimaryKey = exports.initPredefinedConfigWithUuids = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const cloneDeepWith_1 = tslib_1.__importDefault(require("lodash/cloneDeepWith"));
6
6
  const isPlainObject_1 = tslib_1.__importDefault(require("lodash/isPlainObject"));
7
7
  const Uuid_1 = require("../../PredefinedConfig/Uuid");
8
- const DefaultAdaptableOptions_1 = require("../Defaults/DefaultAdaptableOptions");
9
- function assignAdaptableOptions(adaptableOptions) {
10
- var _a;
11
- const returnedAdaptableOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions, adaptableOptions);
12
- returnedAdaptableOptions.adaptableStateKey =
13
- (_a = returnedAdaptableOptions.adaptableStateKey) !== null && _a !== void 0 ? _a : returnedAdaptableOptions.adaptableId;
14
- returnedAdaptableOptions.dataImportOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.dataImportOptions, adaptableOptions.dataImportOptions);
15
- returnedAdaptableOptions.expressionOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.expressionOptions, adaptableOptions.expressionOptions);
16
- returnedAdaptableOptions.calendarOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.calendarOptions, adaptableOptions.calendarOptions);
17
- returnedAdaptableOptions.columnOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.columnOptions, adaptableOptions.columnOptions);
18
- returnedAdaptableOptions.customSortOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.customSortOptions, adaptableOptions.customSortOptions);
19
- returnedAdaptableOptions.dataSetOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.dataSetOptions, adaptableOptions.dataSetOptions);
20
- returnedAdaptableOptions.cellSummaryOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.cellSummaryOptions, adaptableOptions.cellSummaryOptions);
21
- returnedAdaptableOptions.predicateOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.predicateOptions, returnedAdaptableOptions.predicateOptions);
22
- returnedAdaptableOptions.layoutOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.layoutOptions, adaptableOptions.layoutOptions);
23
- returnedAdaptableOptions.notificationsOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.notificationsOptions, adaptableOptions.notificationsOptions);
24
- returnedAdaptableOptions.alertOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.alertOptions, adaptableOptions.alertOptions);
25
- returnedAdaptableOptions.flashingCellOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.flashingCellOptions, adaptableOptions.flashingCellOptions);
26
- returnedAdaptableOptions.entitlementOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.entitlementOptions, adaptableOptions.entitlementOptions);
27
- returnedAdaptableOptions.dashboardOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.dashboardOptions, adaptableOptions.dashboardOptions);
28
- returnedAdaptableOptions.editOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.editOptions, adaptableOptions.editOptions);
29
- returnedAdaptableOptions.actionColumnOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.actionColumnOptions, adaptableOptions.actionColumnOptions);
30
- // to do
31
- returnedAdaptableOptions.actionRowOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.actionRowOptions, adaptableOptions.actionRowOptions);
32
- returnedAdaptableOptions.actionRowOptions.actionRowButtonOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.actionRowOptions.actionRowButtonOptions, returnedAdaptableOptions.actionRowOptions.actionRowButtonOptions);
33
- returnedAdaptableOptions.actionRowOptions.actionRowFormOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.actionRowOptions.actionRowFormOptions, returnedAdaptableOptions.actionRowOptions.actionRowFormOptions);
34
- returnedAdaptableOptions.containerOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.containerOptions, adaptableOptions.containerOptions);
35
- returnedAdaptableOptions.groupingOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.groupingOptions, adaptableOptions.groupingOptions);
36
- returnedAdaptableOptions.quickSearchOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.quickSearchOptions, adaptableOptions.quickSearchOptions);
37
- returnedAdaptableOptions.columnFilterOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.columnFilterOptions, adaptableOptions.columnFilterOptions);
38
- returnedAdaptableOptions.columnFilterOptions.quickFilterOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.columnFilterOptions.quickFilterOptions, returnedAdaptableOptions.columnFilterOptions.quickFilterOptions);
39
- returnedAdaptableOptions.columnFilterOptions.filterFormOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.columnFilterOptions.filterFormOptions, returnedAdaptableOptions.columnFilterOptions.filterFormOptions);
40
- returnedAdaptableOptions.columnFilterOptions.valuesFilterOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.columnFilterOptions.valuesFilterOptions, returnedAdaptableOptions.columnFilterOptions.valuesFilterOptions);
41
- returnedAdaptableOptions.gridFilterOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.gridFilterOptions, adaptableOptions.gridFilterOptions);
42
- returnedAdaptableOptions.userInterfaceOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.userInterfaceOptions, adaptableOptions.userInterfaceOptions);
43
- returnedAdaptableOptions.userInterfaceOptions.dateInputOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.userInterfaceOptions.dateInputOptions, returnedAdaptableOptions.userInterfaceOptions.dateInputOptions);
44
- returnedAdaptableOptions.menuOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.menuOptions, adaptableOptions.menuOptions);
45
- returnedAdaptableOptions.stateOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.stateOptions, adaptableOptions.stateOptions);
46
- returnedAdaptableOptions.exportOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.exportOptions, adaptableOptions.exportOptions);
47
- returnedAdaptableOptions.teamSharingOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.teamSharingOptions, adaptableOptions.teamSharingOptions);
48
- returnedAdaptableOptions.toolPanelOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.toolPanelOptions, adaptableOptions.toolPanelOptions);
49
- returnedAdaptableOptions.dataChangeHistoryOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.dataChangeHistoryOptions, adaptableOptions.dataChangeHistoryOptions);
50
- returnedAdaptableOptions.chartingOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.chartingOptions, adaptableOptions.chartingOptions);
51
- returnedAdaptableOptions.chartingOptions.externalChartingOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.chartingOptions.externalChartingOptions, returnedAdaptableOptions.chartingOptions.externalChartingOptions);
52
- returnedAdaptableOptions.settingsPanelOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.settingsPanelOptions, adaptableOptions.settingsPanelOptions);
53
- returnedAdaptableOptions.fdc3Options = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.fdc3Options, adaptableOptions.fdc3Options);
54
- returnedAdaptableOptions.fdc3Options.actionColumnDefaultConfiguration = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.fdc3Options.actionColumnDefaultConfiguration, returnedAdaptableOptions.fdc3Options.actionColumnDefaultConfiguration);
55
- returnedAdaptableOptions.fdc3Options.uiControlsDefaultConfiguration = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.fdc3Options.uiControlsDefaultConfiguration, returnedAdaptableOptions.fdc3Options.uiControlsDefaultConfiguration);
56
- const { predefinedConfig } = returnedAdaptableOptions;
57
- if (predefinedConfig) {
58
- returnedAdaptableOptions.predefinedConfig =
59
- typeof predefinedConfig === 'string'
60
- ? predefinedConfig
61
- : initPredefinedConfigWithUuids(predefinedConfig);
62
- }
63
- return returnedAdaptableOptions;
64
- }
65
- exports.assignAdaptableOptions = assignAdaptableOptions;
66
8
  function initPredefinedConfigWithUuids(predefinedConfig) {
67
9
  const customizer = (value) => {
68
10
  // so whenever we clone a plain object,
@@ -154,13 +96,31 @@ function addUuidAndSource(adaptableObject) {
154
96
  return adaptableObject;
155
97
  }
156
98
  exports.addUuidAndSource = addUuidAndSource;
99
+ function removeUuidAndSource(adaptableObject) {
100
+ const sanitiseObject = (object) => {
101
+ for (const key in object) {
102
+ if (key === 'Source' || key === 'Uuid') {
103
+ delete object[key];
104
+ }
105
+ else if (Array.isArray(object[key])) {
106
+ object[key].forEach((item) => sanitiseObject(item));
107
+ }
108
+ else if (typeof object[key] === 'object') {
109
+ sanitiseObject(object[key]);
110
+ }
111
+ }
112
+ };
113
+ sanitiseObject(adaptableObject);
114
+ return adaptableObject;
115
+ }
116
+ exports.removeUuidAndSource = removeUuidAndSource;
157
117
  exports.AdaptableHelper = {
158
- assignAdaptableOptions,
159
118
  initPredefinedConfigWithUuids,
160
119
  checkValidPrimaryKey,
161
120
  AdaptableObjectExistsInState,
162
121
  runAdaptableComparerFunction,
163
122
  getAppropriateAccessLevel,
164
123
  addUuidAndSource,
124
+ removeUuidAndSource,
165
125
  };
166
126
  exports.default = exports.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;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Helper = exports.clamp = exports.modeNumberArray = exports.medianNumberArray = exports.meanNumberArray = exports.standardDeviationNumberArray = exports.sumNumberArray = exports.roundNumberTo4dp = exports.roundNumber = exports.isInputNotNullOrEmpty = exports.isInputNullOrEmpty = exports.returnItemCount = exports.copyToClipboard = exports.createDownloadedFile = exports.convertArrayToCsv = exports.arrayToKeyMap = exports.cloneObject = exports.getStringRepresentionFromKey = exports.objectNotExists = exports.objectExists = void 0;
3
+ exports.Helper = exports.clamp = exports.modeNumberArray = exports.medianNumberArray = exports.meanNumberArray = exports.standardDeviationNumberArray = exports.sumNumberArray = exports.roundNumberTo4dp = exports.roundNumber = exports.isInputNotNullOrEmpty = exports.isInputNullOrEmpty = exports.returnItemCount = exports.copyToClipboard = exports.createDownloadedFile = exports.convertArrayToCsv = exports.arrayToKeyMap = exports.cloneObject = exports.getStringRepresentionFromKey = exports.objectHasKeys = exports.objectNotExists = exports.objectExists = void 0;
4
4
  const StringExtensions_1 = require("../Extensions/StringExtensions");
5
5
  const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
6
6
  function objectExists(item) {
@@ -11,6 +11,10 @@ function objectNotExists(item) {
11
11
  return !objectExists(item);
12
12
  }
13
13
  exports.objectNotExists = objectNotExists;
14
+ function objectHasKeys(item) {
15
+ return Object.keys(item).length > 0;
16
+ }
17
+ exports.objectHasKeys = objectHasKeys;
14
18
  function getStringRepresentionFromKey(event) {
15
19
  if (event.key == null) {
16
20
  return event.char; // IE
@@ -249,6 +253,7 @@ exports.clamp = clamp;
249
253
  exports.Helper = {
250
254
  objectExists,
251
255
  objectNotExists,
256
+ objectHasKeys,
252
257
  getStringRepresentionFromKey,
253
258
  cloneObject,
254
259
  convertArrayToCsv,
@@ -33,10 +33,10 @@ function CreateEmptyCalculatedColumn() {
33
33
  // need to create some defaults - which we will change later
34
34
  CalculatedColumnSettings: {
35
35
  DataType: undefined,
36
- Filterable: false,
37
- Resizable: false,
36
+ Filterable: true,
37
+ Resizable: true,
38
38
  Groupable: false,
39
- Sortable: false,
39
+ Sortable: true,
40
40
  Pivotable: false,
41
41
  Aggregatable: false,
42
42
  SuppressMenu: false,
@@ -282,10 +282,10 @@ function CreateEmptyFreeTextColumn() {
282
282
  TextEditor: 'Inline',
283
283
  FreeTextColumnSettings: {
284
284
  DataType: 'String',
285
- Filterable: false,
286
- Resizable: false,
285
+ Filterable: true,
286
+ Resizable: true,
287
287
  Groupable: false,
288
- Sortable: false,
288
+ Sortable: true,
289
289
  Pivotable: false,
290
290
  Aggregatable: false,
291
291
  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
  }