@adaptabletools/adaptable-cjs 18.0.0-canary.2 → 18.0.0-canary.21

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 (369) hide show
  1. package/agGrid.d.ts +4 -21
  2. package/agGrid.js +5 -21
  3. package/base.css +22 -8
  4. package/base.css.map +1 -1
  5. package/index.css +101 -75
  6. package/index.css.map +1 -1
  7. package/package.json +4 -5
  8. package/src/AdaptableInterfaces/IAdaptable.d.ts +59 -108
  9. package/src/AdaptableOptions/AdaptableOptions.d.ts +7 -7
  10. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +11 -4
  11. package/src/AdaptableOptions/ColumnOptions.d.ts +9 -4
  12. package/src/AdaptableOptions/CommentOptions.d.ts +33 -0
  13. package/src/AdaptableOptions/GroupingOptions.d.ts +0 -7
  14. package/src/AdaptableOptions/MenuOptions.d.ts +6 -54
  15. package/src/AdaptableOptions/MenuOptions.js +72 -75
  16. package/src/AdaptableOptions/{NotesOptions.d.ts → NoteOptions.d.ts} +7 -4
  17. package/src/AdaptableOptions/StateOptions.d.ts +6 -0
  18. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
  19. package/src/Api/AdaptableApi.d.ts +9 -4
  20. package/src/Api/BulkUpdateApi.d.ts +0 -5
  21. package/src/Api/ColumnApi.d.ts +4 -0
  22. package/src/Api/CommentApi.d.ts +13 -14
  23. package/src/Api/ConfigApi.d.ts +4 -5
  24. package/src/Api/EventApi.d.ts +7 -9
  25. package/src/Api/Events/AdaptableReady.d.ts +3 -3
  26. package/src/Api/Events/CommentChanged.d.ts +11 -0
  27. package/src/Api/Events/GridDataChanged.d.ts +4 -4
  28. package/src/Api/GridApi.d.ts +23 -13
  29. package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
  30. package/src/Api/Implementation/ActionColumnApiImpl.js +30 -0
  31. package/src/Api/Implementation/AdaptableApiImpl.d.ts +3 -2
  32. package/src/Api/Implementation/AdaptableApiImpl.js +5 -2
  33. package/src/Api/Implementation/ApiBase.d.ts +5 -3
  34. package/src/Api/Implementation/ApiBase.js +8 -2
  35. package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
  36. package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
  37. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +0 -5
  38. package/src/Api/Implementation/CellSummaryApiImpl.js +2 -23
  39. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
  40. package/src/Api/Implementation/ColumnApiImpl.js +10 -0
  41. package/src/Api/Implementation/CommentsApiImpl.d.ts +5 -2
  42. package/src/Api/Implementation/CommentsApiImpl.js +7 -1
  43. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -2
  44. package/src/Api/Implementation/ConfigApiImpl.js +24 -13
  45. package/src/Api/Implementation/GridApiImpl.d.ts +6 -3
  46. package/src/Api/Implementation/GridApiImpl.js +51 -14
  47. package/src/Api/Implementation/LayoutApiImpl.d.ts +3 -0
  48. package/src/Api/Implementation/LayoutApiImpl.js +18 -0
  49. package/src/Api/Implementation/NoteApiImpl.d.ts +18 -0
  50. package/src/Api/Implementation/NoteApiImpl.js +45 -0
  51. package/src/Api/Implementation/OptionsApiImpl.d.ts +4 -4
  52. package/src/Api/Implementation/OptionsApiImpl.js +4 -4
  53. package/src/Api/Implementation/ScopeApiImpl.d.ts +2 -0
  54. package/src/Api/Implementation/ScopeApiImpl.js +20 -7
  55. package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
  56. package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
  57. package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
  58. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -3
  59. package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -8
  60. package/src/Api/Internal/ActionRowInternalApi.d.ts +6 -1
  61. package/src/Api/Internal/ActionRowInternalApi.js +119 -1
  62. package/src/Api/Internal/AdaptableInternalApi.d.ts +6 -7
  63. package/src/Api/Internal/AdaptableInternalApi.js +21 -19
  64. package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
  65. package/src/Api/Internal/CalculatedColumnInternalApi.js +72 -0
  66. package/src/Api/Internal/ColumnFilterInternalApi.d.ts +2 -0
  67. package/src/Api/Internal/ColumnFilterInternalApi.js +23 -1
  68. package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
  69. package/src/Api/Internal/ColumnInternalApi.js +12 -0
  70. package/src/Api/Internal/CommentsInternalApi.d.ts +4 -0
  71. package/src/Api/Internal/CommentsInternalApi.js +18 -0
  72. package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
  73. package/src/Api/Internal/CustomSortInternalApi.js +32 -1
  74. package/src/Api/Internal/DataSetInternalApi.js +1 -1
  75. package/src/Api/Internal/ExportInternalApi.d.ts +2 -1
  76. package/src/Api/Internal/ExportInternalApi.js +4 -1
  77. package/src/Api/Internal/Fdc3InternalApi.js +2 -2
  78. package/src/Api/Internal/FormatColumnInternalApi.js +3 -2
  79. package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
  80. package/src/Api/Internal/FreeTextColumnInternalApi.js +61 -0
  81. package/src/Api/Internal/GridFilterInternalApi.d.ts +5 -0
  82. package/src/Api/Internal/GridFilterInternalApi.js +7 -1
  83. package/src/Api/Internal/GridInternalApi.d.ts +23 -3
  84. package/src/Api/Internal/GridInternalApi.js +141 -7
  85. package/src/Api/Internal/LayoutInternalApi.d.ts +1 -0
  86. package/src/Api/Internal/LayoutInternalApi.js +16 -0
  87. package/src/Api/Internal/NoteInternalApi.d.ts +4 -0
  88. package/src/Api/Internal/NoteInternalApi.js +18 -0
  89. package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
  90. package/src/Api/InteropioPluginApi.d.ts +2 -2
  91. package/src/Api/LayoutApi.d.ts +15 -0
  92. package/src/Api/NoteApi.d.ts +48 -0
  93. package/src/Api/OptionsApi.d.ts +8 -8
  94. package/src/Api/ScopeApi.d.ts +10 -0
  95. package/src/Api/UserInterfaceApi.d.ts +0 -11
  96. package/src/EnvVars.d.ts +3 -0
  97. package/src/EnvVars.js +8 -0
  98. package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
  99. package/src/PredefinedConfig/CommentState.d.ts +27 -23
  100. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
  101. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  102. package/src/PredefinedConfig/Common/AdaptableScope.d.ts +4 -1
  103. package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
  104. package/src/PredefinedConfig/Common/AggregationColumns.js +5 -1
  105. package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +4 -0
  106. package/src/PredefinedConfig/Common/Enums.d.ts +2 -1
  107. package/src/PredefinedConfig/Common/Enums.js +1 -0
  108. package/src/PredefinedConfig/Common/Menu.d.ts +15 -1
  109. package/src/PredefinedConfig/Common/Menu.js +98 -0
  110. package/src/PredefinedConfig/Common/RowSummary.d.ts +21 -0
  111. package/src/PredefinedConfig/Common/RowSummary.js +20 -0
  112. package/src/PredefinedConfig/Common/TransposeConfig.d.ts +30 -0
  113. package/src/PredefinedConfig/Common/Types.d.ts +4 -4
  114. package/src/PredefinedConfig/Common/Types.js +4 -1
  115. package/src/PredefinedConfig/LayoutState.d.ts +5 -0
  116. package/src/PredefinedConfig/{NotesState.d.ts → NoteState.d.ts} +12 -22
  117. package/src/PredefinedConfig/PredefinedConfig.d.ts +3 -3
  118. package/src/PredefinedConfig/Selection/GridCell.d.ts +13 -0
  119. package/src/PredefinedConfig/SystemState.d.ts +9 -3
  120. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
  121. package/src/Redux/ActionsReducers/LayoutRedux.js +34 -11
  122. package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
  123. package/src/Redux/ActionsReducers/NoteRedux.js +89 -0
  124. package/src/Redux/ActionsReducers/SystemRedux.d.ts +6 -1
  125. package/src/Redux/ActionsReducers/SystemRedux.js +19 -6
  126. package/src/Redux/Store/AdaptableStore.d.ts +4 -6
  127. package/src/Redux/Store/AdaptableStore.js +66 -76
  128. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +8 -2
  129. package/src/Strategy/AdaptableModuleBase.d.ts +8 -8
  130. package/src/Strategy/AdaptableModuleBase.js +13 -15
  131. package/src/Strategy/AlertModule.d.ts +1 -2
  132. package/src/Strategy/AlertModule.js +3 -56
  133. package/src/Strategy/BulkUpdateModule.js +1 -1
  134. package/src/Strategy/CalculatedColumnModule.d.ts +2 -3
  135. package/src/Strategy/CalculatedColumnModule.js +6 -26
  136. package/src/Strategy/CellSummaryModule.d.ts +8 -6
  137. package/src/Strategy/CellSummaryModule.js +78 -23
  138. package/src/Strategy/ChartingModule.d.ts +0 -1
  139. package/src/Strategy/ChartingModule.js +2 -22
  140. package/src/Strategy/ColumnFilterModule.d.ts +2 -3
  141. package/src/Strategy/ColumnFilterModule.js +44 -103
  142. package/src/Strategy/ColumnInfoModule.js +2 -0
  143. package/src/Strategy/{CommentsModule.d.ts → CommentModule.d.ts} +2 -5
  144. package/src/Strategy/{CommentsModule.js → CommentModule.js} +19 -25
  145. package/src/Strategy/CustomSortModule.js +3 -2
  146. package/src/Strategy/DashboardModule.d.ts +1 -2
  147. package/src/Strategy/DashboardModule.js +9 -15
  148. package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
  149. package/src/Strategy/DataChangeHistoryModule.js +3 -1
  150. package/src/Strategy/DataImportModule.d.ts +1 -1
  151. package/src/Strategy/DataImportModule.js +5 -5
  152. package/src/Strategy/DataSetModule.d.ts +1 -1
  153. package/src/Strategy/DataSetModule.js +1 -1
  154. package/src/Strategy/ExportModule.d.ts +1 -0
  155. package/src/Strategy/ExportModule.js +17 -2
  156. package/src/Strategy/Fdc3Module.js +3 -0
  157. package/src/Strategy/FlashingCellModule.d.ts +1 -2
  158. package/src/Strategy/FlashingCellModule.js +6 -19
  159. package/src/Strategy/FormatColumnModule.d.ts +0 -2
  160. package/src/Strategy/FormatColumnModule.js +6 -51
  161. package/src/Strategy/FreeTextColumnModule.d.ts +0 -1
  162. package/src/Strategy/FreeTextColumnModule.js +1 -31
  163. package/src/Strategy/GridFilterModule.d.ts +0 -1
  164. package/src/Strategy/GridFilterModule.js +0 -37
  165. package/src/Strategy/GridInfoModule.js +2 -0
  166. package/src/Strategy/Interface/IModule.d.ts +0 -1
  167. package/src/Strategy/LayoutModule.d.ts +9 -3
  168. package/src/Strategy/LayoutModule.js +148 -62
  169. package/src/Strategy/NamedQueryModule.d.ts +0 -1
  170. package/src/Strategy/NamedQueryModule.js +0 -19
  171. package/src/Strategy/{NotesModule.d.ts → NoteModule.d.ts} +2 -1
  172. package/src/Strategy/NoteModule.js +62 -0
  173. package/src/Strategy/PlusMinusModule.d.ts +1 -1
  174. package/src/Strategy/PlusMinusModule.js +2 -2
  175. package/src/Strategy/ScheduleModule.d.ts +1 -1
  176. package/src/Strategy/ScheduleModule.js +1 -1
  177. package/src/Strategy/SettingsPanelModule.js +3 -3
  178. package/src/Strategy/ShortcutModule.d.ts +1 -1
  179. package/src/Strategy/ShortcutModule.js +1 -1
  180. package/src/Strategy/SmartEditModule.js +1 -1
  181. package/src/Strategy/StyledColumnModule.d.ts +1 -1
  182. package/src/Strategy/StyledColumnModule.js +26 -26
  183. package/src/Strategy/SystemStatusModule.js +2 -2
  184. package/src/Strategy/TeamSharingModule.d.ts +1 -0
  185. package/src/Strategy/TeamSharingModule.js +5 -5
  186. package/src/Strategy/ToolPanelModule.d.ts +0 -1
  187. package/src/Strategy/ToolPanelModule.js +0 -23
  188. package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
  189. package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
  190. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  191. package/src/Utilities/Constants/GeneralConstants.js +3 -2
  192. package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
  193. package/src/Utilities/Constants/ModuleConstants.js +7 -7
  194. package/src/Utilities/Defaults/DefaultSettingsPanel.js +7 -6
  195. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -2
  196. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +430 -1
  197. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
  198. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
  199. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
  200. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
  201. package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
  202. package/src/Utilities/Extensions/ArrayExtensions.js +6 -1
  203. package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
  204. package/src/Utilities/Helpers/AdaptableHelper.js +20 -60
  205. package/src/Utilities/Helpers/Helper.d.ts +2 -0
  206. package/src/Utilities/Helpers/Helper.js +6 -1
  207. package/src/Utilities/MenuItem.d.ts +7 -4
  208. package/src/Utilities/MenuItem.js +6 -3
  209. package/src/Utilities/ObjectFactory.d.ts +3 -3
  210. package/src/Utilities/ObjectFactory.js +4 -24
  211. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +4 -2
  212. package/src/Utilities/Services/AggregatedScalarLiveValue.js +26 -19
  213. package/src/Utilities/Services/CellPopupService.js +2 -3
  214. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
  215. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -4
  216. package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
  217. package/src/Utilities/Services/LicenseService/index.js +1 -186
  218. package/src/Utilities/Services/MetamodelService.d.ts +1 -1
  219. package/src/Utilities/Services/MetamodelService.js +6 -3
  220. package/src/Utilities/Services/ModuleService.js +4 -0
  221. package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
  222. package/src/Utilities/Services/QueryLanguageService.js +4 -3
  223. package/src/Utilities/Services/ReportService.d.ts +7 -5
  224. package/src/Utilities/Services/ReportService.js +238 -22
  225. package/src/Utilities/Services/RowEditService.d.ts +3 -2
  226. package/src/Utilities/Services/RowEditService.js +3 -1
  227. package/src/Utilities/adaptableQlUtils.d.ts +2 -0
  228. package/src/Utilities/adaptableQlUtils.js +18 -0
  229. package/src/Utilities/license/decode.js +1 -70
  230. package/src/Utilities/license/hashing.js +1 -47
  231. package/src/View/AdaptableView.js +1 -3
  232. package/src/View/AdaptableViewFactory.js +2 -2
  233. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
  234. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +1 -1
  235. package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
  236. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +3 -3
  237. package/src/View/CalculatedColumn/utils.d.ts +1 -1
  238. package/src/View/CellSummary/CellSummaryPopup.js +1 -1
  239. package/src/View/Comments/CommentsEditor.js +24 -11
  240. package/src/View/Comments/CommentsPopup.js +20 -11
  241. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  242. package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.d.ts +5 -0
  243. package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.js +46 -0
  244. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +5 -2
  245. package/src/View/Components/CellPopup/index.d.ts +1 -0
  246. package/src/View/Components/CellPopup/index.js +5 -2
  247. package/src/View/Components/FilterForm/FilterForm.js +20 -12
  248. package/src/View/Components/FilterForm/QuickFilterForm.js +15 -8
  249. package/src/View/Components/FilterForm/QuickFilterValues.js +39 -23
  250. package/src/View/Components/NewScopeComponent.js +34 -1
  251. package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
  252. package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
  253. package/src/View/Components/Popups/AdaptableToaster.js +1 -1
  254. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +7 -7
  255. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
  256. package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
  257. package/src/View/Components/Selectors/PermittedValuesSelector.js +2 -2
  258. package/src/View/Components/ValueSelector/index.d.ts +1 -0
  259. package/src/View/Components/ValueSelector/index.js +2 -2
  260. package/src/View/CustomSort/CustomSortSummary.js +1 -1
  261. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +8 -9
  262. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
  263. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
  264. package/src/View/GridFilter/GridFilterViewPanel.js +9 -5
  265. package/src/View/GridFilter/useGridFilterExpressionEditor.js +1 -1
  266. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
  267. package/src/View/Layout/LayoutViewPanel.js +2 -1
  268. package/src/View/Layout/TransposedPopup.d.ts +3 -0
  269. package/src/View/Layout/TransposedPopup.js +200 -0
  270. package/src/View/Layout/Wizard/LayoutWizard.js +36 -3
  271. package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
  272. package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +9 -0
  273. package/src/View/Layout/Wizard/sections/RowSummarySection.js +181 -0
  274. package/src/View/License/LicenseWatermark.js +1 -66
  275. package/src/View/Note/NotePopup.d.ts +2 -0
  276. package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +19 -19
  277. package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
  278. package/src/View/Theme/ThemeSelector.js +2 -2
  279. package/src/agGrid/ActionColumnRenderer.js +7 -6
  280. package/src/agGrid/Adaptable.d.ts +3 -455
  281. package/src/agGrid/Adaptable.js +7 -5291
  282. package/src/agGrid/AdaptableAgGrid.d.ts +354 -0
  283. package/src/agGrid/AdaptableAgGrid.js +3972 -0
  284. package/src/agGrid/AdaptableLogger.js +78 -13
  285. package/src/agGrid/AgGridAdapter.d.ts +64 -0
  286. package/src/agGrid/AgGridAdapter.js +590 -0
  287. package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
  288. package/src/agGrid/AgGridColumnAdapter.js +836 -0
  289. package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
  290. package/src/agGrid/AgGridMenuAdapter.js +282 -0
  291. package/src/agGrid/AgGridOptionsService.d.ts +15 -0
  292. package/src/agGrid/AgGridOptionsService.js +80 -0
  293. package/src/agGrid/BadgeRenderer.js +1 -1
  294. package/src/agGrid/CheckboxRenderer.js +1 -1
  295. package/src/agGrid/FilterWrapper.d.ts +2 -2
  296. package/src/agGrid/FilterWrapper.js +1 -1
  297. package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
  298. package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
  299. package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +74 -18
  300. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -1
  301. package/src/agGrid/editors/AdaptableDateEditor/index.js +3 -3
  302. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
  303. package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
  304. package/src/agGrid/weightedAverage.d.ts +0 -2
  305. package/src/agGrid/weightedAverage.js +1 -56
  306. package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
  307. package/src/components/Datepicker/index.d.ts +1 -1
  308. package/src/components/Datepicker/index.js +10 -2
  309. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
  310. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
  311. package/src/components/ExpressionEditor/QueryBuilder/utils.js +3 -17
  312. package/src/components/InfiniteTable/index.js +2 -2
  313. package/src/components/Input/index.d.ts +1 -2
  314. package/src/components/List/ListGroupItem/index.d.ts +1 -1
  315. package/src/components/Modal/index.d.ts +1 -0
  316. package/src/components/Modal/index.js +6 -4
  317. package/src/components/Select/Select.d.ts +3 -1
  318. package/src/components/Select/Select.js +4 -2
  319. package/src/components/Textarea/index.d.ts +2 -2
  320. package/src/components/icons/index.js +2 -0
  321. package/src/components/icons/note.js +2 -2
  322. package/src/components/icons/rows.d.ts +3 -0
  323. package/src/components/icons/rows.js +7 -0
  324. package/src/env.js +2 -2
  325. package/src/metamodel/adaptable.metamodel.d.ts +179 -25
  326. package/src/metamodel/adaptable.metamodel.js +1 -9316
  327. package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
  328. package/src/migration/AdaptableUpgradeHelper.js +52 -0
  329. package/src/migration/VersionUpgrade.d.ts +8 -0
  330. package/src/migration/VersionUpgrade.js +15 -0
  331. package/src/migration/VersionUpgrade17.d.ts +18 -0
  332. package/src/migration/VersionUpgrade17.js +347 -0
  333. package/src/migration/VersionUpgrade18.d.ts +5 -0
  334. package/src/migration/VersionUpgrade18.js +10 -0
  335. package/src/parser/src/parser.js +117 -1257
  336. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
  337. package/src/parser/src/predicate/mapQlPredicateToExpression.js +2 -1
  338. package/src/parser/src/types.d.ts +7 -2
  339. package/src/types.d.ts +26 -19
  340. package/tsconfig.cjs.tsbuildinfo +1 -1
  341. package/src/AdaptableOptions/CommentsOptions.d.ts +0 -28
  342. package/src/Api/Events/CommentsChangedInfo.d.ts +0 -5
  343. package/src/Api/Implementation/NotesApiImpl.d.ts +0 -16
  344. package/src/Api/Implementation/NotesApiImpl.js +0 -44
  345. package/src/Api/NotesApi.d.ts +0 -48
  346. package/src/PredefinedConfig/CellAddress.d.ts +0 -13
  347. package/src/PredefinedConfig/CellAddress.js +0 -5
  348. package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -39
  349. package/src/Redux/ActionsReducers/NotesRedux.js +0 -87
  350. package/src/Strategy/NotesModule.js +0 -62
  351. package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
  352. package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
  353. package/src/View/Components/ScopeComponent.d.ts +0 -24
  354. package/src/View/Components/ScopeComponent.js +0 -138
  355. package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
  356. package/src/View/Export/Wizard/ReportScopeWizard.js +0 -52
  357. package/src/View/Notes/NotesPopup.d.ts +0 -2
  358. package/src/agGrid/agGridHelper.d.ts +0 -57
  359. package/src/agGrid/agGridHelper.js +0 -691
  360. package/src/agGrid/agGridMenuHelper.d.ts +0 -46
  361. package/src/agGrid/agGridMenuHelper.js +0 -673
  362. /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
  363. /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
  364. /package/src/Api/Events/{CommentsChangedInfo.js → CommentChanged.js} +0 -0
  365. /package/src/Api/{NotesApi.js → NoteApi.js} +0 -0
  366. /package/src/PredefinedConfig/{NotesState.js → Common/TransposeConfig.js} +0 -0
  367. /package/src/{Utilities/Services/Interface/IRowEditService.js → PredefinedConfig/NoteState.js} +0 -0
  368. /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
  369. /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.aggregatedScalarExpressionFunctionNames = exports.aggregatedScalarExpressionFunctions = exports.quantileAggregatedExpressionFunctions = exports.cumulativeAggregatedExpressionFunctions = exports.aggregatedExpressionFunctions = void 0;
