@adaptabletools/adaptable 18.0.0-canary.8 → 18.0.0

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 (439) hide show
  1. package/base.css +18 -20
  2. package/base.css.map +1 -1
  3. package/index.css +22 -20
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +10 -4
  7. package/src/AdaptableOptions/ActionColumnOptions.d.ts +3 -2
  8. package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +3 -0
  9. package/src/AdaptableOptions/AdaptableOptions.d.ts +15 -14
  10. package/src/AdaptableOptions/AdaptablePlugin.d.ts +2 -0
  11. package/src/AdaptableOptions/AdaptablePlugin.js +2 -0
  12. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +7 -0
  13. package/src/AdaptableOptions/ColumnMenuOptions.d.ts +94 -0
  14. package/src/AdaptableOptions/ColumnOptions.d.ts +9 -4
  15. package/src/AdaptableOptions/CommentOptions.d.ts +20 -9
  16. package/src/AdaptableOptions/ContextMenuOptions.d.ts +94 -0
  17. package/src/AdaptableOptions/CustomSortOptions.d.ts +2 -2
  18. package/src/AdaptableOptions/DataImportOptions.d.ts +2 -2
  19. package/src/AdaptableOptions/FormatColumnOptions.d.ts +2 -2
  20. package/src/AdaptableOptions/GroupingOptions.d.ts +0 -26
  21. package/src/AdaptableOptions/NoteOptions.d.ts +12 -3
  22. package/src/AdaptableOptions/PredicateOptions.d.ts +2 -2
  23. package/src/AdaptableOptions/QuickSearchOptions.d.ts +1 -1
  24. package/src/AdaptableOptions/StateOptions.d.ts +6 -0
  25. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
  26. package/src/Api/AdaptableApi.d.ts +16 -6
  27. package/src/Api/ColumnApi.d.ts +13 -0
  28. package/src/Api/ColumnMenuApi.d.ts +13 -0
  29. package/src/Api/{ScopeApi.d.ts → ColumnScopeApi.d.ts} +36 -26
  30. package/src/Api/CommentApi.d.ts +20 -22
  31. package/src/Api/ConfigApi.d.ts +4 -5
  32. package/src/Api/ContextMenuApi.d.ts +9 -0
  33. package/src/Api/EventApi.d.ts +7 -9
  34. package/src/Api/Events/CommentChanged.d.ts +11 -0
  35. package/src/Api/Events/CommentChanged.js +1 -0
  36. package/src/Api/Events/GridDataChanged.d.ts +1 -1
  37. package/src/Api/FlashingCellApi.d.ts +2 -2
  38. package/src/Api/GridApi.d.ts +35 -3
  39. package/src/Api/Implementation/ActionColumnApiImpl.js +3 -6
  40. package/src/Api/Implementation/ActionRowApiImpl.js +3 -7
  41. package/src/Api/Implementation/AdaptableApiImpl.d.ts +7 -5
  42. package/src/Api/Implementation/AdaptableApiImpl.js +9 -5
  43. package/src/Api/Implementation/AlertApiImpl.js +8 -13
  44. package/src/Api/Implementation/ApiBase.d.ts +6 -4
  45. package/src/Api/Implementation/ApiBase.js +11 -5
  46. package/src/Api/Implementation/CalendarApiImpl.js +1 -6
  47. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +0 -5
  48. package/src/Api/Implementation/CellSummaryApiImpl.js +2 -23
  49. package/src/Api/Implementation/ChartingApiImpl.js +3 -3
  50. package/src/Api/Implementation/ColumnApiImpl.d.ts +5 -0
  51. package/src/Api/Implementation/ColumnApiImpl.js +45 -15
  52. package/src/Api/Implementation/ColumnFilterApiImpl.js +7 -7
  53. package/src/Api/Implementation/ColumnMenuApiImpl.d.ts +8 -0
  54. package/src/Api/Implementation/ColumnMenuApiImpl.js +12 -0
  55. package/src/Api/Implementation/ColumnScopeApiImpl.d.ts +33 -0
  56. package/src/Api/Implementation/{ScopeApiImpl.js → ColumnScopeApiImpl.js} +65 -19
  57. package/src/Api/Implementation/CommentsApiImpl.d.ts +8 -5
  58. package/src/Api/Implementation/CommentsApiImpl.js +10 -5
  59. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -2
  60. package/src/Api/Implementation/ConfigApiImpl.js +27 -28
  61. package/src/Api/Implementation/ContextMenuApiImpl.d.ts +7 -0
  62. package/src/Api/Implementation/ContextMenuApiImpl.js +9 -0
  63. package/src/Api/Implementation/DashboardApiImpl.js +1 -6
  64. package/src/Api/Implementation/ExportApiImpl.js +5 -10
  65. package/src/Api/Implementation/ExpressionApiImpl.js +14 -19
  66. package/src/Api/Implementation/Fdc3ApiImpl.js +1 -1
  67. package/src/Api/Implementation/FlashingCellApiImpl.d.ts +2 -2
  68. package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
  69. package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
  70. package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
  71. package/src/Api/Implementation/GridApiImpl.d.ts +9 -1
  72. package/src/Api/Implementation/GridApiImpl.js +63 -9
  73. package/src/Api/Implementation/LayoutApiImpl.d.ts +4 -11
  74. package/src/Api/Implementation/LayoutApiImpl.js +20 -28
  75. package/src/Api/Implementation/NoteApiImpl.d.ts +18 -0
  76. package/src/Api/Implementation/NoteApiImpl.js +40 -0
  77. package/src/Api/Implementation/OptionsApiImpl.d.ts +6 -5
  78. package/src/Api/Implementation/OptionsApiImpl.js +7 -4
  79. package/src/Api/Implementation/PredicateApiImpl.js +2 -2
  80. package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
  81. package/src/Api/Implementation/TeamSharingApiImpl.js +3 -15
  82. package/src/Api/Implementation/ThemeApiImpl.js +2 -7
  83. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +14 -8
  84. package/src/Api/Implementation/UserInterfaceApiImpl.js +32 -27
  85. package/src/Api/Internal/ActionRowInternalApi.d.ts +1 -0
  86. package/src/Api/Internal/ActionRowInternalApi.js +19 -46
  87. package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -4
  88. package/src/Api/Internal/AdaptableInternalApi.js +16 -30
  89. package/src/Api/Internal/AlertInternalApi.d.ts +2 -2
  90. package/src/Api/Internal/AlertInternalApi.js +7 -20
  91. package/src/Api/Internal/CalculatedColumnInternalApi.js +11 -17
  92. package/src/Api/Internal/ChartingInternalApi.js +13 -13
  93. package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
  94. package/src/Api/Internal/ColumnFilterInternalApi.js +24 -30
  95. package/src/Api/Internal/ColumnInternalApi.d.ts +2 -0
  96. package/src/Api/Internal/ColumnInternalApi.js +7 -1
  97. package/src/Api/Internal/CommentsInternalApi.d.ts +4 -0
  98. package/src/Api/Internal/CommentsInternalApi.js +14 -0
  99. package/src/Api/Internal/CustomSortInternalApi.js +1 -1
  100. package/src/Api/Internal/DashboardInternalApi.js +5 -11
  101. package/src/Api/Internal/DataImportInternalApi.js +3 -9
  102. package/src/Api/Internal/DataSetInternalApi.js +2 -7
  103. package/src/Api/Internal/ExportInternalApi.d.ts +2 -1
  104. package/src/Api/Internal/ExportInternalApi.js +8 -5
  105. package/src/Api/Internal/ExpressionInternalApi.js +3 -13
  106. package/src/Api/Internal/Fdc3InternalApi.js +3 -12
  107. package/src/Api/Internal/FormatColumnInternalApi.d.ts +3 -6
  108. package/src/Api/Internal/FormatColumnInternalApi.js +38 -30
  109. package/src/Api/Internal/FreeTextColumnInternalApi.js +5 -4
  110. package/src/Api/Internal/GridFilterInternalApi.d.ts +5 -0
  111. package/src/Api/Internal/GridFilterInternalApi.js +8 -8
  112. package/src/Api/Internal/GridInternalApi.d.ts +2 -0
  113. package/src/Api/Internal/GridInternalApi.js +28 -40
  114. package/src/Api/Internal/LayoutInternalApi.d.ts +2 -0
  115. package/src/Api/Internal/LayoutInternalApi.js +26 -19
  116. package/src/Api/Internal/NoteInternalApi.d.ts +4 -0
  117. package/src/Api/Internal/NoteInternalApi.js +14 -0
  118. package/src/Api/Internal/PredicateInternalApi.d.ts +6 -6
  119. package/src/Api/Internal/PredicateInternalApi.js +5 -40
  120. package/src/Api/Internal/ScheduleInternalApi.js +1 -6
  121. package/src/Api/Internal/StyledColumnInternalApi.d.ts +2 -2
  122. package/src/Api/Internal/StyledColumnInternalApi.js +8 -9
  123. package/src/Api/Internal/SystemStatusInternalApi.js +1 -7
  124. package/src/Api/Internal/TeamSharingInternalApi.js +2 -7
  125. package/src/Api/Internal/ThemeInternalApi.js +1 -1
  126. package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
  127. package/src/Api/LayoutApi.d.ts +15 -15
  128. package/src/Api/NoteApi.d.ts +48 -0
  129. package/src/Api/NoteApi.js +1 -0
  130. package/src/Api/OptionsApi.d.ts +14 -10
  131. package/src/Api/UserInterfaceApi.d.ts +15 -13
  132. package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
  133. package/src/PredefinedConfig/AlertState.d.ts +2 -2
  134. package/src/PredefinedConfig/CommentState.d.ts +27 -23
  135. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
  136. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  137. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +4 -4
  138. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +2 -2
  139. package/src/PredefinedConfig/Common/CellSummary.d.ts +5 -14
  140. package/src/PredefinedConfig/Common/{AdaptableScope.d.ts → ColumnScope.d.ts} +4 -1
  141. package/src/PredefinedConfig/Common/ColumnScope.js +1 -0
  142. package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +1 -5
  143. package/src/PredefinedConfig/Common/Enums.d.ts +4 -1
  144. package/src/PredefinedConfig/Common/Enums.js +3 -0
  145. package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +2 -2
  146. package/src/PredefinedConfig/Common/Menu.d.ts +39 -4
  147. package/src/PredefinedConfig/Common/Menu.js +125 -1
  148. package/src/PredefinedConfig/Common/RowScope.d.ts +17 -0
  149. package/src/PredefinedConfig/Common/RowScope.js +1 -0
  150. package/src/PredefinedConfig/Common/RowSummary.d.ts +21 -0
  151. package/src/PredefinedConfig/Common/RowSummary.js +17 -0
  152. package/src/PredefinedConfig/Common/TransposeConfig.d.ts +30 -0
  153. package/src/PredefinedConfig/Common/TransposeConfig.js +1 -0
  154. package/src/PredefinedConfig/Common/Types.d.ts +4 -4
  155. package/src/PredefinedConfig/Common/Types.js +4 -1
  156. package/src/PredefinedConfig/ExportState.d.ts +2 -2
  157. package/src/PredefinedConfig/FlashingCellState.d.ts +2 -2
  158. package/src/PredefinedConfig/FormatColumnState.d.ts +9 -5
  159. package/src/PredefinedConfig/LayoutState.d.ts +6 -1
  160. package/src/PredefinedConfig/{NotesState.d.ts → NoteState.d.ts} +4 -4
  161. package/src/PredefinedConfig/NoteState.js +1 -0
  162. package/src/PredefinedConfig/PlusMinusState.d.ts +2 -2
  163. package/src/PredefinedConfig/PopupState.d.ts +1 -2
  164. package/src/PredefinedConfig/PredefinedConfig.d.ts +2 -2
  165. package/src/PredefinedConfig/Selection/GridCell.d.ts +13 -0
  166. package/src/PredefinedConfig/ShortcutState.d.ts +2 -2
  167. package/src/PredefinedConfig/StyledColumnState.d.ts +5 -5
  168. package/src/PredefinedConfig/SystemState.d.ts +12 -4
  169. package/src/Redux/ActionsReducers/CommentsRedux.d.ts +0 -4
  170. package/src/Redux/ActionsReducers/CommentsRedux.js +0 -34
  171. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
  172. package/src/Redux/ActionsReducers/LayoutRedux.js +32 -10
  173. package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
  174. package/src/Redux/ActionsReducers/{NotesRedux.js → NoteRedux.js} +24 -24
  175. package/src/Redux/ActionsReducers/PopupRedux.d.ts +5 -13
  176. package/src/Redux/ActionsReducers/PopupRedux.js +0 -19
  177. package/src/Redux/ActionsReducers/SystemRedux.d.ts +15 -4
  178. package/src/Redux/ActionsReducers/SystemRedux.js +24 -9
  179. package/src/Redux/Store/AdaptableStore.js +48 -30
  180. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +2 -2
  181. package/src/Strategy/AdaptableModuleBase.d.ts +10 -10
  182. package/src/Strategy/AdaptableModuleBase.js +13 -16
  183. package/src/Strategy/AlertModule.d.ts +3 -2
  184. package/src/Strategy/AlertModule.js +4 -4
  185. package/src/Strategy/BulkUpdateModule.d.ts +3 -2
  186. package/src/Strategy/BulkUpdateModule.js +2 -1
  187. package/src/Strategy/CalculatedColumnModule.d.ts +3 -4
  188. package/src/Strategy/CalculatedColumnModule.js +18 -14
  189. package/src/Strategy/CellSummaryModule.d.ts +10 -9
  190. package/src/Strategy/CellSummaryModule.js +101 -83
  191. package/src/Strategy/ColumnFilterModule.d.ts +3 -3
  192. package/src/Strategy/ColumnFilterModule.js +36 -57
  193. package/src/Strategy/ColumnInfoModule.d.ts +3 -3
  194. package/src/Strategy/ColumnInfoModule.js +6 -4
  195. package/src/Strategy/CommentModule.d.ts +12 -0
  196. package/src/Strategy/CommentModule.js +70 -0
  197. package/src/Strategy/CustomSortModule.d.ts +1 -2
  198. package/src/Strategy/CustomSortModule.js +3 -2
  199. package/src/Strategy/DashboardModule.d.ts +3 -3
  200. package/src/Strategy/DashboardModule.js +11 -21
  201. package/src/Strategy/DataImportModule.d.ts +4 -4
  202. package/src/Strategy/DataImportModule.js +8 -8
  203. package/src/Strategy/ExportModule.d.ts +1 -2
  204. package/src/Strategy/ExportModule.js +58 -44
  205. package/src/Strategy/Fdc3Module.d.ts +1 -1
  206. package/src/Strategy/Fdc3Module.js +3 -13
  207. package/src/Strategy/FlashingCellModule.d.ts +4 -3
  208. package/src/Strategy/FlashingCellModule.js +10 -10
  209. package/src/Strategy/FormatColumnModule.d.ts +1 -1
  210. package/src/Strategy/FormatColumnModule.js +29 -47
  211. package/src/Strategy/FreeTextColumnModule.d.ts +1 -2
  212. package/src/Strategy/FreeTextColumnModule.js +2 -2
  213. package/src/Strategy/GridInfoModule.d.ts +3 -3
  214. package/src/Strategy/GridInfoModule.js +5 -3
  215. package/src/Strategy/Interface/IModule.d.ts +4 -4
  216. package/src/Strategy/LayoutModule.d.ts +4 -3
  217. package/src/Strategy/LayoutModule.js +71 -72
  218. package/src/Strategy/NoteModule.d.ts +10 -0
  219. package/src/Strategy/NoteModule.js +55 -0
  220. package/src/Strategy/PlusMinusModule.d.ts +1 -2
  221. package/src/Strategy/PlusMinusModule.js +5 -5
  222. package/src/Strategy/SettingsPanelModule.d.ts +3 -3
  223. package/src/Strategy/SettingsPanelModule.js +6 -6
  224. package/src/Strategy/ShortcutModule.js +1 -1
  225. package/src/Strategy/SmartEditModule.d.ts +3 -2
  226. package/src/Strategy/SmartEditModule.js +2 -1
  227. package/src/Strategy/StyledColumnModule.d.ts +2 -1
  228. package/src/Strategy/StyledColumnModule.js +42 -22
  229. package/src/Strategy/SystemStatusModule.d.ts +3 -3
  230. package/src/Strategy/SystemStatusModule.js +6 -3
  231. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +4 -2
  232. package/src/Strategy/Utilities/getScopeViewItems.d.ts +2 -2
  233. package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
  234. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  235. package/src/Utilities/Constants/GeneralConstants.js +1 -0
  236. package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
  237. package/src/Utilities/Constants/ModuleConstants.js +6 -6
  238. package/src/Utilities/Defaults/DefaultSettingsPanel.js +2 -2
  239. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -2
  240. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +433 -3
  241. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
  242. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
  243. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
  244. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
  245. package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
  246. package/src/Utilities/Extensions/ArrayExtensions.js +4 -0
  247. package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -1
  248. package/src/Utilities/Helpers/AdaptableHelper.js +19 -0
  249. package/src/Utilities/Interface/MessagePopups.d.ts +0 -3
  250. package/src/Utilities/MenuItem.d.ts +10 -7
  251. package/src/Utilities/MenuItem.js +6 -3
  252. package/src/Utilities/ObjectFactory.d.ts +3 -3
  253. package/src/Utilities/ObjectFactory.js +7 -25
  254. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +4 -2
  255. package/src/Utilities/Services/AggregatedScalarLiveValue.js +23 -18
  256. package/src/Utilities/Services/CellPopupService.js +4 -4
  257. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
  258. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -4
  259. package/src/Utilities/Services/LicenseService/index.js +1 -190
  260. package/src/Utilities/Services/ModuleService.js +6 -2
  261. package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
  262. package/src/Utilities/Services/QueryLanguageService.js +4 -3
  263. package/src/Utilities/Services/ReportService.d.ts +7 -5
  264. package/src/Utilities/Services/ReportService.js +245 -26
  265. package/src/Utilities/Services/RowSummaryService.d.ts +26 -0
  266. package/src/Utilities/Services/RowSummaryService.js +155 -0
  267. package/src/Utilities/Services/ValidationService.js +2 -2
  268. package/src/Utilities/adaptableQlUtils.d.ts +2 -0
  269. package/src/Utilities/adaptableQlUtils.js +14 -0
  270. package/src/Utilities/license/decode.js +1 -65
  271. package/src/Utilities/license/hashing.js +1 -43
  272. package/src/View/AdaptableViewFactory.js +2 -2
  273. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +1 -1
  274. package/src/View/Alert/AlertEntityRow.js +1 -1
  275. package/src/View/Alert/Utilities/getAvailablePredicates.d.ts +2 -2
  276. package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +1 -1
  277. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +2 -2
  278. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
  279. package/src/View/BulkUpdate/BulkUpdatePopup.js +2 -2
  280. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
  281. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +3 -3
  282. package/src/View/ColumnInfo/ColumnInfo.js +1 -1
  283. package/src/View/Comments/CommentsEditor.js +28 -17
  284. package/src/View/Comments/CommentsPopup.js +15 -7
  285. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  286. package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.d.ts +5 -0
  287. package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.js +42 -0
  288. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +5 -2
  289. package/src/View/Components/CellPopup/index.d.ts +1 -0
  290. package/src/View/Components/CellPopup/index.js +6 -3
  291. package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.d.ts +3 -3
  292. package/src/View/Components/EntityRulesEditor/index.d.ts +3 -3
  293. package/src/View/Components/FilterForm/FilterForm.js +20 -12
  294. package/src/View/Components/FilterForm/QuickFilterForm.js +15 -8
  295. package/src/View/Components/FilterForm/QuickFilterValues.js +39 -23
  296. package/src/View/Components/NewScopeComponent.d.ts +5 -5
  297. package/src/View/Components/NewScopeComponent.js +36 -3
  298. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +4 -1
  299. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +10 -1
  300. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +7 -10
  301. package/src/View/Components/RangesComponent.d.ts +2 -2
  302. package/src/View/Components/RangesComponent.js +1 -1
  303. package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
  304. package/src/View/Components/SharedProps/WizardScopeState.d.ts +2 -2
  305. package/src/View/Components/ValueSelector/index.d.ts +1 -0
  306. package/src/View/Components/ValueSelector/index.js +2 -2
  307. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +1 -1
  308. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +4 -2
  309. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -1
  310. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +2 -2
  311. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +20 -7
  312. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -1
  313. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -1
  314. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +27 -12
  315. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +1 -1
  316. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
  317. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
  318. package/src/View/GridFilter/GridFilterViewPanel.js +3 -3
  319. package/src/View/GridFilter/useGridFilterExpressionEditor.js +1 -1
  320. package/src/View/Layout/LayoutViewPanel.js +2 -1
  321. package/src/View/Layout/TransposedPopup.js +27 -25
  322. package/src/View/Layout/Wizard/LayoutWizard.js +38 -3
  323. package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
  324. package/src/View/Layout/Wizard/sections/FilterSection.js +1 -1
  325. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +18 -2
  326. package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +9 -0
  327. package/src/View/Layout/Wizard/sections/RowSummarySection.js +174 -0
  328. package/src/View/License/LicenseWatermark.js +1 -61
  329. package/src/View/Note/NotePopup.d.ts +2 -0
  330. package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +14 -9
  331. package/src/View/PlusMinus/PlusMinusSummary.js +2 -2
  332. package/src/View/SmartEdit/SmartEditPopup.js +1 -1
  333. package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
  334. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +5 -7
  335. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -1
  336. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +1 -1
  337. package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +38 -14
  338. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +1 -1
  339. package/src/agGrid/ActionColumnRenderer.js +40 -4
  340. package/src/agGrid/AdaptableAgGrid.d.ts +21 -12
  341. package/src/agGrid/AdaptableAgGrid.js +313 -225
  342. package/src/agGrid/AgGridAdapter.d.ts +5 -2
  343. package/src/agGrid/AgGridAdapter.js +20 -0
  344. package/src/agGrid/AgGridColumnAdapter.d.ts +1 -3
  345. package/src/agGrid/AgGridColumnAdapter.js +52 -70
  346. package/src/agGrid/AgGridMenuAdapter.d.ts +25 -8
  347. package/src/agGrid/AgGridMenuAdapter.js +405 -74
  348. package/src/agGrid/AgGridOptionsService.d.ts +4 -1
  349. package/src/agGrid/AgGridOptionsService.js +22 -0
  350. package/src/agGrid/BadgeRenderer.d.ts +2 -2
  351. package/src/agGrid/BadgeRenderer.js +24 -11
  352. package/src/agGrid/PercentBarRenderer.js +2 -1
  353. package/src/agGrid/buildSortedColumnStateForLayout.d.ts +7 -0
  354. package/src/agGrid/buildSortedColumnStateForLayout.js +120 -0
  355. package/src/agGrid/defaultAdaptableOptions.js +7 -12
  356. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -1
  357. package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
  358. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
  359. package/src/agGrid/sortColumnStateForVisibleColumns.d.ts +12 -0
  360. package/src/agGrid/sortColumnStateForVisibleColumns.js +46 -0
  361. package/src/agGrid/weightedAverage.d.ts +0 -2
  362. package/src/agGrid/weightedAverage.js +0 -54
  363. package/src/components/Accordion.d.ts +7 -0
  364. package/src/components/Accordion.js +36 -0
  365. package/src/components/CheckBox/index.js +1 -1
  366. package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
  367. package/src/components/Datepicker/index.d.ts +1 -1
  368. package/src/components/Datepicker/index.js +10 -2
  369. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
  370. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
  371. package/src/components/ExpressionEditor/QueryBuilder/utils.js +1 -14
  372. package/src/components/Input/index.d.ts +1 -2
  373. package/src/components/List/ListGroupItem/index.d.ts +1 -1
  374. package/src/components/ProgressIndicator/ProgressIndicator.js +15 -6
  375. package/src/components/Select/Select.d.ts +1 -1
  376. package/src/components/Select/Select.js +3 -1
  377. package/src/components/Textarea/index.d.ts +2 -2
  378. package/src/components/icons/collapse-all.d.ts +3 -0
  379. package/src/components/icons/collapse-all.js +4 -0
  380. package/src/components/icons/copy.d.ts +3 -0
  381. package/src/components/icons/copy.js +4 -0
  382. package/src/components/icons/csv.d.ts +3 -0
  383. package/src/components/icons/csv.js +4 -0
  384. package/src/components/icons/data-object.d.ts +3 -0
  385. package/src/components/icons/data-object.js +4 -0
  386. package/src/components/icons/excel.d.ts +3 -0
  387. package/src/components/icons/excel.js +5 -0
  388. package/src/components/icons/expand-all.d.ts +3 -0
  389. package/src/components/icons/expand-all.js +4 -0
  390. package/src/components/icons/filter-off.d.ts +3 -0
  391. package/src/components/icons/filter-off.js +4 -0
  392. package/src/components/icons/grid-info.d.ts +3 -0
  393. package/src/components/icons/grid-info.js +4 -0
  394. package/src/components/icons/index.js +24 -0
  395. package/src/components/icons/note.js +2 -2
  396. package/src/components/icons/rows.d.ts +3 -0
  397. package/src/components/icons/rows.js +4 -0
  398. package/src/components/icons/select-all.d.ts +3 -0
  399. package/src/components/icons/select-all.js +4 -0
  400. package/src/components/icons/select-fwd.d.ts +3 -0
  401. package/src/components/icons/select-fwd.js +4 -0
  402. package/src/components/icons/select-off.d.ts +3 -0
  403. package/src/components/icons/select-off.js +4 -0
  404. package/src/env.js +2 -2
  405. package/src/metamodel/adaptable.metamodel.d.ts +230 -116
  406. package/src/metamodel/adaptable.metamodel.js +1 -9408
  407. package/src/parser/src/parser.js +576 -553
  408. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
  409. package/src/parser/src/predicate/mapQlPredicateToExpression.js +3 -4
  410. package/src/parser/src/types.d.ts +7 -2
  411. package/src/parser/src/types.js +1 -2
  412. package/src/types.d.ts +32 -25
  413. package/tsconfig.esm.tsbuildinfo +1 -1
  414. package/src/AdaptableOptions/MenuOptions.d.ts +0 -234
  415. package/src/AdaptableOptions/MenuOptions.js +0 -95
  416. package/src/Api/Events/CommentsChangedInfo.d.ts +0 -5
  417. package/src/Api/Implementation/NotesApiImpl.d.ts +0 -14
  418. package/src/Api/Implementation/NotesApiImpl.js +0 -35
  419. package/src/Api/Implementation/ScopeApiImpl.d.ts +0 -31
  420. package/src/Api/NotesApi.d.ts +0 -48
  421. package/src/PredefinedConfig/CellAddress.d.ts +0 -13
  422. package/src/PredefinedConfig/CellAddress.js +0 -4
  423. package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -38
  424. package/src/Strategy/CommentsModule.d.ts +0 -17
  425. package/src/Strategy/CommentsModule.js +0 -78
  426. package/src/Strategy/NotesModule.d.ts +0 -10
  427. package/src/Strategy/NotesModule.js +0 -57
  428. package/src/View/Components/ScopeComponent.d.ts +0 -24
  429. package/src/View/Components/ScopeComponent.js +0 -133
  430. package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
  431. package/src/View/Export/Wizard/ReportScopeWizard.js +0 -47
  432. package/src/View/Notes/NotesPopup.d.ts +0 -2
  433. /package/src/{Api/Events/CommentsChangedInfo.js → AdaptableOptions/ColumnMenuOptions.js} +0 -0
  434. /package/src/{Api/NotesApi.js → AdaptableOptions/ContextMenuOptions.js} +0 -0
  435. /package/src/Api/{ScopeApi.js → ColumnMenuApi.js} +0 -0
  436. /package/src/{PredefinedConfig/Common/AdaptableScope.js → Api/ColumnScopeApi.js} +0 -0
  437. /package/src/{PredefinedConfig/NotesState.js → Api/ContextMenuApi.js} +0 -0
  438. /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
  439. /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
@@ -1,6 +1,9 @@
1
- import { extractColumnParameter, extractColumnParameters, extractParameter, getNumericValue, handleColumnFunction, validateColumnType, } from './expressionFunctionUtils';
2
1
  import { ExpressionEvaluationError } from '../../parser/src/ExpressionEvaluationError';
2
+ import { SumArray } from '../Extensions/ArrayExtensions';
3
3
  import { getTypedKeys } from '../Extensions/TypeExtensions';
4
+ import { extractColumnParameter, extractColumnParameters, extractParameter, getNumericValue, handleColumnFunction, validateColumnType, } from './expressionFunctionUtils';
5
+ import isAfter from 'date-fns/isAfter';
6
+ import { parseDateValue } from '../Helpers/DateHelper';
4
7
  export const aggregatedExpressionFunctions = [
5
8
  'SUM',
6
9
  'PERCENTAGE',
@@ -11,6 +14,11 @@ export const aggregatedExpressionFunctions = [
11
14
  'WEIGHT',
12
15
  'COL',
13
16
  'GROUP_BY',
17
+ 'MEDIAN',
18
+ 'MODE',
19
+ 'DISTINCT',
20
+ 'ONLY',
21
+ 'STD_DEVIATION',
14
22
  ];
15
23
  export const cumulativeAggregatedExpressionFunctions = [
16
24
  'CUMUL',
@@ -77,6 +85,8 @@ export const aggregatedScalarExpressionFunctions = {
77
85
  field: sumColumnName,
78
86
  initialValue: 0,
79
87
  reducer: (totalSum, rowValue) => {
88
+ // TODO: see why error are not concole logged
89
+ // debuger = 'Adaptable:*'
80
90
  if (isUndefinedValue(rowValue)) {
81
91
  return totalSum;
82
92
  }
@@ -86,6 +96,7 @@ export const aggregatedScalarExpressionFunctions = {
86
96
  },
87
97
  },
88
98
  rowFilterFn: context.filterFn,
99
+ getRowNodes: context.getRowNodes,
89
100
  };
90
101
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
91
102
  const result = {
@@ -104,6 +115,7 @@ export const aggregatedScalarExpressionFunctions = {
104
115
  ],
105
116
  examples: ['SUM([colA])', 'SUM([colA], GROUP_BY([colB]))'],
106
117
  category: 'aggregation',
118
+ inputs: ['number'],
107
119
  },
108
120
  PERCENTAGE: {
109
121
  handler(args, context) {
@@ -148,6 +160,7 @@ export const aggregatedScalarExpressionFunctions = {
148
160
  100);
149
161
  },
150
162
  rowFilterFn: context.filterFn,
163
+ getRowNodes: context.getRowNodes,
151
164
  };
152
165
  addGroupByParams(groupByColumnNames, aggregationExpressionEvaluation);
153
166
  const result = {
@@ -222,6 +235,7 @@ export const aggregatedScalarExpressionFunctions = {
222
235
  },
223
236
  },
224
237
  rowFilterFn: context.filterFn,
238
+ getRowNodes: context.getRowNodes,
225
239
  };
226
240
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
227
241
  if (weightParameter) {
@@ -245,6 +259,294 @@ export const aggregatedScalarExpressionFunctions = {
245
259
  ],
246
260
  examples: ['AVG([colA])', 'AVG([colA], GROUP_BY([colB]))', 'AVG([colA], WEIGHT([colB]))'],
247
261
  category: 'aggregation',
262
+ inputs: ['number'],
263
+ },
264
+ MEDIAN: {
265
+ handler(args, context) {
266
+ const medianColumnParameter = extractColumnParameter('MEDIAN', args);
267
+ const medianColumnName = medianColumnParameter.value;
268
+ validateColumnType(medianColumnName, ['Number'], 'MEDIAN', context.adaptableApi);
269
+ const groupByParameter = extractParameter('MEDIAN', 'operand', ['GROUP_BY'], args, {
270
+ isOptional: true,
271
+ });
272
+ const getCellValue = (rowNode) => {
273
+ return context.adaptableApi.gridApi.getNormalisedValueFromRowNode(rowNode, medianColumnName);
274
+ };
275
+ const aggregationExpressionEvaluation = {
276
+ aggregationParams: {
277
+ reducers: {
278
+ MEDIAN: {
279
+ name: 'MEDIAN',
280
+ field: medianColumnName,
281
+ initialValue: [],
282
+ reducer: (aggregatedValue, value, rowNode) => {
283
+ aggregatedValue.push(rowNode);
284
+ return aggregatedValue;
285
+ },
286
+ done: (aggregatedValue) => {
287
+ if (aggregatedValue.length === 0) {
288
+ return null;
289
+ }
290
+ if (aggregatedValue.length === 1) {
291
+ return getCellValue(aggregatedValue[0]);
292
+ }
293
+ const lenght = aggregatedValue.length;
294
+ const middle = Math.floor((lenght - 1) / 2);
295
+ if (lenght % 2) {
296
+ return getCellValue(aggregatedValue[middle]);
297
+ }
298
+ else {
299
+ return ((getCellValue(aggregatedValue[middle]) +
300
+ getCellValue(aggregatedValue[middle + 1])) /
301
+ 2.0);
302
+ }
303
+ },
304
+ },
305
+ },
306
+ },
307
+ rowFilterFn: context.filterFn,
308
+ getRowNodes: context.getRowNodes,
309
+ };
310
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
311
+ const result = {
312
+ name: 'MEDIAN',
313
+ type: 'aggregationScalar',
314
+ value: aggregationExpressionEvaluation,
315
+ };
316
+ return result;
317
+ },
318
+ description: 'Aggregates a column over multiple rows by computing the median of the column values\nOptionally the aggregation may be grouped.',
319
+ signatures: [
320
+ 'MEDIAN( [colName] )',
321
+ 'MEDIAN( COL(name: string))',
322
+ 'MEDIAN( [colNameA], GROUP_BY( [colNameB] ))',
323
+ 'MEDIAN( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
324
+ ],
325
+ examples: ['MEDIAN([colA])', 'MEDIAN([colA], GROUP_BY([colB]))'],
326
+ category: 'aggregation',
327
+ inputs: ['number'],
328
+ },
329
+ MODE: {
330
+ handler(args, context) {
331
+ const modeColumnParameter = extractColumnParameter('mode', args);
332
+ const modeColumnName = modeColumnParameter.value;
333
+ validateColumnType(modeColumnName, ['Number', 'String', 'Date'], 'mode', context.adaptableApi);
334
+ const groupByParameter = extractParameter('MODE', 'operand', ['GROUP_BY'], args, {
335
+ isOptional: true,
336
+ });
337
+ const aggregationExpressionEvaluation = {
338
+ aggregationParams: {
339
+ reducers: {
340
+ MODE: {
341
+ name: 'MODE',
342
+ field: modeColumnName,
343
+ initialValue: new Map(),
344
+ reducer: (aggregatedValue, rowValue, rowNode) => {
345
+ var _a;
346
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
347
+ return aggregatedValue;
348
+ }
349
+ if (!aggregatedValue) {
350
+ return new Map();
351
+ }
352
+ aggregatedValue.set(rowValue, ((_a = aggregatedValue.get(rowValue)) !== null && _a !== void 0 ? _a : 0) + 1);
353
+ return aggregatedValue;
354
+ },
355
+ done: (aggregatedValue) => {
356
+ var _a;
357
+ const sorted = [...aggregatedValue.entries()].sort(([aVal, aFreq], [bVal, bFreq]) => {
358
+ if (aFreq < bFreq) {
359
+ return 1;
360
+ }
361
+ else if (aFreq > bFreq || aVal < bVal) {
362
+ return -1;
363
+ }
364
+ else {
365
+ return aVal === bVal ? 0 : 1;
366
+ }
367
+ });
368
+ return (_a = sorted === null || sorted === void 0 ? void 0 : sorted[0]) === null || _a === void 0 ? void 0 : _a[0];
369
+ },
370
+ },
371
+ },
372
+ },
373
+ rowFilterFn: context.filterFn,
374
+ getRowNodes: context.getRowNodes,
375
+ };
376
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
377
+ const result = {
378
+ name: 'MODE',
379
+ type: 'aggregationScalar',
380
+ value: aggregationExpressionEvaluation,
381
+ };
382
+ return result;
383
+ },
384
+ description: 'Aggregates a column over multiple rows by computing the mode of the column values\nOptionally the aggregation may be grouped.',
385
+ signatures: [
386
+ 'MODE( [colName] )',
387
+ 'MODE( COL(name: string))',
388
+ 'MODE( [colNameA], GROUP_BY( [colNameB] ))',
389
+ 'MODE( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
390
+ ],
391
+ examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
392
+ category: 'aggregation',
393
+ inputs: [['number'], ['text'], ['date']],
394
+ },
395
+ DISTINCT: {
396
+ handler(args, context) {
397
+ const distinctColumnParameter = extractColumnParameter('DISTINCT', args);
398
+ const distinctColumnName = distinctColumnParameter.value;
399
+ const groupByParameter = extractParameter('MODE', 'operand', ['GROUP_BY'], args, {
400
+ isOptional: true,
401
+ });
402
+ const aggregationExpressionEvaluation = {
403
+ aggregationParams: {
404
+ reducers: {
405
+ DISTINCT: {
406
+ name: 'DISTINCT',
407
+ field: distinctColumnName,
408
+ initialValue: new Set(),
409
+ reducer: (aggregatedValue, rowValue, rowNode) => {
410
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
411
+ return aggregatedValue;
412
+ }
413
+ aggregatedValue.add(rowValue);
414
+ return aggregatedValue;
415
+ },
416
+ done: (aggregatedValue) => {
417
+ return aggregatedValue.size;
418
+ },
419
+ },
420
+ },
421
+ },
422
+ getRowNodes: context.getRowNodes,
423
+ };
424
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
425
+ const result = {
426
+ name: 'DISTINCT',
427
+ type: 'aggregationScalar',
428
+ value: aggregationExpressionEvaluation,
429
+ };
430
+ return result;
431
+ },
432
+ description: 'Aggregates a column over multiple rows by computing the distinct number of the column values\nOptionally the aggregation may be grouped.',
433
+ signatures: [
434
+ 'DISTINCT( [colName] )',
435
+ 'DISTINCT( COL(name: string))',
436
+ 'DISTINCT( [colNameA], GROUP_BY( [colNameB] ))',
437
+ 'DISTINCT( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
438
+ ],
439
+ examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
440
+ category: 'aggregation',
441
+ inputs: [['number'], ['text'], ['date']],
442
+ },
443
+ ONLY: {
444
+ handler(args, context) {
445
+ const distinctColumnParameter = extractColumnParameter('ONLY', args);
446
+ const onlyColumnName = distinctColumnParameter.value;
447
+ validateColumnType(onlyColumnName, ['Number'], 'ONLY', context.adaptableApi);
448
+ const groupByParameter = extractParameter('ONLY', 'operand', ['GROUP_BY'], args, {
449
+ isOptional: true,
450
+ });
451
+ const aggregationExpressionEvaluation = {
452
+ aggregationParams: {
453
+ reducers: {
454
+ ONLY: {
455
+ name: 'ONLY',
456
+ field: onlyColumnName,
457
+ initialValue: new Set(),
458
+ reducer: (aggregatedValue, rowValue, rowNode) => {
459
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
460
+ return aggregatedValue;
461
+ }
462
+ aggregatedValue.add(rowValue);
463
+ return aggregatedValue;
464
+ },
465
+ done: (aggregatedValue) => {
466
+ return aggregatedValue.size === 1 ? aggregatedValue.values().next().value : null;
467
+ },
468
+ },
469
+ },
470
+ },
471
+ rowFilterFn: context.filterFn,
472
+ getRowNodes: context.getRowNodes,
473
+ };
474
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
475
+ const result = {
476
+ name: 'ONLY',
477
+ type: 'aggregationScalar',
478
+ value: aggregationExpressionEvaluation,
479
+ };
480
+ return result;
481
+ },
482
+ description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
483
+ signatures: [
484
+ 'ONLY( [colName] )',
485
+ 'ONLY( COL(name: string))',
486
+ 'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
487
+ 'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
488
+ ],
489
+ examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
490
+ category: 'aggregation',
491
+ inputs: [['number'], ['text'], ['date']],
492
+ },
493
+ STD_DEVIATION: {
494
+ handler(args, context) {
495
+ const columnParameter = extractColumnParameter('STD_DEVIATION', args);
496
+ const columnName = columnParameter.value;
497
+ validateColumnType(columnName, ['Number'], 'STD_DEVIATION', context.adaptableApi);
498
+ const groupByParameter = extractParameter('STD_DEVIATION', 'operand', ['GROUP_BY'], args, {
499
+ isOptional: true,
500
+ });
501
+ const aggregationExpressionEvaluation = {
502
+ aggregationParams: {
503
+ reducers: {
504
+ STD_DEVIATION: {
505
+ name: 'STD_DEVIATION',
506
+ field: columnName,
507
+ initialValue: { sumOfValues: 0, values: [] },
508
+ reducer: (aggregatedValue, rowValue, rowNode) => {
509
+ // TODO: getNumericValue; allow numeric strings
510
+ if (typeof rowValue !== 'number' || isNaN(rowValue)) {
511
+ return aggregatedValue;
512
+ }
513
+ aggregatedValue.sumOfValues = aggregatedValue.sumOfValues + rowValue;
514
+ aggregatedValue.values.push(rowValue);
515
+ return aggregatedValue;
516
+ },
517
+ done: (aggregatedValue) => {
518
+ const { sumOfValues, values } = aggregatedValue;
519
+ if (values.length === 0) {
520
+ return 0;
521
+ }
522
+ const mean = sumOfValues / values.length;
523
+ const variance = SumArray(values.map((value) => Math.pow(value - mean, 2))) / values.length;
524
+ return Math.sqrt(variance);
525
+ },
526
+ },
527
+ },
528
+ },
529
+ rowFilterFn: context.filterFn,
530
+ getRowNodes: context.getRowNodes,
531
+ };
532
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
533
+ const result = {
534
+ name: 'STD_DEVIATION',
535
+ type: 'aggregationScalar',
536
+ value: aggregationExpressionEvaluation,
537
+ };
538
+ return result;
539
+ },
540
+ description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
541
+ signatures: [
542
+ 'ONLY( [colName] )',
543
+ 'ONLY( COL(name: string))',
544
+ 'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
545
+ 'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
546
+ ],
547
+ examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
548
+ category: 'aggregation',
549
+ inputs: ['number'],
248
550
  },