4
- const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
4
+ const tslib_1 = require("tslib");
5
5
  const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
6
+ const ArrayExtensions_1 = require("../Extensions/ArrayExtensions");
6
7
  const TypeExtensions_1 = require("../Extensions/TypeExtensions");
8
+ const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
9
+ const isAfter_1 = tslib_1.__importDefault(require("date-fns/isAfter"));
10
+ const DateHelper_1 = require("../Helpers/DateHelper");
7
11
  exports.aggregatedExpressionFunctions = [
8
12
  'SUM',
9
13
  'PERCENTAGE',
@@ -14,6 +18,11 @@ exports.aggregatedExpressionFunctions = [
14
18
  'WEIGHT',
15
19
  'COL',
16
20
  'GROUP_BY',
21
+ 'MEDIAN',
22
+ 'MODE',
23
+ 'DISTINCT',
24
+ 'ONLY',
25
+ 'STD_DEVIATION',
17
26
  ];
18
27
  exports.cumulativeAggregatedExpressionFunctions = [
19
28
  'CUMUL',
@@ -80,6 +89,8 @@ exports.aggregatedScalarExpressionFunctions = {
80
89
  field: sumColumnName,
81
90
  initialValue: 0,
82
91
  reducer: (totalSum, rowValue) => {
92
+ // TODO: see why error are not concole logged
93
+ // debuger = 'Adaptable:*'
83
94
  if (isUndefinedValue(rowValue)) {
84
95
  return totalSum;
85
96
  }
@@ -89,6 +100,7 @@ exports.aggregatedScalarExpressionFunctions = {
89
100
  },
90
101
  },
91
102
  rowFilterFn: context.filterFn,
103
+ getRowNodes: context.getRowNodes,
92
104
  };
93
105
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
94
106
  const result = {
@@ -107,6 +119,7 @@ exports.aggregatedScalarExpressionFunctions = {
107
119
  ],
108
120
  examples: ['SUM([colA])', 'SUM([colA], GROUP_BY([colB]))'],
109
121
  category: 'aggregation',
122
+ inputs: ['number'],
110
123
  },
111
124
  PERCENTAGE: {
112
125
  handler(args, context) {
@@ -151,6 +164,7 @@ exports.aggregatedScalarExpressionFunctions = {
151
164
  100);
152
165
  },
153
166
  rowFilterFn: context.filterFn,
167
+ getRowNodes: context.getRowNodes,
154
168
  };
155
169
  addGroupByParams(groupByColumnNames, aggregationExpressionEvaluation);
156
170
  const result = {
@@ -225,6 +239,7 @@ exports.aggregatedScalarExpressionFunctions = {
225
239
  },
226
240
  },
227
241
  rowFilterFn: context.filterFn,
242
+ getRowNodes: context.getRowNodes,
228
243
  };
229
244
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
230
245
  if (weightParameter) {
@@ -248,6 +263,294 @@ exports.aggregatedScalarExpressionFunctions = {
248
263
  ],
249
264
  examples: ['AVG([colA])', 'AVG([colA], GROUP_BY([colB]))', 'AVG([colA], WEIGHT([colB]))'],
250
265
  category: 'aggregation',
266
+ inputs: ['number'],
267
+ },
268
+ MEDIAN: {
269
+ handler(args, context) {
270
+ const medianColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('MEDIAN', args);
271
+ const medianColumnName = medianColumnParameter.value;
272
+ (0, expressionFunctionUtils_1.validateColumnType)(medianColumnName, ['Number'], 'MEDIAN', context.adaptableApi);
273
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MEDIAN', 'operand', ['GROUP_BY'], args, {
274
+ isOptional: true,
275
+ });
276
+ const getCellValue = (rowNode) => {
277
+ return context.adaptableApi.gridApi.getNormalisedValueFromRowNode(rowNode, medianColumnName);
278
+ };
279
+ const aggregationExpressionEvaluation = {
280
+ aggregationParams: {
281
+ reducers: {
282
+ MEDIAN: {
283
+ name: 'MEDIAN',
284
+ field: medianColumnName,
285
+ initialValue: [],
286
+ reducer: (aggregatedValue, value, rowNode) => {
287
+ aggregatedValue.push(rowNode);
288
+ return aggregatedValue;
289
+ },
290
+ done: (aggregatedValue) => {
291
+ if (aggregatedValue.length === 0) {
292
+ return null;
293
+ }
294
+ if (aggregatedValue.length === 1) {
295
+ return getCellValue(aggregatedValue[0]);
296
+ }
297
+ const lenght = aggregatedValue.length;
298
+ const middle = Math.floor((lenght - 1) / 2);
299
+ if (lenght % 2) {
300
+ return getCellValue(aggregatedValue[middle]);
301
+ }
302
+ else {
303
+ return ((getCellValue(aggregatedValue[middle]) +
304
+ getCellValue(aggregatedValue[middle + 1])) /
305
+ 2.0);
306
+ }
307
+ },
308
+ },
309
+ },
310
+ },
311
+ rowFilterFn: context.filterFn,
312
+ getRowNodes: context.getRowNodes,
313
+ };
314
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
315
+ const result = {
316
+ name: 'MEDIAN',
317
+ type: 'aggregationScalar',
318
+ value: aggregationExpressionEvaluation,
319
+ };
320
+ return result;
321
+ },
322
+ description: 'Aggregates a column over multiple rows by computing the median of the column values\nOptionally the aggregation may be grouped.',
323
+ signatures: [
324
+ 'MEDIAN( [colName] )',
325
+ 'MEDIAN( COL(name: string))',
326
+ 'MEDIAN( [colNameA], GROUP_BY( [colNameB] ))',
327
+ 'MEDIAN( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
328
+ ],
329
+ examples: ['MEDIAN([colA])', 'MEDIAN([colA], GROUP_BY([colB]))'],
330
+ category: 'aggregation',
331
+ inputs: ['number'],
332
+ },
333
+ MODE: {
334
+ handler(args, context) {
335
+ const modeColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('mode', args);
336
+ const modeColumnName = modeColumnParameter.value;
337
+ (0, expressionFunctionUtils_1.validateColumnType)(modeColumnName, ['Number', 'String'], 'mode', context.adaptableApi);
338
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MODE', 'operand', ['GROUP_BY'], args, {
339
+ isOptional: true,
340
+ });
341
+ const aggregationExpressionEvaluation = {
342
+ aggregationParams: {
343
+ reducers: {
344
+ MODE: {
345
+ name: 'MODE',
346
+ field: modeColumnName,
347
+ initialValue: new Map(),
348
+ reducer: (aggregatedValue, rowValue, rowNode) => {
349
+ var _a;
350
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
351
+ return aggregatedValue;
352
+ }
353
+ if (!aggregatedValue) {
354
+ return new Map();
355
+ }
356
+ aggregatedValue.set(rowValue, ((_a = aggregatedValue.get(rowValue)) !== null && _a !== void 0 ? _a : 0) + 1);
357
+ return aggregatedValue;
358
+ },
359
+ done: (aggregatedValue) => {
360
+ var _a;
361
+ const sorted = [...aggregatedValue.entries()].sort(([aVal, aFreq], [bVal, bFreq]) => {
362
+ if (aFreq < bFreq) {
363
+ return 1;
364
+ }
365
+ else if (aFreq > bFreq || aVal < bVal) {
366
+ return -1;
367
+ }
368
+ else {
369
+ return aVal === bVal ? 0 : 1;
370
+ }
371
+ });
372
+ return (_a = sorted === null || sorted === void 0 ? void 0 : sorted[0]) === null || _a === void 0 ? void 0 : _a[0];
373
+ },
374
+ },
375
+ },
376
+ },
377
+ rowFilterFn: context.filterFn,
378
+ getRowNodes: context.getRowNodes,
379
+ };
380
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
381
+ const result = {
382
+ name: 'MODE',
383
+ type: 'aggregationScalar',
384
+ value: aggregationExpressionEvaluation,
385
+ };
386
+ return result;
387
+ },
388
+ description: 'Aggregates a column over multiple rows by computing the mode of the column values\nOptionally the aggregation may be grouped.',
389
+ signatures: [
390
+ 'MODE( [colName] )',
391
+ 'MODE( COL(name: string))',
392
+ 'MODE( [colNameA], GROUP_BY( [colNameB] ))',
393
+ 'MODE( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
394
+ ],
395
+ examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
396
+ category: 'aggregation',
397
+ inputs: [['number'], ['text']],
398
+ },
399
+ DISTINCT: {
400
+ handler(args, context) {
401
+ const distinctColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('DISTINCT', args);
402
+ const distinctColumnName = distinctColumnParameter.value;
403
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MODE', 'operand', ['GROUP_BY'], args, {
404
+ isOptional: true,
405
+ });
406
+ const aggregationExpressionEvaluation = {
407
+ aggregationParams: {
408
+ reducers: {
409
+ DISTINCT: {
410
+ name: 'DISTINCT',
411
+ field: distinctColumnName,
412
+ initialValue: new Set(),
413
+ reducer: (aggregatedValue, rowValue, rowNode) => {
414
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
415
+ return aggregatedValue;
416
+ }
417
+ aggregatedValue.add(rowValue);
418
+ return aggregatedValue;
419
+ },
420
+ done: (aggregatedValue) => {
421
+ return aggregatedValue.size;
422
+ },
423
+ },
424
+ },
425
+ },
426
+ getRowNodes: context.getRowNodes,
427
+ };
428
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
429
+ const result = {
430
+ name: 'DISTINCT',
431
+ type: 'aggregationScalar',
432
+ value: aggregationExpressionEvaluation,
433
+ };
434
+ return result;
435
+ },
436
+ description: 'Aggregates a column over multiple rows by computing the distinct number of the column values\nOptionally the aggregation may be grouped.',
437
+ signatures: [
438
+ 'DISTINCT( [colName] )',
439
+ 'DISTINCT( COL(name: string))',
440
+ 'DISTINCT( [colNameA], GROUP_BY( [colNameB] ))',
441
+ 'DISTINCT( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
442
+ ],
443
+ examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
444
+ category: 'aggregation',
445
+ inputs: [['number'], ['text']],
446
+ },
447
+ ONLY: {
448
+ handler(args, context) {
449
+ const distinctColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('ONLY', args);
450
+ const onlyColumnName = distinctColumnParameter.value;
451
+ (0, expressionFunctionUtils_1.validateColumnType)(onlyColumnName, ['Number'], 'ONLY', context.adaptableApi);
452
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('ONLY', 'operand', ['GROUP_BY'], args, {
453
+ isOptional: true,
454
+ });
455
+ const aggregationExpressionEvaluation = {
456
+ aggregationParams: {
457
+ reducers: {
458
+ ONLY: {
459
+ name: 'ONLY',
460
+ field: onlyColumnName,
461
+ initialValue: new Set(),
462
+ reducer: (aggregatedValue, rowValue, rowNode) => {
463
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
464
+ return aggregatedValue;
465
+ }
466
+ aggregatedValue.add(rowValue);
467
+ return aggregatedValue;
468
+ },
469
+ done: (aggregatedValue) => {
470
+ return aggregatedValue.size === 1 ? aggregatedValue.values().next().value : null;
471
+ },
472
+ },
473
+ },
474
+ },
475
+ rowFilterFn: context.filterFn,
476
+ getRowNodes: context.getRowNodes,
477
+ };
478
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
479
+ const result = {
480
+ name: 'ONLY',
481
+ type: 'aggregationScalar',
482
+ value: aggregationExpressionEvaluation,
483
+ };
484
+ return result;
485
+ },
486
+ description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
487
+ signatures: [
488
+ 'ONLY( [colName] )',
489
+ 'ONLY( COL(name: string))',
490
+ 'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
491
+ 'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
492
+ ],
493
+ examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
494
+ category: 'aggregation',
495
+ inputs: [['number'], ['text']],
496
+ },
497
+ STD_DEVIATION: {
498
+ handler(args, context) {
499
+ const columnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('STD_DEVIATION', args);
500
+ const columnName = columnParameter.value;
501
+ (0, expressionFunctionUtils_1.validateColumnType)(columnName, ['Number'], 'STD_DEVIATION', context.adaptableApi);
502
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('STD_DEVIATION', 'operand', ['GROUP_BY'], args, {
503
+ isOptional: true,
504
+ });
505
+ const aggregationExpressionEvaluation = {
506
+ aggregationParams: {
507
+ reducers: {
508
+ STD_DEVIATION: {
509
+ name: 'STD_DEVIATION',
510
+ field: columnName,
511
+ initialValue: { sumOfValues: 0, values: [] },
512
+ reducer: (aggregatedValue, rowValue, rowNode) => {
513
+ // TODO: getNumericValue; allow numeric strings
514
+ if (typeof rowValue !== 'number' || isNaN(rowValue)) {
515
+ return aggregatedValue;
516
+ }
517
+ aggregatedValue.sumOfValues = aggregatedValue.sumOfValues + rowValue;
518
+ aggregatedValue.values.push(rowValue);
519
+ return aggregatedValue;
520
+ },
521
+ done: (aggregatedValue) => {
522
+ const { sumOfValues, values } = aggregatedValue;
523
+ if (values.length === 0) {
524
+ return 0;
525
+ }
526
+ const mean = sumOfValues / values.length;
527
+ const variance = (0, ArrayExtensions_1.SumArray)(values.map((value) => Math.pow(value - mean, 2))) / values.length;
528
+ return Math.sqrt(variance);
529
+ },
530
+ },
531
+ },
532
+ },
533
+ rowFilterFn: context.filterFn,
534
+ getRowNodes: context.getRowNodes,
535
+ };
536
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
537
+ const result = {
538
+ name: 'STD_DEVIATION',
539
+ type: 'aggregationScalar',
540
+ value: aggregationExpressionEvaluation,
541
+ };
542
+ return result;
543
+ },
544
+ description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
545
+ signatures: [
546
+ 'ONLY( [colName] )',
547
+ 'ONLY( COL(name: string))',
548
+ 'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
549
+ 'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
550
+ ],
551
+ examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
552
+ category: 'aggregation',
553
+ inputs: ['number'],
251
554
  },