249
551
  MIN: {
250
552
  handler(args, context) {
@@ -277,6 +579,7 @@ export const aggregatedScalarExpressionFunctions = {
277
579
  },
278
580
  },
279
581
  rowFilterFn: context.filterFn,
582
+ getRowNodes: context.getRowNodes,
280
583
  };
281
584
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
282
585
  const result = {
@@ -295,6 +598,7 @@ export const aggregatedScalarExpressionFunctions = {
295
598
  ],
296
599
  examples: ['MIN([colA])', 'MIN([colA], GROUP_BY([colB]))'],
297
600
  category: 'aggregation',
601
+ inputs: ['number'],
298
602
  },
299
603
  MAX: {
300
604
  handler(args, context) {
@@ -327,6 +631,7 @@ export const aggregatedScalarExpressionFunctions = {
327
631
  },
328
632
  },
329
633
  rowFilterFn: context.filterFn,
634
+ getRowNodes: context.getRowNodes,
330
635
  };
331
636
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
332
637
  const result = {
@@ -345,6 +650,7 @@ export const aggregatedScalarExpressionFunctions = {
345
650
  ],
346
651
  examples: ['MIN([colA])', 'MIN([colA], GROUP_BY([colB]))'],
347
652
  category: 'aggregation',
653
+ inputs: ['number'],
348
654
  },
349
655
  QUANT: {
350
656
  handler(args, context) {
@@ -445,6 +751,7 @@ export const aggregatedScalarExpressionFunctions = {
445
751
  const rowValue = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, quantileColumnName);
446
752
  return isDefinedValue(rowValue);
447
753
  },
754
+ getRowNodes: context.getRowNodes,
448
755
  aggregationParams: {
449
756
  reducers: {
450
757
  QUANT: Object.assign({ name: 'QUANT', field: quantileColumnName }, quantReducer),
@@ -523,6 +830,7 @@ export const aggregatedScalarExpressionFunctions = {
523
830
  },
524
831
  },
525
832
  rowFilterFn: context.filterFn,
833
+ getRowNodes: context.getRowNodes,
526
834
  };
527
835
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
528
836
  const result = {
@@ -541,6 +849,7 @@ export const aggregatedScalarExpressionFunctions = {
541
849
  ],
542
850
  examples: ['COUNT([colA])', 'COUNT([colA], GROUP_BY([colB]))'],
543
851
  category: 'aggregation',
852
+ inputs: [['number'], ['text'], ['date']],
544
853
  },
545
854
  OVER: {
546
855
  handler(args, context) {
@@ -602,6 +911,124 @@ export const aggregatedScalarExpressionFunctions = {
602
911
  examples: ['[col1]', 'COL("col1")'],
603
912
  category: 'special',
604
913
  },
914
+ OLDEST: {
915
+ handler(args, context) {
916
+ const minColumnParameter = extractColumnParameter('OLDEST', args);
917
+ const minColumnName = minColumnParameter.value;
918
+ validateColumnType(minColumnName, ['Date'], 'OLDEST', context.adaptableApi);
919
+ const groupByParameter = extractParameter('OLDEST', 'operand', ['GROUP_BY'], args, {
920
+ isOptional: true,
921
+ });
922
+ const aggregationExpressionEvaluation = {
923
+ aggregationParams: {
924
+ reducers: {
925
+ OLDEST: {
926
+ name: 'OLDEST',
927
+ field: minColumnName,
928
+ initialValue: null,
929
+ reducer: (minValue, rowValue) => {
930
+ if (!minValue) {
931
+ return rowValue;
932
+ }
933
+ if (!rowValue) {
934
+ return minValue;
935
+ }
936
+ if (isAfter(parseDateValue(minValue), parseDateValue(rowValue))) {
937
+ return rowValue;
938
+ }
939
+ else {
940
+ return minValue;
941
+ }
942
+ },
943
+ done: (minValue, arr) => {
944
+ if (minValue !== null) {
945
+ return minValue;
946
+ }
947
+ },
948
+ },
949
+ },
950
+ },
951
+ rowFilterFn: context.filterFn,
952
+ getRowNodes: context.getRowNodes,
953
+ };
954
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
955
+ const result = {
956
+ name: 'OLDEST',
957
+ type: 'aggregationScalar',
958
+ value: aggregationExpressionEvaluation,
959
+ };
960
+ return result;
961
+ },
962
+ description: 'Aggregates a Date column over multiple rows by computing the oldest of the column values\nOptionally the aggregation may be computed within provided individual groups',
963
+ signatures: [
964
+ 'OLDEST( [colName] )',
965
+ 'OLDEST( COL(name: string))',
966
+ 'OLDEST( [colNameA], GROUP_BY( [colNameB] ))',
967
+ 'OLDEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
968
+ ],
969
+ examples: ['OLDEST([colA])', 'OLDEST([colA], GROUP_BY([colB]))'],
970
+ category: 'aggregation',
971
+ inputs: ['date'],
972
+ },
973
+ NEWEST: {
974
+ handler(args, context) {
975
+ const minColumnParameter = extractColumnParameter('NEWEST', args);
976
+ const minColumnName = minColumnParameter.value;
977
+ validateColumnType(minColumnName, ['Date'], 'NEWEST', context.adaptableApi);
978
+ const groupByParameter = extractParameter('NEWEST', 'operand', ['GROUP_BY'], args, {
979
+ isOptional: true,
980
+ });
981
+ const aggregationExpressionEvaluation = {
982
+ aggregationParams: {
983
+ reducers: {
984
+ NEWEST: {
985
+ name: 'NEWEST',
986
+ field: minColumnName,
987
+ initialValue: null,
988
+ reducer: (minValue, rowValue) => {
989
+ if (!minValue) {
990
+ return rowValue;
991
+ }
992
+ if (!rowValue) {
993
+ return minValue;
994
+ }
995
+ if (isAfter(parseDateValue(minValue), parseDateValue(rowValue))) {
996
+ return minValue;
997
+ }
998
+ else {
999
+ return rowValue;
1000
+ }
1001
+ },
1002
+ done: (minValue, arr) => {
1003
+ if (minValue !== null) {
1004
+ return minValue;
1005
+ }
1006
+ },
1007
+ },
1008
+ },
1009
+ },
1010
+ rowFilterFn: context.filterFn,
1011
+ getRowNodes: context.getRowNodes,
1012
+ };
1013
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
1014
+ const result = {
1015
+ name: 'NEWEST',
1016
+ type: 'aggregationScalar',
1017
+ value: aggregationExpressionEvaluation,
1018
+ };
1019
+ return result;
1020
+ },
1021
+ description: 'Aggregates a Date column over multiple rows by computing the most recent of the column values\nOptionally the aggregation may be computed within provided individual groups',
1022
+ signatures: [
1023
+ 'NEWEST( [colName] )',
1024
+ 'NEWEST( COL(name: string))',
1025
+ 'NEWEST( [colNameA], GROUP_BY( [colNameB] ))',
1026
+ 'NEWEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
1027
+ ],
1028
+ examples: ['NEWEST([colA])', 'NEWEST([colA], GROUP_BY([colB]))'],
1029
+ category: 'aggregation',
1030
+ inputs: ['date'],
1031
+ },
605
1032
  };
606
1033
  const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, context) => {
607
1034
  const aggregationEvaluation = aggregationParameter.value;
@@ -673,13 +1100,15 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
673
1100
  if ((_a = aggregationEvaluation.context) === null || _a === void 0 ? void 0 : _a.weightParam) {
674
1101
  // weighted average
675
1102
  const weightValue = (_b = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, aggregationEvaluation.context.weightParam.value)) !== null && _b !== void 0 ? _b : 0;
676
- cumulationBag.currentValue = cumulationBag.currentValue + rowValue * weightValue;
1103
+ cumulationBag.currentValue =
1104
+ cumulationBag.currentValue + rowValue * weightValue;
677
1105
  cumulationBag.numberOfCumulatedValues =
678
1106
  cumulationBag.numberOfCumulatedValues + weightValue;
679
1107
  }
680
1108
  else {
681
1109
  cumulationBag.currentValue = cumulationBag.currentValue + rowValue;
682
- cumulationBag.numberOfCumulatedValues = cumulationBag.numberOfCumulatedValues + 1;
1110
+ cumulationBag.numberOfCumulatedValues =
1111
+ cumulationBag.numberOfCumulatedValues + 1;
683
1112
  }
684
1113
  }