252
555
  MIN: {
253
556
  handler(args, context) {
@@ -280,6 +583,7 @@ exports.aggregatedScalarExpressionFunctions = {
280
583
  },
281
584
  },
282
585
  rowFilterFn: context.filterFn,
586
+ getRowNodes: context.getRowNodes,
283
587
  };
284
588
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
285
589
  const result = {
@@ -298,6 +602,7 @@ exports.aggregatedScalarExpressionFunctions = {
298
602
  ],
299
603
  examples: ['MIN([colA])', 'MIN([colA], GROUP_BY([colB]))'],
300
604
  category: 'aggregation',
605
+ inputs: ['number'],
301
606
  },
302
607
  MAX: {
303
608
  handler(args, context) {
@@ -330,6 +635,7 @@ exports.aggregatedScalarExpressionFunctions = {
330
635
  },
331
636
  },
332
637
  rowFilterFn: context.filterFn,
638
+ getRowNodes: context.getRowNodes,
333
639
  };
334
640
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
335
641
  const result = {
@@ -348,6 +654,7 @@ exports.aggregatedScalarExpressionFunctions = {
348
654
  ],
349
655
  examples: ['MIN([colA])', 'MIN([colA], GROUP_BY([colB]))'],
350
656
  category: 'aggregation',
657
+ inputs: ['number'],
351
658
  },
352
659
  QUANT: {
353
660
  handler(args, context) {
@@ -448,6 +755,7 @@ exports.aggregatedScalarExpressionFunctions = {
448
755
  const rowValue = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, quantileColumnName);
449
756
  return isDefinedValue(rowValue);
450
757
  },
758
+ getRowNodes: context.getRowNodes,
451
759
  aggregationParams: {
452
760
  reducers: {
453
761
  QUANT: Object.assign({ name: 'QUANT', field: quantileColumnName }, quantReducer),
@@ -526,6 +834,7 @@ exports.aggregatedScalarExpressionFunctions = {
526
834
  },
527
835
  },
528
836
  rowFilterFn: context.filterFn,
837
+ getRowNodes: context.getRowNodes,
529
838
  };
530
839
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
531
840
  const result = {
@@ -544,6 +853,7 @@ exports.aggregatedScalarExpressionFunctions = {
544
853
  ],
545
854
  examples: ['COUNT([colA])', 'COUNT([colA], GROUP_BY([colB]))'],
546
855
  category: 'aggregation',
856
+ inputs: [['number'], ['text']],
547
857
  },
548
858
  OVER: {
549
859
  handler(args, context) {
@@ -605,6 +915,124 @@ exports.aggregatedScalarExpressionFunctions = {
605
915
  examples: ['[col1]', 'COL("col1")'],
606
916
  category: 'special',
607
917
  },
918
+ OLDEST: {
919
+ handler(args, context) {
920
+ const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('OLDEST', args);
921
+ const minColumnName = minColumnParameter.value;
922
+ (0, expressionFunctionUtils_1.validateColumnType)(minColumnName, ['Date'], 'OLDEST', context.adaptableApi);
923
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('OLDEST', 'operand', ['GROUP_BY'], args, {
924
+ isOptional: true,
925
+ });
926
+ const aggregationExpressionEvaluation = {
927
+ aggregationParams: {
928
+ reducers: {
929
+ OLDEST: {
930
+ name: 'OLDEST',
931
+ field: minColumnName,
932
+ initialValue: null,
933
+ reducer: (minValue, rowValue) => {
934
+ if (!minValue) {
935
+ return rowValue;
936
+ }
937
+ if (!rowValue) {
938
+ return minValue;
939
+ }
940
+ if ((0, isAfter_1.default)((0, DateHelper_1.parseDateValue)(minValue), (0, DateHelper_1.parseDateValue)(rowValue))) {
941
+ return rowValue;
942
+ }
943
+ else {
944
+ return minValue;
945
+ }
946
+ },
947
+ done: (minValue, arr) => {
948
+ if (minValue !== null) {
949
+ return minValue;
950
+ }
951
+ },
952
+ },
953
+ },
954
+ },
955
+ rowFilterFn: context.filterFn,
956
+ getRowNodes: context.getRowNodes,
957
+ };
958
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
959
+ const result = {
960
+ name: 'OLDEST',
961
+ type: 'aggregationScalar',
962
+ value: aggregationExpressionEvaluation,
963
+ };
964
+ return result;
965
+ },
966
+ description: 'Aggregates a column over multiple rows by computing the minimum of the column values\nOptionally the aggregation may be computed within provided individual groups',
967
+ signatures: [
968
+ 'OLDEST( [colName] )',
969
+ 'OLDEST( COL(name: string))',
970
+ 'OLDEST( [colNameA], GROUP_BY( [colNameB] ))',
971
+ 'OLDEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
972
+ ],
973
+ examples: ['OLDEST([colA])', 'OLDEST([colA], GROUP_BY([colB]))'],
974
+ category: 'aggregation',
975
+ inputs: ['date'],
976
+ },
977
+ YOUNGEST: {
978
+ handler(args, context) {
979
+ const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('YOUNGEST', args);
980
+ const minColumnName = minColumnParameter.value;
981
+ (0, expressionFunctionUtils_1.validateColumnType)(minColumnName, ['Date'], 'YOUNGEST', context.adaptableApi);
982
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('YOUNGEST', 'operand', ['GROUP_BY'], args, {
983
+ isOptional: true,
984
+ });
985
+ const aggregationExpressionEvaluation = {
986
+ aggregationParams: {
987
+ reducers: {
988
+ YOUNGEST: {
989
+ name: 'YOUNGEST',
990
+ field: minColumnName,
991
+ initialValue: null,
992
+ reducer: (minValue, rowValue) => {
993
+ if (!minValue) {
994
+ return rowValue;
995
+ }
996
+ if (!rowValue) {
997
+ return minValue;
998
+ }
999
+ if ((0, isAfter_1.default)((0, DateHelper_1.parseDateValue)(minValue), (0, DateHelper_1.parseDateValue)(rowValue))) {
1000
+ return minValue;
1001
+ }
1002
+ else {
1003
+ return rowValue;
1004
+ }
1005
+ },
1006
+ done: (minValue, arr) => {
1007
+ if (minValue !== null) {
1008
+ return minValue;
1009
+ }
1010
+ },
1011
+ },
1012
+ },
1013
+ },
1014
+ rowFilterFn: context.filterFn,
1015
+ getRowNodes: context.getRowNodes,
1016
+ };
1017
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
1018
+ const result = {
1019
+ name: 'YOUNGEST',
1020
+ type: 'aggregationScalar',
1021
+ value: aggregationExpressionEvaluation,
1022
+ };
1023
+ return result;
1024
+ },
1025
+ description: 'Aggregates a column over multiple rows by computing the minimum of the column values\nOptionally the aggregation may be computed within provided individual groups',
1026
+ signatures: [
1027
+ 'YOUNGEST( [colName] )',
1028
+ 'YOUNGEST( COL(name: string))',
1029
+ 'YOUNGEST( [colNameA], GROUP_BY( [colNameB] ))',
1030
+ 'YOUNGEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
1031
+ ],
1032
+ examples: ['YOUNGEST([colA])', 'YOUNGEST([colA], GROUP_BY([colB]))'],
1033
+ category: 'aggregation',
1034
+ inputs: ['date'],
1035
+ },
608
1036
  };
609
1037
  const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, context) => {
610
1038
  const aggregationEvaluation = aggregationParameter.value;
@@ -748,6 +1176,7 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
748
1176
  },
749
1177
  rowValueGetter,
750
1178
  rowFilterFn: aggregationEvaluation.rowFilterFn,
1179
+ getRowNodes: context.getRowNodes,
751
1180
  };