685
1114
  if (cumulationBag.numberOfCumulatedValues !== 0) {
@@ -745,6 +1174,7 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
745
1174
  },
746
1175
  rowValueGetter,
747
1176
  rowFilterFn: aggregationEvaluation.rowFilterFn,
1177
+ getRowNodes: context.getRowNodes,
748
1178
  };
749
1179
  return cumulationExpressionEvaluation;
750
1180
  };
@@ -275,10 +275,10 @@ const isLastElementMinValue = (values) => {
275
275
  };
276
276
  // useful for functions which do NOT have an initial change (ex. GRID_CHANGE NONE)
277
277
  const getDataChangedInfoStub = (context) => {
278
- var _a;
278
+ var _a, _b;
279
279
  let rowNodeStub;
280
280
  if (!context.filterFn) {
281
- rowNodeStub = context.adaptableApi.gridApi.getFirstRowNode();
281
+ rowNodeStub = (_a = context.node) !== null && _a !== void 0 ? _a : context.adaptableApi.gridApi.getFirstRowNode();
282
282
  }
283
283
  else {
284
284
  // if there is a WHERE clause defined, find the first rowNode which satisfies the condition
@@ -293,7 +293,7 @@ const getDataChangedInfoStub = (context) => {
293
293
  const rowNode = rowNodeStub;
294
294
  if (rowNode) {
295
295
  const primaryKeyValue = context.adaptableApi.gridApi.getPrimaryKeyValueForRowNode(rowNode);
296
- const columnId = (_a = context.adaptableApi.columnApi.getQueryableColumns()[0]) === null || _a === void 0 ? void 0 : _a.columnId;
296
+ const columnId = (_b = context.adaptableApi.columnApi.getQueryableColumns()[0]) === null || _b === void 0 ? void 0 : _b.columnId;
297
297
  const oldValue = context.adaptableApi.gridApi.getCellRawValue(primaryKeyValue, columnId);
298
298
  const column = context.adaptableApi.columnApi.getColumnWithColumnId(columnId);
299
299
  const newValue = oldValue;
@@ -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++) {
@@ -2,6 +2,6 @@ import { ExpressionFunction } from '../../parser/src/types';
2
2
  /**
3
3
  * List of all the Scalar Functions available in AdaptableQL
4
4
  */
5
- export type ScalarFunctionName = 'ADD' | 'SUB' | 'MUL' | 'DIV' | 'MOD' | 'POW' | 'ABS' | 'CEILING' | 'FLOOR' | 'ROUND' | 'MIN' | 'MAX' | 'AVG' | 'DATE' | 'NOW' | 'CURRENT_DAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'ADD_DAYS' | 'ADD_WEEKS' | 'ADD_MONTHS' | 'ADD_YEARS' | 'DIFF_DAYS' | 'DIFF_WEEKS' | 'DIFF_MONTHS' | 'DIFF_YEARS' | 'SUB_STRING' | 'REPLACE' | 'COALESCE' | 'NULL' | 'LEN' | 'UPPER' | 'LOWER' | 'CONCAT' | 'IF' | 'CASE' | 'COL' | 'VAR' | 'TO_ARRAY' | 'QUERY' | 'IS_BLANK' | 'IS_NOT_BLANK';
5
+ export type ScalarFunctionName = 'ADD' | 'SUB' | 'MUL' | 'DIV' | 'MOD' | 'POW' | 'ABS' | 'CEILING' | 'FLOOR' | 'ROUND' | 'MIN' | 'MAX' | 'AVG' | 'DATE' | 'NOW' | 'CURRENT_DAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'ADD_DAYS' | 'ADD_WEEKS' | 'ADD_MONTHS' | 'ADD_YEARS' | 'DIFF_DAYS' | 'DIFF_WEEKS' | 'DIFF_MONTHS' | 'DIFF_YEARS' | 'SUB_STRING' | 'REPLACE' | 'COALESCE' | 'NULL' | 'LEN' | 'UPPER' | 'LOWER' | 'CONCAT' | 'IF' | 'CASE' | 'COL' | 'FIELD' | 'VAR' | 'TO_ARRAY' | 'QUERY' | 'IS_BLANK' | 'IS_NOT_BLANK';
6
6
  export declare const scalarExpressionFunctions: Record<ScalarFunctionName, ExpressionFunction>;
7
7
  export declare const scalarExpressionFunctionNames: ScalarFunctionName[];
@@ -68,6 +68,21 @@ export const scalarExpressionFunctions = {
68
68
  category: 'special',
69
69
  returnType: 'any',
70
70
  },
71
+ FIELD: {
72
+ handler(args, context) {
73
+ var _a, _b;
74
+ const fieldName = args[0];
75
+ if (StringExtensions.IsNullOrEmpty(fieldName)) {
76
+ throw new ExpressionEvaluationError('FIELD', 'requires a field name');
77
+ }
78
+ return (_a = context.adaptableApi) === null || _a === void 0 ? void 0 : _a.internalApi.getValueUsingField((_b = context.node) === null || _b === void 0 ? void 0 : _b.data, fieldName);
79
+ },
80
+ description: 'Returns the value of a row field (not necessarily mapped to a column). If the field is nested, use dot notation (e.g. "nested.fieldName")',
81
+ signatures: ['FIELD(fieldName:string)'],
82
+ examples: ['FIELD("fieldName")', 'FIELD("nested.fieldName")'],
83
+ category: 'special',
84
+ returnType: 'any',
85
+ },
71
86
  QUERY: {
72
87
  handler(args, context) {
73
88
  var _a, _b;
@@ -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;