752
1181
  return cumulationExpressionEvaluation;
753
1182
  };
@@ -279,10 +279,10 @@ const isLastElementMinValue = (values) => {
279
279
  };
280
280
  // useful for functions which do NOT have an initial change (ex. GRID_CHANGE NONE)
281
281
  const getDataChangedInfoStub = (context) => {
282
- var _a;
282
+ var _a, _b;
283
283
  let rowNodeStub;
284
284
  if (!context.filterFn) {
285
- rowNodeStub = context.adaptableApi.gridApi.getFirstRowNode();
285
+ rowNodeStub = (_a = context.node) !== null && _a !== void 0 ? _a : context.adaptableApi.gridApi.getFirstRowNode();
286
286
  }
287
287
  else {
288
288
  // if there is a WHERE clause defined, find the first rowNode which satisfies the condition
@@ -297,7 +297,7 @@ const getDataChangedInfoStub = (context) => {
297
297
  const rowNode = rowNodeStub;
298
298
  if (rowNode) {
299
299
  const primaryKeyValue = context.adaptableApi.gridApi.getPrimaryKeyValueForRowNode(rowNode);
300
- const columnId = (_a = context.adaptableApi.columnApi.getQueryableColumns()[0]) === null || _a === void 0 ? void 0 : _a.columnId;
300
+ const columnId = (_b = context.adaptableApi.columnApi.getQueryableColumns()[0]) === null || _b === void 0 ? void 0 : _b.columnId;
301
301
  const oldValue = context.adaptableApi.gridApi.getCellRawValue(primaryKeyValue, columnId);
302
302
  const column = context.adaptableApi.columnApi.getColumnWithColumnId(columnId);
303
303
  const newValue = oldValue;
@@ -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++) {
@@ -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[];
@@ -72,6 +72,21 @@ exports.scalarExpressionFunctions = {
72
72
  category: 'special',
73
73
  returnType: 'any',
74
74
  },
75
+ FIELD: {
76
+ handler(args, context) {
77
+ var _a, _b;
78
+ const fieldName = args[0];
79
+ if (StringExtensions_1.default.IsNullOrEmpty(fieldName)) {
80
+ throw new ExpressionEvaluationError_1.ExpressionEvaluationError('FIELD', 'requires a field name');
81
+ }
82
+ 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);
83
+ },
84
+ 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")',
85
+ signatures: ['FIELD(fieldName:string)'],
86
+ examples: ['FIELD("fieldName")', 'FIELD("nested.fieldName")'],
87
+ category: 'special',
88
+ returnType: 'any',
89
+ },
75
90
  QUERY: {
76
91
  handler(args, context) {
77
92
  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;
@@ -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;