@adaptabletools/adaptable 19.2.4 → 20.0.0-canary.1

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 (1665) hide show
  1. package/agGrid.d.ts +1 -1
  2. package/base.css +3903 -1294
  3. package/base.css.map +1 -1
  4. package/index.css +2967 -2120
  5. package/index.css.map +1 -1
  6. package/package.json +17 -16
  7. package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -1
  8. package/src/AdaptableInterfaces/IAdaptable.d.ts +28 -32
  9. package/src/AdaptableOptions/ActionColumnOptions.d.ts +17 -4
  10. package/src/AdaptableOptions/AdaptableOptions.d.ts +14 -31
  11. package/src/AdaptableOptions/AdaptablePlugin.d.ts +2 -2
  12. package/src/AdaptableOptions/AlertOptions.d.ts +6 -6
  13. package/src/AdaptableOptions/CellSummaryOptions.d.ts +9 -4
  14. package/src/AdaptableOptions/ColumnMenuOptions.d.ts +4 -3
  15. package/src/AdaptableOptions/ColumnOptions.d.ts +5 -1
  16. package/src/AdaptableOptions/ContextMenuOptions.d.ts +13 -9
  17. package/src/AdaptableOptions/DashboardOptions.d.ts +12 -8
  18. package/src/AdaptableOptions/DataImportOptions.d.ts +1 -1
  19. package/src/AdaptableOptions/DefaultAdaptableOptions.d.ts +1 -1
  20. package/src/AdaptableOptions/DefaultAdaptableOptions.js +234 -251
  21. package/src/AdaptableOptions/EditOptions.d.ts +27 -1
  22. package/src/AdaptableOptions/ExportOptions.d.ts +128 -55
  23. package/src/AdaptableOptions/ExpressionOptions.d.ts +3 -7
  24. package/src/AdaptableOptions/Fdc3Options.d.ts +7 -1
  25. package/src/AdaptableOptions/FilterOptions.d.ts +219 -0
  26. package/src/AdaptableOptions/FormatColumnOptions.d.ts +1 -1
  27. package/src/AdaptableOptions/LayoutOptions.d.ts +4 -45
  28. package/src/AdaptableOptions/MasterDetailPluginOptions.d.ts +1 -1
  29. package/src/AdaptableOptions/PredicateOptions.d.ts +6 -0
  30. package/src/AdaptableOptions/QuickSearchOptions.d.ts +11 -28
  31. package/src/AdaptableOptions/RowFormOptions.d.ts +116 -0
  32. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +3 -3
  33. package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -2
  34. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +13 -121
  35. package/src/Api/ActionColumnApi.d.ts +5 -0
  36. package/src/Api/AdaptableApi.d.ts +10 -19
  37. package/src/Api/AlertApi.d.ts +2 -2
  38. package/src/Api/CalculatedColumnApi.d.ts +4 -0
  39. package/src/Api/CellSummaryApi.d.ts +6 -6
  40. package/src/Api/ChartingApi.d.ts +1 -1
  41. package/src/Api/ColumnApi.d.ts +41 -65
  42. package/src/Api/ColumnFilterApi.d.ts +3 -3
  43. package/src/Api/ColumnMenuApi.d.ts +62 -0
  44. package/src/Api/ColumnScopeApi.d.ts +1 -1
  45. package/src/Api/CommentApi.d.ts +4 -4
  46. package/src/Api/ConfigApi.d.ts +1 -3
  47. package/src/Api/ContextMenuApi.d.ts +62 -0
  48. package/src/Api/DashboardApi.d.ts +1 -1
  49. package/src/Api/EventApi.d.ts +22 -22
  50. package/src/Api/Events/AdaptableReady.d.ts +3 -3
  51. package/src/Api/Events/AdaptableStateChanged.d.ts +2 -10
  52. package/src/Api/Events/AdaptableStateReloaded.d.ts +2 -6
  53. package/src/Api/Events/AlertFired.d.ts +2 -2
  54. package/src/Api/Events/CalculatedColumnChanged.d.ts +2 -2
  55. package/src/Api/Events/CellChanged.d.ts +3 -3
  56. package/src/Api/Events/CellSelectionChanged.d.ts +2 -2
  57. package/src/Api/Events/ChartChanged.d.ts +2 -3
  58. package/src/Api/Events/ColumnFilterApplied.d.ts +2 -3
  59. package/src/Api/Events/CommentChanged.d.ts +2 -3
  60. package/src/Api/Events/CustomToolbarConfigured.d.ts +2 -2
  61. package/src/Api/Events/DashboardChanged.d.ts +2 -2
  62. package/src/Api/Events/DataImported.d.ts +3 -3
  63. package/src/Api/Events/DataSetSelected.d.ts +2 -3
  64. package/src/Api/Events/Fdc3MessageInfo.d.ts +3 -3
  65. package/src/Api/Events/FlashingCellDisplayed.d.ts +2 -2
  66. package/src/Api/Events/GridFilterApplied.d.ts +2 -3
  67. package/src/Api/Events/GridSorted.d.ts +3 -17
  68. package/src/Api/Events/LayoutChanged.d.ts +2 -2
  69. package/src/Api/Events/LiveDataChanged.d.ts +2 -2
  70. package/src/Api/Events/RowChanged.d.ts +11 -0
  71. package/src/Api/Events/RowFormSubmitted.d.ts +54 -0
  72. package/src/Api/Events/RowSelectionChanged.d.ts +2 -2
  73. package/src/Api/Events/ScheduleTriggered.d.ts +2 -2
  74. package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +2 -2
  75. package/src/Api/Events/TeamSharingEntityChanged.d.ts +2 -2
  76. package/src/Api/Events/ThemeChanged.d.ts +2 -2
  77. package/src/Api/ExportApi.d.ts +75 -69
  78. package/src/Api/ExpressionApi.d.ts +2 -2
  79. package/src/Api/Fdc3Api.d.ts +1 -9
  80. package/src/Api/FilterApi.d.ts +18 -0
  81. package/src/Api/FormatColumnApi.d.ts +7 -2
  82. package/src/Api/FreeTextColumnApi.d.ts +1 -1
  83. package/src/Api/GridApi.d.ts +51 -35
  84. package/src/Api/GridFilterApi.d.ts +1 -2
  85. package/src/Api/IPushPullApi.d.ts +1 -1
  86. package/src/Api/Implementation/ActionColumnApiImpl.d.ts +5 -2
  87. package/src/Api/Implementation/ActionColumnApiImpl.js +8 -31
  88. package/src/Api/Implementation/AdaptableApiImpl.d.ts +5 -8
  89. package/src/Api/Implementation/AdaptableApiImpl.js +6 -11
  90. package/src/Api/Implementation/AlertApiImpl.d.ts +2 -2
  91. package/src/Api/Implementation/AlertApiImpl.js +42 -48
  92. package/src/Api/Implementation/ApiBase.d.ts +10 -7
  93. package/src/Api/Implementation/ApiBase.js +21 -18
  94. package/src/Api/Implementation/BulkUpdateApiImpl.js +1 -1
  95. package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +1 -0
  96. package/src/Api/Implementation/CalculatedColumnApiImpl.js +26 -22
  97. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +3 -3
  98. package/src/Api/Implementation/CellSummaryApiImpl.js +6 -8
  99. package/src/Api/Implementation/ChartingApiImpl.d.ts +1 -1
  100. package/src/Api/Implementation/ChartingApiImpl.js +30 -24
  101. package/src/Api/Implementation/ColumnApiImpl.d.ts +22 -16
  102. package/src/Api/Implementation/ColumnApiImpl.js +180 -112
  103. package/src/Api/Implementation/ColumnFilterApiImpl.d.ts +4 -4
  104. package/src/Api/Implementation/ColumnFilterApiImpl.js +53 -51
  105. package/src/Api/Implementation/ColumnMenuApiImpl.d.ts +13 -0
  106. package/src/Api/Implementation/ColumnMenuApiImpl.js +51 -0
  107. package/src/Api/Implementation/ColumnScopeApiImpl.d.ts +1 -1
  108. package/src/Api/Implementation/ColumnScopeApiImpl.js +16 -21
  109. package/src/Api/Implementation/CommentsApiImpl.d.ts +4 -4
  110. package/src/Api/Implementation/CommentsApiImpl.js +8 -11
  111. package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -3
  112. package/src/Api/Implementation/ConfigApiImpl.js +17 -25
  113. package/src/Api/Implementation/ContextMenuApiImpl.d.ts +13 -0
  114. package/src/Api/Implementation/ContextMenuApiImpl.js +51 -0
  115. package/src/Api/Implementation/CustomSortApiImpl.js +5 -3
  116. package/src/Api/Implementation/DashboardApiImpl.js +8 -7
  117. package/src/Api/Implementation/DataChangeHistoryApiImpl.js +10 -11
  118. package/src/Api/Implementation/DataSetApiImpl.js +5 -6
  119. package/src/Api/Implementation/EntitlementApiImpl.js +6 -2
  120. package/src/Api/Implementation/EventApiImpl.d.ts +2 -0
  121. package/src/Api/Implementation/EventApiImpl.js +2 -0
  122. package/src/Api/Implementation/ExportApiImpl.d.ts +22 -19
  123. package/src/Api/Implementation/ExportApiImpl.js +105 -58
  124. package/src/Api/Implementation/ExpressionApiImpl.d.ts +2 -2
  125. package/src/Api/Implementation/ExpressionApiImpl.js +11 -5
  126. package/src/Api/Implementation/Fdc3ApiImpl.d.ts +1 -3
  127. package/src/Api/Implementation/Fdc3ApiImpl.js +1 -33
  128. package/src/Api/Implementation/FilterApiImpl.d.ts +13 -0
  129. package/src/Api/Implementation/FilterApiImpl.js +16 -0
  130. package/src/Api/Implementation/FlashingCellApiImpl.js +16 -25
  131. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +3 -1
  132. package/src/Api/Implementation/FormatColumnApiImpl.js +19 -12
  133. package/src/Api/Implementation/FreeTextColumnApiImpl.d.ts +1 -1
  134. package/src/Api/Implementation/FreeTextColumnApiImpl.js +5 -6
  135. package/src/Api/Implementation/GridApiImpl.d.ts +15 -12
  136. package/src/Api/Implementation/GridApiImpl.js +92 -82
  137. package/src/Api/Implementation/GridFilterApiImpl.js +6 -4
  138. package/src/Api/Implementation/LayoutApiImpl.d.ts +7 -9
  139. package/src/Api/Implementation/LayoutApiImpl.js +45 -50
  140. package/src/Api/Implementation/LayoutHelpers.d.ts +23 -0
  141. package/src/Api/Implementation/LayoutHelpers.js +303 -0
  142. package/src/Api/Implementation/NamedQueryApiImpl.js +1 -1
  143. package/src/Api/Implementation/NoteApiImpl.js +4 -1
  144. package/src/Api/Implementation/OptionsApiImpl.d.ts +9 -12
  145. package/src/Api/Implementation/OptionsApiImpl.js +25 -11
  146. package/src/Api/Implementation/PlusMinusApiImpl.js +2 -3
  147. package/src/Api/Implementation/PredicateApiImpl.d.ts +1 -0
  148. package/src/Api/Implementation/PredicateApiImpl.js +22 -8
  149. package/src/Api/Implementation/QuickSearchApiImpl.js +3 -3
  150. package/src/Api/Implementation/RowFormApiImpl.d.ts +11 -0
  151. package/src/Api/Implementation/{ActionRowApiImpl.js → RowFormApiImpl.js} +8 -16
  152. package/src/Api/Implementation/ScheduleApiImpl.d.ts +0 -2
  153. package/src/Api/Implementation/ScheduleApiImpl.js +10 -14
  154. package/src/Api/Implementation/ShortcutApiImpl.js +3 -3
  155. package/src/Api/Implementation/SmartEditApiImpl.js +7 -8
  156. package/src/Api/Implementation/StatusBarApiImpl.d.ts +1 -1
  157. package/src/Api/Implementation/StyledColumnApiImpl.js +1 -2
  158. package/src/Api/Implementation/SystemStatusApiImpl.js +8 -7
  159. package/src/Api/Implementation/TeamSharingApiImpl.js +5 -6
  160. package/src/Api/Implementation/ThemeApiImpl.js +6 -11
  161. package/src/Api/Implementation/ToolPanelApiImpl.js +3 -6
  162. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +2 -15
  163. package/src/Api/Implementation/UserInterfaceApiImpl.js +29 -117
  164. package/src/Api/Internal/ActionColumnInternalApi.d.ts +13 -0
  165. package/src/Api/Internal/ActionColumnInternalApi.js +139 -0
  166. package/src/Api/Internal/AdaptableInternalApi.d.ts +27 -28
  167. package/src/Api/Internal/AdaptableInternalApi.js +70 -126
  168. package/src/Api/Internal/AlertInternalApi.d.ts +15 -18
  169. package/src/Api/Internal/AlertInternalApi.js +158 -139
  170. package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -2
  171. package/src/Api/Internal/CalculatedColumnInternalApi.js +37 -29
  172. package/src/Api/Internal/ChartingInternalApi.js +33 -18
  173. package/src/Api/Internal/ColumnFilterInternalApi.d.ts +6 -22
  174. package/src/Api/Internal/ColumnFilterInternalApi.js +69 -91
  175. package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
  176. package/src/Api/Internal/ColumnInternalApi.js +30 -2
  177. package/src/Api/Internal/CommentsInternalApi.d.ts +1 -1
  178. package/src/Api/Internal/CommentsInternalApi.js +2 -3
  179. package/src/Api/Internal/CustomSortInternalApi.d.ts +2 -0
  180. package/src/Api/Internal/CustomSortInternalApi.js +22 -7
  181. package/src/Api/Internal/DashboardInternalApi.d.ts +0 -4
  182. package/src/Api/Internal/DashboardInternalApi.js +3 -38
  183. package/src/Api/Internal/DataImportInternalApi.d.ts +0 -6
  184. package/src/Api/Internal/DataImportInternalApi.js +22 -21
  185. package/src/Api/Internal/DataSetInternalApi.d.ts +1 -5
  186. package/src/Api/Internal/DataSetInternalApi.js +15 -8
  187. package/src/Api/Internal/EntitlementInternalApi.js +2 -2
  188. package/src/Api/Internal/EventInternalApi.d.ts +27 -0
  189. package/src/Api/Internal/EventInternalApi.js +194 -0
  190. package/src/Api/Internal/ExportInternalApi.d.ts +19 -26
  191. package/src/Api/Internal/ExportInternalApi.js +175 -399
  192. package/src/Api/Internal/ExpressionInternalApi.js +21 -17
  193. package/src/Api/Internal/Fdc3InternalApi.d.ts +3 -2
  194. package/src/Api/Internal/Fdc3InternalApi.js +66 -34
  195. package/src/Api/Internal/FilterInternalApi.d.ts +3 -0
  196. package/src/Api/Internal/FilterInternalApi.js +3 -0
  197. package/src/Api/Internal/FlashingCellInternalApi.js +3 -4
  198. package/src/Api/Internal/FormatColumnInternalApi.d.ts +1 -1
  199. package/src/Api/Internal/FormatColumnInternalApi.js +34 -23
  200. package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -1
  201. package/src/Api/Internal/FreeTextColumnInternalApi.js +32 -26
  202. package/src/Api/Internal/GridFilterInternalApi.d.ts +0 -1
  203. package/src/Api/Internal/GridFilterInternalApi.js +1 -11
  204. package/src/Api/Internal/GridInternalApi.d.ts +24 -73
  205. package/src/Api/Internal/GridInternalApi.js +88 -382
  206. package/src/Api/Internal/LayoutInternalApi.d.ts +7 -24
  207. package/src/Api/Internal/LayoutInternalApi.js +93 -107
  208. package/src/Api/Internal/NamedQueryInternalApi.d.ts +2 -0
  209. package/src/Api/Internal/NamedQueryInternalApi.js +38 -3
  210. package/src/Api/Internal/NoteInternalApi.js +1 -2
  211. package/src/Api/Internal/PredicateInternalApi.js +40 -19
  212. package/src/Api/Internal/RowFormInternalApi.d.ts +22 -0
  213. package/src/Api/Internal/RowFormInternalApi.js +200 -0
  214. package/src/Api/Internal/ScheduleInternalApi.d.ts +1 -8
  215. package/src/Api/Internal/ScheduleInternalApi.js +1 -11
  216. package/src/Api/Internal/StyledColumnInternalApi.d.ts +1 -1
  217. package/src/Api/Internal/StyledColumnInternalApi.js +19 -22
  218. package/src/Api/Internal/SystemStatusInternalApi.d.ts +0 -5
  219. package/src/Api/Internal/SystemStatusInternalApi.js +3 -11
  220. package/src/Api/Internal/TeamSharingInternalApi.d.ts +0 -5
  221. package/src/Api/Internal/TeamSharingInternalApi.js +2 -13
  222. package/src/Api/Internal/UserInterfaceInternalApi.d.ts +2 -1
  223. package/src/Api/Internal/UserInterfaceInternalApi.js +11 -0
  224. package/src/Api/LayoutApi.d.ts +14 -23
  225. package/src/Api/OptionsApi.d.ts +31 -17
  226. package/src/Api/PredicateApi.d.ts +1 -0
  227. package/src/Api/RowFormApi.d.ts +19 -0
  228. package/src/Api/StatusBarApi.d.ts +1 -1
  229. package/src/Api/UserInterfaceApi.d.ts +9 -42
  230. package/src/EnvVars.js +1 -1
  231. package/src/PredefinedConfig/AdaptableState.d.ts +2 -4
  232. package/src/PredefinedConfig/AlertState.d.ts +6 -6
  233. package/src/PredefinedConfig/ChartingState.d.ts +1 -1
  234. package/src/PredefinedConfig/CommentState.d.ts +2 -3
  235. package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +2 -2
  236. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +37 -7
  237. package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -6
  238. package/src/PredefinedConfig/Common/AdaptableColumnContext.d.ts +11 -0
  239. package/src/PredefinedConfig/Common/AdaptableComparerFunction.d.ts +1 -2
  240. package/src/PredefinedConfig/Common/AdaptableForm.js +1 -2
  241. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  242. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +2 -0
  243. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +3 -2
  244. package/src/PredefinedConfig/Common/AdaptablePredicate.js +99 -129
  245. package/src/PredefinedConfig/Common/AdaptableSortState.d.ts +15 -0
  246. package/src/PredefinedConfig/Common/AggregationColumns.d.ts +11 -5
  247. package/src/PredefinedConfig/Common/AggregationColumns.js +7 -1
  248. package/src/PredefinedConfig/Common/BaseContext.d.ts +14 -2
  249. package/src/PredefinedConfig/Common/CellDataChangedInfo.d.ts +1 -1
  250. package/src/PredefinedConfig/Common/CellSummary.d.ts +5 -5
  251. package/src/PredefinedConfig/Common/ColumnFilter.d.ts +7 -15
  252. package/src/PredefinedConfig/Common/ColumnScope.d.ts +1 -1
  253. package/src/PredefinedConfig/Common/ColumnSetupInfo.d.ts +8 -0
  254. package/src/PredefinedConfig/Common/CustomWindowConfig.d.ts +1 -1
  255. package/src/PredefinedConfig/Common/Enums.d.ts +0 -11
  256. package/src/PredefinedConfig/Common/Enums.js +0 -13
  257. package/src/PredefinedConfig/Common/Menu.d.ts +7 -5
  258. package/src/PredefinedConfig/Common/Menu.js +26 -23
  259. package/src/PredefinedConfig/Common/ProgressIndicatorConfig.d.ts +1 -1
  260. package/src/PredefinedConfig/Common/RowDataChangedInfo.d.ts +23 -0
  261. package/src/PredefinedConfig/Common/RowScope.d.ts +2 -2
  262. package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +2 -1
  263. package/src/PredefinedConfig/Common/Types.d.ts +0 -4
  264. package/src/PredefinedConfig/Common/Types.js +2 -2
  265. package/src/PredefinedConfig/CustomSortState.d.ts +2 -2
  266. package/src/PredefinedConfig/ExportState.d.ts +70 -15
  267. package/src/PredefinedConfig/FlashingCellState.d.ts +1 -1
  268. package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
  269. package/src/PredefinedConfig/InternalState.d.ts +118 -7
  270. package/src/PredefinedConfig/LayoutState.d.ts +152 -32
  271. package/src/PredefinedConfig/PopupState.d.ts +7 -2
  272. package/src/PredefinedConfig/PredefinedConfig.d.ts +18 -18
  273. package/src/PredefinedConfig/Selection/GridCell.d.ts +16 -9
  274. package/src/PredefinedConfig/Selection/GridRow.d.ts +1 -1
  275. package/src/PredefinedConfig/Selection/SelectedRowInfo.d.ts +1 -1
  276. package/src/PredefinedConfig/ShortcutState.d.ts +1 -1
  277. package/src/PredefinedConfig/StatusBarState.d.ts +1 -1
  278. package/src/PredefinedConfig/StyledColumnState.d.ts +7 -6
  279. package/src/PredefinedConfig/TeamSharingState.d.ts +2 -2
  280. package/src/Redux/ActionsReducers/AlertRedux.js +26 -8
  281. package/src/Redux/ActionsReducers/CalculatedColumnRedux.js +11 -5
  282. package/src/Redux/ActionsReducers/ChartingRedux.js +41 -14
  283. package/src/Redux/ActionsReducers/CommentsRedux.js +49 -24
  284. package/src/Redux/ActionsReducers/CustomSortRedux.js +26 -8
  285. package/src/Redux/ActionsReducers/DashboardRedux.js +9 -9
  286. package/src/Redux/ActionsReducers/ExportRedux.d.ts +6 -16
  287. package/src/Redux/ActionsReducers/ExportRedux.js +17 -20
  288. package/src/Redux/ActionsReducers/FlashingCellRedux.js +31 -10
  289. package/src/Redux/ActionsReducers/FormatColumnRedux.js +38 -11
  290. package/src/Redux/ActionsReducers/FreeTextColumnRedux.js +12 -7
  291. package/src/Redux/ActionsReducers/InternalRedux.d.ts +349 -0
  292. package/src/Redux/ActionsReducers/InternalRedux.js +893 -0
  293. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +13 -1
  294. package/src/Redux/ActionsReducers/LayoutRedux.js +140 -65
  295. package/src/Redux/ActionsReducers/NamedQueryRedux.js +12 -6
  296. package/src/Redux/ActionsReducers/NoteRedux.js +11 -6
  297. package/src/Redux/ActionsReducers/PluginsRedux.d.ts +1 -1
  298. package/src/Redux/ActionsReducers/PluginsRedux.js +1 -1
  299. package/src/Redux/ActionsReducers/PlusMinusRedux.js +36 -13
  300. package/src/Redux/ActionsReducers/PopupRedux.d.ts +10 -1
  301. package/src/Redux/ActionsReducers/PopupRedux.js +63 -6
  302. package/src/Redux/ActionsReducers/QuickSearchRedux.js +2 -1
  303. package/src/Redux/ActionsReducers/ScheduleRedux.js +104 -32
  304. package/src/Redux/ActionsReducers/ShortcutRedux.js +26 -8
  305. package/src/Redux/ActionsReducers/SmartEditRedux.d.ts +1 -1
  306. package/src/Redux/ActionsReducers/SmartEditRedux.js +1 -1
  307. package/src/Redux/ActionsReducers/StatusBarRedux.js +4 -1
  308. package/src/Redux/ActionsReducers/StyledColumnRedux.js +26 -8
  309. package/src/Redux/ActionsReducers/TeamSharingRedux.js +1 -1
  310. package/src/Redux/ActionsReducers/ThemeRedux.js +2 -1
  311. package/src/Redux/ActionsReducers/ToolPanelRedux.js +9 -8
  312. package/src/Redux/ActionsReducers/utils.js +13 -4
  313. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.d.ts +1 -1
  314. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +8 -27
  315. package/src/Redux/Store/AdaptableReduxMerger.js +4 -5
  316. package/src/Redux/Store/AdaptableStore.d.ts +1 -1
  317. package/src/Redux/Store/AdaptableStore.js +408 -540
  318. package/src/Strategy/AlertModule.d.ts +10 -5
  319. package/src/Strategy/AlertModule.js +55 -27
  320. package/src/Strategy/BulkUpdateModule.d.ts +1 -1
  321. package/src/Strategy/BulkUpdateModule.js +6 -6
  322. package/src/Strategy/CalculatedColumnModule.d.ts +12 -11
  323. package/src/Strategy/CalculatedColumnModule.js +41 -16
  324. package/src/Strategy/CellSummaryModule.d.ts +18 -11
  325. package/src/Strategy/CellSummaryModule.js +83 -45
  326. package/src/Strategy/ChartingModule.d.ts +2 -1
  327. package/src/Strategy/ChartingModule.js +17 -3
  328. package/src/Strategy/ColumnFilterModule.d.ts +1 -2
  329. package/src/Strategy/ColumnFilterModule.js +27 -29
  330. package/src/Strategy/ColumnInfoModule.d.ts +2 -2
  331. package/src/Strategy/ColumnInfoModule.js +1 -1
  332. package/src/Strategy/CommentModule.d.ts +1 -2
  333. package/src/Strategy/CommentModule.js +18 -14
  334. package/src/Strategy/CustomSortModule.d.ts +2 -13
  335. package/src/Strategy/CustomSortModule.js +1 -1
  336. package/src/Strategy/DashboardModule.js +1 -1
  337. package/src/Strategy/DataChangeHistoryModule.d.ts +8 -3
  338. package/src/Strategy/DataChangeHistoryModule.js +22 -10
  339. package/src/Strategy/DataSetModule.js +4 -7
  340. package/src/Strategy/ExportModule.d.ts +5 -17
  341. package/src/Strategy/ExportModule.js +70 -282
  342. package/src/Strategy/Fdc3Module.d.ts +1 -1
  343. package/src/Strategy/Fdc3Module.js +10 -12
  344. package/src/Strategy/FlashingCellModule.d.ts +12 -9
  345. package/src/Strategy/FlashingCellModule.js +139 -108
  346. package/src/Strategy/FormatColumnModule.d.ts +1 -1
  347. package/src/Strategy/FormatColumnModule.js +5 -5
  348. package/src/Strategy/FreeTextColumnModule.d.ts +10 -9
  349. package/src/Strategy/FreeTextColumnModule.js +39 -17
  350. package/src/Strategy/GridFilterModule.d.ts +3 -1
  351. package/src/Strategy/GridFilterModule.js +13 -1
  352. package/src/Strategy/GridInfoModule.d.ts +2 -2
  353. package/src/Strategy/Interface/ICellDataChangeListenerModule.d.ts +6 -0
  354. package/src/Strategy/Interface/ICellSummaryModule.d.ts +2 -2
  355. package/src/Strategy/Interface/{IShortcutModule.d.ts → IKeyDownListenerModule.d.ts} +1 -1
  356. package/src/Strategy/Interface/IModule.d.ts +4 -0
  357. package/src/Strategy/Interface/IPlusMinusModule.d.ts +2 -3
  358. package/src/Strategy/LayoutModule.d.ts +6 -25
  359. package/src/Strategy/LayoutModule.js +109 -64
  360. package/src/Strategy/NamedQueryModule.d.ts +2 -15
  361. package/src/Strategy/NamedQueryModule.js +2 -2
  362. package/src/Strategy/NoteModule.d.ts +3 -1
  363. package/src/Strategy/NoteModule.js +12 -7
  364. package/src/Strategy/PlusMinusModule.d.ts +3 -2
  365. package/src/Strategy/PlusMinusModule.js +32 -24
  366. package/src/Strategy/ScheduleModule.js +2 -2
  367. package/src/Strategy/SettingsPanelModule.d.ts +2 -2
  368. package/src/Strategy/ShortcutModule.d.ts +3 -2
  369. package/src/Strategy/ShortcutModule.js +10 -2
  370. package/src/Strategy/SmartEditModule.d.ts +1 -1
  371. package/src/Strategy/SmartEditModule.js +10 -6
  372. package/src/Strategy/StatusBarModule.d.ts +1 -1
  373. package/src/Strategy/StyledColumnModule.d.ts +1 -1
  374. package/src/Strategy/StyledColumnModule.js +47 -20
  375. package/src/Strategy/SystemStatusModule.d.ts +2 -2
  376. package/src/Strategy/TeamSharingModule.js +9 -9
  377. package/src/Strategy/Utilities/Alert/getAlertPreviewViewItems.js +1 -2
  378. package/src/Strategy/Utilities/CustomSort/getCustomSortSortOrderViewItems.d.ts +1 -1
  379. package/src/Strategy/Utilities/Export/getExportRowsViewItems.d.ts +2 -2
  380. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +4 -5
  381. package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.d.ts +2 -2
  382. package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +11 -18
  383. package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.js +1 -2
  384. package/src/Strategy/Utilities/Shortcut/getShortcutSettingsViewItems.js +2 -3
  385. package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +15 -15
  386. package/src/Utilities/Constants/GeneralConstants.d.ts +31 -85
  387. package/src/Utilities/Constants/GeneralConstants.js +53 -111
  388. package/src/Utilities/Constants/ModuleConstants.d.ts +28 -30
  389. package/src/Utilities/Constants/ModuleConstants.js +28 -31
  390. package/src/Utilities/Constants/ObjectDefaultConstants.d.ts +7 -0
  391. package/src/Utilities/Constants/ObjectDefaultConstants.js +6 -0
  392. package/src/Utilities/Constants/ReduxConstants.d.ts +7 -0
  393. package/src/Utilities/Constants/ReduxConstants.js +25 -0
  394. package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +1 -1
  395. package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
  396. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +2 -3
  397. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -2
  398. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +365 -71
  399. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +2 -4
  400. package/src/Utilities/ExpressionFunctions/deepMap.d.ts +1 -0
  401. package/src/Utilities/ExpressionFunctions/deepMap.js +7 -8
  402. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +8 -8
  403. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +12 -13
  404. package/src/Utilities/ExpressionFunctions/groupingMap.js +4 -5
  405. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +13 -17
  406. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +2 -3
  407. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
  408. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +96 -10
  409. package/src/Utilities/Extensions/ArrayExtensions.d.ts +5 -4
  410. package/src/Utilities/Extensions/ArrayExtensions.js +3 -3
  411. package/src/Utilities/Extensions/NumberExtensions.d.ts +6 -2
  412. package/src/Utilities/Extensions/NumberExtensions.js +57 -2
  413. package/src/Utilities/Extensions/ObjectExtensions.js +8 -3
  414. package/src/Utilities/Extensions/TypeExtensions.d.ts +5 -0
  415. package/src/Utilities/Helpers/AdaptableHelper.d.ts +4 -4
  416. package/src/Utilities/Helpers/AdaptableHelper.js +16 -5
  417. package/src/Utilities/Helpers/FormatHelper.d.ts +1 -1
  418. package/src/Utilities/Helpers/FormatHelper.js +5 -6
  419. package/src/Utilities/Helpers/Helper.d.ts +1 -1
  420. package/src/Utilities/Helpers/Helper.js +19 -33
  421. package/src/Utilities/Helpers/StyleHelper.js +7 -4
  422. package/src/Utilities/Interface/Preview.d.ts +1 -1
  423. package/src/Utilities/MenuItem.d.ts +3 -3
  424. package/src/Utilities/MenuItem.js +3 -3
  425. package/src/Utilities/ObjectFactory.d.ts +13 -10
  426. package/src/Utilities/ObjectFactory.js +63 -32
  427. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +1 -1
  428. package/src/Utilities/Services/AggregatedScalarLiveValue.js +4 -7
  429. package/src/Utilities/Services/AlertService.js +4 -4
  430. package/src/Utilities/Services/{CellPopupService.d.ts → AnnotationsService.d.ts} +7 -3
  431. package/src/Utilities/Services/{CellPopupService.js → AnnotationsService.js} +45 -31
  432. package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +5 -1
  433. package/src/Utilities/Services/CalculatedColumnExpressionService.js +36 -43
  434. package/src/Utilities/Services/ChartingService.d.ts +1 -1
  435. package/src/Utilities/Services/ChartingService.js +22 -12
  436. package/src/Utilities/Services/DataService.d.ts +7 -7
  437. package/src/Utilities/Services/DataService.js +23 -18
  438. package/src/Utilities/Services/Fdc3Service.js +66 -29
  439. package/src/Utilities/Services/FlashingCellService.d.ts +1 -1
  440. package/src/Utilities/Services/FlashingCellService.js +2 -2
  441. package/src/Utilities/Services/Interface/IAlertService.d.ts +7 -7
  442. package/src/Utilities/Services/Interface/IAlertService.js +2 -2
  443. package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +5 -1
  444. package/src/Utilities/Services/Interface/IChartingService.d.ts +1 -1
  445. package/src/Utilities/Services/Interface/IDataService.d.ts +6 -5
  446. package/src/Utilities/Services/Interface/IModuleService.d.ts +2 -1
  447. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +4 -4
  448. package/src/Utilities/Services/LicenseService/index.js +1 -1
  449. package/src/Utilities/Services/MetamodelService.js +15 -15
  450. package/src/Utilities/Services/ModuleService.d.ts +4 -1
  451. package/src/Utilities/Services/ModuleService.js +34 -23
  452. package/src/Utilities/Services/QueryLanguageService.d.ts +4 -4
  453. package/src/Utilities/Services/QueryLanguageService.js +79 -59
  454. package/src/Utilities/Services/{RowEditService.d.ts → RowFormService.d.ts} +2 -2
  455. package/src/Utilities/Services/RowFormService.js +45 -0
  456. package/src/Utilities/Services/RowSummaryService.d.ts +3 -3
  457. package/src/Utilities/Services/RowSummaryService.js +22 -21
  458. package/src/Utilities/Services/TeamSharingService.js +29 -21
  459. package/src/Utilities/Services/ThemeService.js +1 -2
  460. package/src/Utilities/Services/ValidationService.js +30 -14
  461. package/src/Utilities/adaptableQlUtils.d.ts +1 -0
  462. package/src/Utilities/adaptableQlUtils.js +31 -4
  463. package/src/{agGrid → Utilities}/buildSortedColumnStateForLayout.d.ts +2 -2
  464. package/src/{agGrid → Utilities}/buildSortedColumnStateForLayout.js +39 -28
  465. package/src/{agGrid → Utilities}/createAgStatusPanelComponent.d.ts +3 -3
  466. package/src/{agGrid → Utilities}/createAgStatusPanelComponent.js +1 -2
  467. package/src/Utilities/getExpressionViewItems.d.ts +3 -0
  468. package/src/{Strategy/Utilities → Utilities}/getExpressionViewItems.js +2 -2
  469. package/src/Utilities/getObjectTagsViewItems.d.ts +3 -0
  470. package/src/{Strategy/Utilities → Utilities}/getObjectTagsViewItems.js +9 -8
  471. package/src/{Strategy/Utilities → Utilities}/getRuleViewItems.d.ts +1 -1
  472. package/src/Utilities/getRuleViewItems.js +10 -0
  473. package/src/Utilities/getScopeViewItems.d.ts +3 -0
  474. package/src/Utilities/isPivotLayout.d.ts +2 -0
  475. package/src/Utilities/isPivotLayout.js +2 -0
  476. package/src/Utilities/license/decode.js +1 -1
  477. package/src/Utilities/logDeprecation.d.ts +3 -3
  478. package/src/Utilities/logDeprecation.js +2 -2
  479. package/src/Utilities/runIfNotResolvedIn.js +1 -1
  480. package/src/{Strategy/Utilities → Utilities}/updateSingleToMultiplePredicates.js +1 -2
  481. package/src/{agGrid → Utilities}/weightedAverage.d.ts +1 -1
  482. package/src/{agGrid → Utilities}/weightedAverage.js +2 -3
  483. package/src/View/AdaptablePopover/index.d.ts +1 -1
  484. package/src/View/AdaptablePopover/index.js +3 -4
  485. package/src/View/AdaptableView.js +6 -9
  486. package/src/View/AdaptableViewFactory.js +2 -2
  487. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig.d.ts +1 -1
  488. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +16 -13
  489. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.d.ts +2 -2
  490. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +25 -18
  491. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.js +1 -1
  492. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +25 -11
  493. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +2 -3
  494. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +23 -13
  495. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +1 -1
  496. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.d.ts +3 -3
  497. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +12 -7
  498. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.d.ts +1 -1
  499. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +20 -10
  500. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.d.ts +1 -1
  501. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +22 -8
  502. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +1 -1
  503. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +1 -5
  504. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.js +5 -2
  505. package/src/View/AdaptableWizardView/Wizard.d.ts +2 -2
  506. package/src/View/AdaptableWizardView/Wizard.js +24 -7
  507. package/src/View/AdaptableWizardView/helper.d.ts +1 -1
  508. package/src/View/AdaptableWizardView/helper.js +20 -11
  509. package/src/View/AdaptableWizardView/index.js +1 -1
  510. package/src/View/Alert/ActiveAlertsPanel.js +1 -1
  511. package/src/View/Alert/ActiveAlertsPanelItemLabel.js +1 -1
  512. package/src/View/Alert/AlertEmptyView.js +1 -1
  513. package/src/View/Alert/AlertStatusSubPanel.d.ts +2 -2
  514. package/src/View/Alert/AlertStatusSubPanel.js +5 -3
  515. package/src/View/Alert/AlertViewPanel.d.ts +7 -5
  516. package/src/View/Alert/AlertViewPanel.js +4 -4
  517. package/src/View/Alert/AlertsPanel.js +1 -2
  518. package/src/View/Alert/Utilities/getAlertType.js +7 -8
  519. package/src/View/Alert/Utilities/getAvailablePredicates.js +1 -8
  520. package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +2 -1
  521. package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +5 -6
  522. package/src/View/Alert/Utilities/mapAlertDefinition.js +9 -10
  523. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.d.ts +4 -4
  524. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +7 -1
  525. package/src/View/Alert/Wizard/AlertButtonsEditor.d.ts +2 -2
  526. package/src/View/Alert/Wizard/AlertButtonsEditor.js +77 -52
  527. package/src/View/Alert/Wizard/AlertMessageWizardSection.d.ts +3 -3
  528. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +14 -5
  529. package/src/View/Alert/Wizard/AlertNotificationWizardSection.d.ts +2 -2
  530. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +38 -20
  531. package/src/View/Alert/Wizard/AlertRulesWizardSection.d.ts +4 -4
  532. package/src/View/Alert/Wizard/AlertRulesWizardSection.js +20 -11
  533. package/src/View/Alert/Wizard/AlertScopeWizardSection.d.ts +2 -2
  534. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +1 -1
  535. package/src/View/Alert/Wizard/AlertTypeWizardSection.d.ts +3 -3
  536. package/src/View/Alert/Wizard/AlertWizard.d.ts +2 -2
  537. package/src/View/Alert/Wizard/AlertWizard.js +8 -10
  538. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.d.ts +2 -2
  539. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
  540. package/src/View/Alert/Wizard/isValidAlertRules.js +1 -2
  541. package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +7 -5
  542. package/src/View/BulkUpdate/BulkUpdatePopup.js +12 -13
  543. package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +7 -6
  544. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +11 -14
  545. package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +6 -3
  546. package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingsTags.js +2 -2
  547. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.d.ts +3 -3
  548. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +17 -7
  549. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.d.ts +3 -3
  550. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +16 -5
  551. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.d.ts +3 -3
  552. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +28 -14
  553. package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.d.ts +2 -2
  554. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +2 -2
  555. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +13 -10
  556. package/src/View/CalculatedColumn/utils.js +1 -2
  557. package/src/View/CellSummary/CellSummaryDetails.d.ts +3 -3
  558. package/src/View/CellSummary/CellSummaryDetails.js +5 -5
  559. package/src/View/CellSummary/CellSummaryPopover.d.ts +2 -2
  560. package/src/View/CellSummary/CellSummaryPopup.d.ts +8 -6
  561. package/src/View/CellSummary/CellSummaryPopup.js +5 -6
  562. package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -1
  563. package/src/View/CellSummary/CellSummaryStatusPanel.d.ts +2 -2
  564. package/src/View/CellSummary/CellSummaryStatusPanel.js +4 -5
  565. package/src/View/CellSummary/CellSummaryViewPanel.d.ts +9 -8
  566. package/src/View/CellSummary/CellSummaryViewPanel.js +9 -13
  567. package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +1 -2
  568. package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +6 -3
  569. package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +33 -5
  570. package/src/View/Charting/ChartingWizard/ChartingWizard.js +3 -4
  571. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +2 -4
  572. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +4 -1
  573. package/src/View/Charting/ShowChartButton.js +18 -17
  574. package/src/View/Charting/useAgChartState.js +6 -7
  575. package/src/View/Charting/useChartingElements.d.ts +6 -6
  576. package/src/View/Charting/useChartingElements.js +4 -5
  577. package/src/View/ColumnInfo/ColumnInfo.js +144 -98
  578. package/src/View/ColumnInfo/ColumnInfoPopup.js +1 -2
  579. package/src/View/Comments/CommentsEditor.js +23 -23
  580. package/src/View/Comments/CommentsPopup.js +3 -4
  581. package/src/View/Components/AdaptableButton/index.js +1 -1
  582. package/src/View/Components/AdaptableDateInput/index.d.ts +4 -2
  583. package/src/View/Components/AdaptableDateInput/index.js +24 -18
  584. package/src/View/Components/AdaptableIconComponent/index.js +1 -1
  585. package/src/View/Components/AdaptableIconSelector/index.js +3 -4
  586. package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.d.ts +3 -2
  587. package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.js +4 -7
  588. package/src/View/Components/AdaptableInput/index.d.ts +5 -3
  589. package/src/View/Components/AdaptableInput/index.js +3 -4
  590. package/src/View/Components/AdaptableObjectCollection/index.js +1 -1
  591. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +10 -12
  592. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +18 -28
  593. package/src/View/Components/Badge/index.js +1 -1
  594. package/src/View/Components/Buttons/ButtonApply.d.ts +1 -1
  595. package/src/View/Components/Buttons/ButtonApply.js +1 -1
  596. package/src/View/Components/Buttons/ButtonBase/index.d.ts +1 -1
  597. package/src/View/Components/Buttons/ButtonBase/index.js +1 -1
  598. package/src/View/Components/Buttons/ButtonClear.d.ts +1 -1
  599. package/src/View/Components/Buttons/ButtonClear.js +1 -1
  600. package/src/View/Components/Buttons/ButtonClone.d.ts +2 -2
  601. package/src/View/Components/Buttons/ButtonClone.js +1 -1
  602. package/src/View/Components/Buttons/ButtonClose.d.ts +1 -1
  603. package/src/View/Components/Buttons/ButtonClose.js +1 -1
  604. package/src/View/Components/Buttons/ButtonConfigure.d.ts +1 -1
  605. package/src/View/Components/Buttons/ButtonConfigure.js +1 -1
  606. package/src/View/Components/Buttons/ButtonDelete.d.ts +3 -8
  607. package/src/View/Components/Buttons/ButtonDelete.js +17 -29
  608. package/src/View/Components/Buttons/ButtonEdit.js +1 -2
  609. package/src/View/Components/Buttons/ButtonExpand.d.ts +1 -1
  610. package/src/View/Components/Buttons/ButtonExpand.js +1 -1
  611. package/src/View/Components/Buttons/ButtonExport.d.ts +1 -1
  612. package/src/View/Components/Buttons/ButtonExport.js +1 -1
  613. package/src/View/Components/Buttons/ButtonFunction.d.ts +1 -1
  614. package/src/View/Components/Buttons/ButtonFunction.js +1 -1
  615. package/src/View/Components/Buttons/ButtonGeneral.d.ts +1 -1
  616. package/src/View/Components/Buttons/ButtonGeneral.js +1 -1
  617. package/src/View/Components/Buttons/ButtonInfo.js +1 -1
  618. package/src/View/Components/Buttons/ButtonInvalid.d.ts +1 -1
  619. package/src/View/Components/Buttons/ButtonInvalid.js +1 -1
  620. package/src/View/Components/Buttons/ButtonLogin.d.ts +1 -1
  621. package/src/View/Components/Buttons/ButtonLogin.js +1 -1
  622. package/src/View/Components/Buttons/ButtonLogout.d.ts +1 -1
  623. package/src/View/Components/Buttons/ButtonLogout.js +1 -1
  624. package/src/View/Components/Buttons/ButtonMaximise.d.ts +1 -1
  625. package/src/View/Components/Buttons/ButtonMaximise.js +1 -1
  626. package/src/View/Components/Buttons/ButtonMinimise.d.ts +1 -1
  627. package/src/View/Components/Buttons/ButtonMinimise.js +1 -1
  628. package/src/View/Components/Buttons/ButtonNew.d.ts +2 -2
  629. package/src/View/Components/Buttons/ButtonNew.js +1 -1
  630. package/src/View/Components/Buttons/ButtonNewPage.d.ts +1 -1
  631. package/src/View/Components/Buttons/ButtonNewPage.js +2 -2
  632. package/src/View/Components/Buttons/ButtonOpen.d.ts +1 -1
  633. package/src/View/Components/Buttons/ButtonOpen.js +1 -1
  634. package/src/View/Components/Buttons/ButtonPause.d.ts +1 -3
  635. package/src/View/Components/Buttons/ButtonPause.js +13 -15
  636. package/src/View/Components/Buttons/ButtonPlay.d.ts +1 -3
  637. package/src/View/Components/Buttons/ButtonPlay.js +3 -5
  638. package/src/View/Components/Buttons/ButtonPreviewDelete.d.ts +2 -2
  639. package/src/View/Components/Buttons/ButtonPreviewDelete.js +1 -1
  640. package/src/View/Components/Buttons/ButtonSave.d.ts +1 -1
  641. package/src/View/Components/Buttons/ButtonSave.js +1 -1
  642. package/src/View/Components/Buttons/ButtonSchedule.d.ts +1 -3
  643. package/src/View/Components/Buttons/ButtonSchedule.js +3 -5
  644. package/src/View/Components/Buttons/ButtonShare.d.ts +1 -1
  645. package/src/View/Components/Buttons/ButtonShare.js +2 -4
  646. package/src/View/Components/Buttons/ButtonShow.d.ts +1 -1
  647. package/src/View/Components/Buttons/ButtonShow.js +1 -1
  648. package/src/View/Components/Buttons/ButtonShowChart.d.ts +1 -1
  649. package/src/View/Components/Buttons/ButtonShowChart.js +1 -1
  650. package/src/View/Components/Buttons/ButtonStop.d.ts +1 -1
  651. package/src/View/Components/Buttons/ButtonStop.js +1 -1
  652. package/src/View/Components/Buttons/ButtonUndo.d.ts +1 -1
  653. package/src/View/Components/Buttons/ButtonUndo.js +1 -1
  654. package/src/View/Components/Buttons/ButtonUnsuspend.d.ts +1 -1
  655. package/src/View/Components/Buttons/ButtonUnsuspend.js +1 -1
  656. package/src/View/Components/Buttons/EntityListActionButtons.d.ts +1 -1
  657. package/src/View/Components/CellPopup/index.js +1 -2
  658. package/src/View/Components/ColumnFilter/AdaptableColumnFilter.d.ts +12 -0
  659. package/src/View/Components/ColumnFilter/AdaptableColumnFilter.js +11 -0
  660. package/src/View/Components/ColumnFilter/AdaptableFloatingFilter.d.ts +9 -0
  661. package/src/View/Components/ColumnFilter/AdaptableFloatingFilter.js +31 -0
  662. package/src/View/Components/ColumnFilter/ColumnFilter.d.ts +13 -0
  663. package/src/View/Components/ColumnFilter/ColumnFilter.js +144 -0
  664. package/src/View/Components/ColumnFilter/ColumnFilterWindow.d.ts +3 -0
  665. package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +32 -0
  666. package/src/View/Components/ColumnFilter/FloatingFilter.d.ts +12 -0
  667. package/src/View/Components/ColumnFilter/FloatingFilter.js +84 -0
  668. package/src/View/Components/ColumnFilter/LayoutColumnFilter.d.ts +6 -0
  669. package/src/View/Components/ColumnFilter/LayoutColumnFilter.js +25 -0
  670. package/src/View/Components/ColumnFilter/components/ColumnFilterInput.d.ts +27 -0
  671. package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +117 -0
  672. package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.d.ts +13 -0
  673. package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +56 -0
  674. package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.d.ts +12 -0
  675. package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.js +17 -0
  676. package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.d.ts +13 -0
  677. package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +58 -0
  678. package/src/View/Components/ColumnFilter/components/FloatingFilterValues.d.ts +44 -0
  679. package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +108 -0
  680. package/src/View/Components/ColumnFilter/hooks.d.ts +2 -0
  681. package/src/View/Components/ColumnFilter/hooks.js +10 -0
  682. package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.d.ts +12 -0
  683. package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +62 -0
  684. package/src/View/Components/ColumnFilter/utils.d.ts +8 -0
  685. package/src/View/Components/ColumnFilter/utils.js +118 -0
  686. package/src/View/Components/ColumnSelector/index.d.ts +2 -2
  687. package/src/View/Components/ColumnSelector/index.js +1 -3
  688. package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicateEditor.js +18 -16
  689. package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.js +23 -17
  690. package/src/View/Components/EntityRulesEditor/Utilities.js +11 -12
  691. package/src/View/Components/EntityRulesEditor/index.d.ts +2 -2
  692. package/src/View/Components/EntityRulesEditor/index.js +47 -28
  693. package/src/View/Components/ExpressionWizard.d.ts +1 -1
  694. package/src/View/Components/ExpressionWizard.js +2 -3
  695. package/src/View/Components/ExternalRenderer.js +7 -15
  696. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +8 -15
  697. package/src/View/Components/FilterForm/ListBoxFilterForm.js +27 -73
  698. package/src/View/Components/FilterForm/ListBoxMenu.d.ts +1 -1
  699. package/src/View/Components/FilterForm/Waiting.js +2 -3
  700. package/src/View/Components/Forms/AdaptableFormControlTextClear.d.ts +2 -1
  701. package/src/View/Components/Forms/AdaptableFormControlTextClear.js +6 -1
  702. package/src/View/Components/ListBox/DualListBoxEditor.d.ts +1 -1
  703. package/src/View/Components/ListBox/DualListBoxEditor.js +4 -4
  704. package/src/View/Components/ListBox/ListBoxFilterSortComponent.d.ts +1 -1
  705. package/src/View/Components/ModuleValueSelector/index.d.ts +2 -2
  706. package/src/View/Components/ModuleValueSelector/index.js +4 -5
  707. package/src/View/Components/NewScopeComponent.d.ts +2 -2
  708. package/src/View/Components/NewScopeComponent.js +22 -27
  709. package/src/View/Components/Panels/PanelDashboard/index.d.ts +3 -3
  710. package/src/View/Components/Panels/PanelDashboard/index.js +4 -4
  711. package/src/View/Components/Panels/PanelFooter.js +2 -3
  712. package/src/View/Components/Panels/PanelToolPanel/index.d.ts +1 -1
  713. package/src/View/Components/Panels/PanelToolPanel/index.js +25 -3
  714. package/src/View/Components/Panels/PanelWithButton.d.ts +1 -3
  715. package/src/View/Components/Panels/PanelWithButton.js +15 -21
  716. package/src/View/Components/Panels/PanelWithImage.js +6 -3
  717. package/src/View/Components/Panels/PanelWithRow.d.ts +1 -1
  718. package/src/View/Components/Panels/PanelWithTwoButtons.d.ts +1 -1
  719. package/src/View/Components/Panels/PanelWithTwoButtons.js +1 -1
  720. package/src/View/Components/Panels/ToolPanelSettingsPanel.d.ts +1 -1
  721. package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +2 -2
  722. package/src/View/Components/Popups/AdaptableLoadingScreen.js +2 -2
  723. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +7 -8
  724. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +2 -3
  725. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +13 -12
  726. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +36 -34
  727. package/src/View/Components/Popups/AdaptablePopup/Navigation.js +7 -7
  728. package/src/View/Components/Popups/AdaptablePopup/TopBar.js +1 -2
  729. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +9 -11
  730. package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +2 -2
  731. package/src/View/Components/Popups/AdaptablePopupAlert.js +7 -5
  732. package/src/View/Components/Popups/AdaptablePopupConfirmation.js +3 -3
  733. package/src/View/Components/Popups/AdaptablePopupPrompt.js +1 -2
  734. package/src/View/Components/Popups/AdaptablePopupTeamSharing.d.ts +2 -2
  735. package/src/View/Components/Popups/AdaptablePopupTeamSharing.js +3 -3
  736. package/src/View/Components/Popups/FormPopups/FormPopups.js +6 -3
  737. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +13 -14
  738. package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +1 -1
  739. package/src/View/Components/Popups/WindowPopups/WindowPopups.js +22 -11
  740. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -1
  741. package/src/View/Components/Popups/WindowPopups/windowFactory.js +3 -3
  742. package/src/View/Components/PredicateEditor/PredicateEditor.js +46 -29
  743. package/src/View/Components/PreviewResultsPanel.js +23 -32
  744. package/src/View/Components/RangesComponent.d.ts +1 -1
  745. package/src/View/Components/RangesComponent.js +21 -10
  746. package/src/View/Components/ReorderDraggable/index.d.ts +12 -0
  747. package/src/View/Components/ReorderDraggable/index.js +40 -0
  748. package/src/View/Components/Selectors/{ColumnValueSelector.d.ts → BulkUpdateValueSelector.d.ts} +2 -2
  749. package/src/View/Components/Selectors/{ColumnValueSelector.js → BulkUpdateValueSelector.js} +30 -12
  750. package/src/View/Components/Selectors/ColumnSelector.d.ts +3 -2
  751. package/src/View/Components/Selectors/ColumnSelector.js +9 -7
  752. package/src/View/Components/Selectors/ColumnSelectorOld.d.ts +1 -1
  753. package/src/View/Components/Selectors/ColumnSelectorOld.js +1 -2
  754. package/src/View/Components/Selectors/FieldSelector.js +5 -9
  755. package/src/View/Components/Selectors/PermittedValuesSelector.d.ts +13 -2
  756. package/src/View/Components/Selectors/PermittedValuesSelector.js +37 -8
  757. package/src/View/Components/StyleComponent.d.ts +1 -1
  758. package/src/View/Components/StyleComponent.js +3 -4
  759. package/src/View/Components/TagValueSelector/index.d.ts +3 -3
  760. package/src/View/Components/TagValueSelector/index.js +1 -2
  761. package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +11 -8
  762. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +15 -27
  763. package/src/View/Components/ToolPanel/CustomToolPanelContent.d.ts +2 -2
  764. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +19 -8
  765. package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +7 -4
  766. package/src/View/Components/ToolPanel/ToolPanelPopup.js +7 -9
  767. package/src/View/Components/ToolPanel/ToolPanelWrapper.d.ts +2 -2
  768. package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -2
  769. package/src/View/Components/ValueSelector/index.d.ts +20 -2
  770. package/src/View/Components/ValueSelector/index.js +52 -39
  771. package/src/View/Components/WizardSummaryPage.d.ts +2 -2
  772. package/src/View/Components/WizardSummaryPage.js +4 -4
  773. package/src/View/CustomSort/CustomSortSummary.d.ts +3 -1
  774. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.d.ts +3 -3
  775. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +6 -2
  776. package/src/View/CustomSort/Wizard/CustomSortSummaryWizard.js +1 -1
  777. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.d.ts +3 -3
  778. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +21 -5
  779. package/src/View/CustomSort/Wizard/CustomSortWizard.d.ts +2 -2
  780. package/src/View/CustomSort/Wizard/CustomSortWizard.js +5 -7
  781. package/src/View/Dashboard/CustomDashboardButton.d.ts +2 -2
  782. package/src/View/Dashboard/CustomDashboardButton.js +6 -4
  783. package/src/View/Dashboard/CustomToolbar.d.ts +3 -3
  784. package/src/View/Dashboard/CustomToolbar.js +13 -20
  785. package/src/View/Dashboard/Dashboard.d.ts +8 -6
  786. package/src/View/Dashboard/Dashboard.js +13 -10
  787. package/src/View/Dashboard/DashboardPopup.d.ts +6 -4
  788. package/src/View/Dashboard/DashboardPopup.js +5 -5
  789. package/src/View/Dashboard/DashboardToolbarFactory.js +1 -1
  790. package/src/View/Dashboard/DashboardViewPanel.d.ts +4 -2
  791. package/src/View/Dashboard/ModuleToolbarWrapper.d.ts +1 -1
  792. package/src/View/Dashboard/ModuleToolbarWrapper.js +1 -1
  793. package/src/View/Dashboard/PinnedDashboard.js +1 -2
  794. package/src/View/Dashboard/PinnedToolbarsSelector.js +1 -1
  795. package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +2 -2
  796. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +31 -38
  797. package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +10 -8
  798. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +9 -9
  799. package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +10 -11
  800. package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +1 -1
  801. package/src/View/DataChangeHistory/buildActionColumnButton.js +9 -4
  802. package/src/View/DataImport/DataImportPopup.js +4 -6
  803. package/src/View/DataImport/DataImportWizard/DataImportWizard.d.ts +2 -2
  804. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +26 -23
  805. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +27 -14
  806. package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +14 -13
  807. package/src/View/DataImport/systemFileHandlers.js +1 -2
  808. package/src/View/DataSet/DataSetSelector.js +2 -2
  809. package/src/View/DataSet/DataSetViewPanel.d.ts +9 -4
  810. package/src/View/DataSet/DataSetViewPanel.js +4 -5
  811. package/src/View/Export/ExportDestinationPicker.d.ts +9 -0
  812. package/src/View/Export/ExportDestinationPicker.js +22 -0
  813. package/src/View/Export/ExportStatusBar.d.ts +2 -0
  814. package/src/View/Export/ExportStatusBar.js +16 -0
  815. package/src/View/Export/ExportViewPanel.d.ts +2 -26
  816. package/src/View/Export/ExportViewPanel.js +39 -127
  817. package/src/View/Export/ReportFormatSelector.d.ts +10 -0
  818. package/src/View/Export/ReportFormatSelector.js +22 -0
  819. package/src/View/Export/{ReportExportDropdown.d.ts → ReportListItem.d.ts} +1 -1
  820. package/src/View/Export/ReportListItem.js +13 -0
  821. package/src/View/Export/ReportNameSelector.d.ts +10 -0
  822. package/src/View/Export/ReportNameSelector.js +20 -0
  823. package/src/View/Export/Wizard/NewReportWizard.d.ts +2 -2
  824. package/src/View/Export/Wizard/NewReportWizard.js +2 -3
  825. package/src/View/Export/Wizard/ReportColumnTypeWizard.d.ts +1 -1
  826. package/src/View/Export/Wizard/ReportColumnsWizardSection.d.ts +3 -3
  827. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +5 -2
  828. package/src/View/Export/Wizard/ReportNameWizardSection.d.ts +3 -3
  829. package/src/View/Export/Wizard/ReportNameWizardSection.js +5 -2
  830. package/src/View/Export/Wizard/ReportRowTypeWizard.d.ts +1 -1
  831. package/src/View/Export/Wizard/ReportRowsWizardSection.d.ts +3 -3
  832. package/src/View/Export/Wizard/ReportRowsWizardSection.js +11 -7
  833. package/src/View/Filter/ActiveFiltersPanel.js +1 -1
  834. package/src/View/Filter/FilterSummary.d.ts +4 -1
  835. package/src/View/Filter/FilterSummary.js +3 -3
  836. package/src/View/Filter/FilterViewPanel.d.ts +9 -5
  837. package/src/View/Filter/FilterViewPanel.js +15 -21
  838. package/src/View/FlashingCell/FlashingCellStyle.js +2 -3
  839. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.d.ts +3 -3
  840. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +1 -2
  841. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.d.ts +2 -2
  842. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +1 -1
  843. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.d.ts +3 -3
  844. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +15 -15
  845. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.d.ts +2 -2
  846. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +6 -8
  847. package/src/View/FlashingCell/Wizard/FlashingCellWizard.d.ts +2 -2
  848. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +3 -4
  849. package/src/View/FlashingCell/Wizard/isValidFlashingCellRules.js +1 -2
  850. package/src/View/FormatColumn/FormatColumnSummary.d.ts +3 -1
  851. package/src/View/FormatColumn/FormatColumnSummary.js +1 -2
  852. package/src/View/FormatColumn/MoveFormatColumn.js +1 -1
  853. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +4 -4
  854. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +37 -45
  855. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +2 -2
  856. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.d.ts +3 -3
  857. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +2 -3
  858. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.d.ts +3 -3
  859. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +29 -13
  860. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +4 -4
  861. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +8 -5
  862. package/src/View/FormatColumn/Wizard/FormatColumnWizard.d.ts +2 -2
  863. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +10 -13
  864. package/src/View/FreeTextColumn/FreeTextColumnSummary.d.ts +3 -1
  865. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +3 -12
  866. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +48 -24
  867. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.d.ts +2 -2
  868. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +2 -4
  869. package/src/View/GridFilter/GridFilterExpressionEditor.d.ts +2 -2
  870. package/src/View/GridFilter/GridFilterExpressionEditor.js +3 -4
  871. package/src/View/GridFilter/GridFilterPopup.d.ts +2 -2
  872. package/src/View/GridFilter/GridFilterPopup.js +2 -2
  873. package/src/View/GridFilter/GridFilterStatusbar.js +2 -3
  874. package/src/View/GridFilter/GridFilterViewPanel.d.ts +2 -2
  875. package/src/View/GridFilter/GridFilterViewPanel.js +2 -2
  876. package/src/View/GridFilter/NamedQuerySelector.d.ts +3 -3
  877. package/src/View/GridFilter/NamedQuerySelector.js +1 -2
  878. package/src/View/GridFilter/useGridFilterExpressionEditor.js +19 -21
  879. package/src/View/GridFilter/useGridFilterOptionsForExpressionEditor.js +1 -1
  880. package/src/View/GridInfo/GridInfoPopup/AdaptableObjectsSummary.js +3 -4
  881. package/src/View/GridInfo/GridInfoPopup/AdaptableOptionsComponent.d.ts +2 -2
  882. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.d.ts +2 -2
  883. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +21 -15
  884. package/src/View/KeyHint.d.ts +2 -2
  885. package/src/View/KeyHint.js +1 -1
  886. package/src/View/Layout/EditCurrentLayoutButton.js +5 -1
  887. package/src/View/Layout/LayoutCloneButton.js +3 -2
  888. package/src/View/Layout/LayoutRadioSelector.js +1 -1
  889. package/src/View/Layout/LayoutViewPanel.d.ts +18 -10
  890. package/src/View/Layout/LayoutViewPanel.js +65 -40
  891. package/src/View/Layout/PivotDetailsPopoup.js +23 -7
  892. package/src/View/Layout/TransposedPopup.d.ts +2 -2
  893. package/src/View/Layout/TransposedPopup.js +8 -14
  894. package/src/View/Layout/Wizard/Components/ColumnLabels.d.ts +1 -1
  895. package/src/View/Layout/Wizard/Components/ColumnLabels.js +2 -3
  896. package/src/View/Layout/Wizard/LayoutWizard.js +115 -32
  897. package/src/View/Layout/Wizard/getGridFilterPreview.d.ts +2 -2
  898. package/src/View/Layout/Wizard/getGridFilterPreview.js +1 -2
  899. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -2
  900. package/src/View/Layout/Wizard/sections/AggregationsSection.js +78 -37
  901. package/src/View/Layout/Wizard/sections/ColumnsSection.js +213 -52
  902. package/src/View/Layout/Wizard/sections/FilterSection.js +28 -30
  903. package/src/View/Layout/Wizard/sections/GridFilterSection.js +12 -14
  904. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +9 -0
  905. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +186 -0
  906. package/src/View/Layout/Wizard/sections/PivotColumnsSection.d.ts +2 -2
  907. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +7 -7
  908. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.d.ts +8 -0
  909. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +41 -0
  910. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +78 -34
  911. package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +4 -4
  912. package/src/View/Layout/Wizard/sections/RowSummarySection.js +74 -39
  913. package/src/View/Layout/Wizard/sections/SettingsSection.js +12 -10
  914. package/src/View/Layout/Wizard/sections/SortSection.js +19 -15
  915. package/src/View/Layout/Wizard/sections/Utilities.js +1 -1
  916. package/src/View/License/LicenseWatermark.js +1 -1
  917. package/src/View/NamedQuery/EditCurrentQueryButton.d.ts +2 -2
  918. package/src/View/NamedQuery/EditCurrentQueryButton.js +1 -1
  919. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.d.ts +3 -3
  920. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  921. package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.d.ts +3 -3
  922. package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +4 -1
  923. package/src/View/NamedQuery/Wizard/NamedQueryWizard.d.ts +2 -2
  924. package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -2
  925. package/src/View/Note/NoteEditor.js +2 -4
  926. package/src/View/PlusMinus/MovePlusMinus.js +1 -1
  927. package/src/View/PlusMinus/PlusMinusSummary.d.ts +3 -1
  928. package/src/View/PlusMinus/PlusMinusSummary.js +1 -2
  929. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +3 -3
  930. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +4 -2
  931. package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +9 -3
  932. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +7 -7
  933. package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +9 -8
  934. package/src/View/QuickSearch/FloatingQuickSearch/FloatingQuickSearch.js +2 -2
  935. package/src/View/QuickSearch/QuickSearchInput.js +1 -2
  936. package/src/View/QuickSearch/QuickSearchPopup.d.ts +4 -2
  937. package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
  938. package/src/View/QuickSearch/useQuickSearchDebounced.js +1 -2
  939. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +40 -20
  940. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsIPushPull.js +28 -8
  941. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsOpenFin.js +8 -3
  942. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +29 -14
  943. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.d.ts +2 -3
  944. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +16 -10
  945. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +13 -13
  946. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +7 -7
  947. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.d.ts +1 -1
  948. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.js +9 -10
  949. package/src/View/Schedule/Wizard/ScheduleWizard.js +3 -4
  950. package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +9 -3
  951. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +15 -8
  952. package/src/View/Shortcut/Wizard/ShortcutWizard.js +4 -8
  953. package/src/View/SmartEdit/SmartEditPopup.d.ts +9 -6
  954. package/src/View/SmartEdit/SmartEditPopup.js +9 -9
  955. package/src/View/SmartEdit/SmartEditViewPanel.d.ts +8 -7
  956. package/src/View/SmartEdit/SmartEditViewPanel.js +11 -13
  957. package/src/View/SpecialColumnSettingsWizardStep.js +20 -19
  958. package/src/View/StateManagement/components/ClearButton.js +1 -1
  959. package/src/View/StateManagement/components/ExportDropdown.js +1 -1
  960. package/src/View/StateManagement/components/LoadButton.js +1 -1
  961. package/src/View/StatusBar/AdaptableStatusBar.d.ts +1 -1
  962. package/src/View/StatusBar/AdaptableStatusBar.js +12 -12
  963. package/src/View/StatusBar/StatusBarPanel.d.ts +1 -1
  964. package/src/View/StatusBar/StatusBarPanel.js +3 -5
  965. package/src/View/StatusBar/StatusBarPopup.js +4 -1
  966. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +1 -1
  967. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +47 -19
  968. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +53 -116
  969. package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +2 -2
  970. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +12 -15
  971. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.d.ts +3 -3
  972. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +14 -5
  973. package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.d.ts +3 -3
  974. package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +36 -11
  975. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +9 -5
  976. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +2 -2
  977. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +74 -30
  978. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.d.ts +1 -1
  979. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +3 -1
  980. package/src/View/SystemStatus/SystemStatusEntityRow.js +1 -2
  981. package/src/View/SystemStatus/SystemStatusPopup.d.ts +6 -4
  982. package/src/View/SystemStatus/SystemStatusPopup.js +4 -4
  983. package/src/View/SystemStatus/SystemStatusStatusBarContent.js +1 -1
  984. package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +7 -2
  985. package/src/View/SystemStatus/SystemStatusViewPanel.js +2 -2
  986. package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -2
  987. package/src/View/TeamSharing/SharedEntityDependencies.js +4 -2
  988. package/src/View/TeamSharing/SharedEntityObjectView.d.ts +2 -3
  989. package/src/View/TeamSharing/SharedEntityObjectView.js +4 -5
  990. package/src/View/Theme/ThemeEditor.js +29 -13
  991. package/src/View/Theme/ThemePopup.d.ts +4 -2
  992. package/src/View/Theme/ThemeStatusbar.d.ts +2 -2
  993. package/src/View/Theme/ThemeViewPanel.d.ts +2 -2
  994. package/src/View/Theme/VariantSelector.js +1 -2
  995. package/src/View/UIHelper.d.ts +2 -2
  996. package/src/View/UIHelper.js +10 -11
  997. package/src/View/Wizard/AdaptableWizard.d.ts +2 -2
  998. package/src/View/Wizard/AdaptableWizard.js +8 -3
  999. package/src/View/Wizard/ObjectTagsWizardSection.d.ts +3 -3
  1000. package/src/View/Wizard/ObjectTagsWizardSection.js +2 -3
  1001. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +2 -2
  1002. package/src/View/Wizard/OnePageAdaptableWizard.js +30 -11
  1003. package/src/View/Wizard/OnePageWizards.d.ts +1 -1
  1004. package/src/View/Wizard/OnePageWizards.js +40 -34
  1005. package/src/View/Wizard/TypeRadio.d.ts +5 -4
  1006. package/src/View/Wizard/TypeRadio.js +1 -1
  1007. package/src/View/Wizard/useKeyboardNavigation.d.ts +1 -1
  1008. package/src/View/renderWithAdaptableContext.d.ts +2 -1
  1009. package/src/agGrid/Adaptable.d.ts +1 -1
  1010. package/src/agGrid/Adaptable.js +12 -11
  1011. package/src/agGrid/AdaptableAgGrid.d.ts +63 -78
  1012. package/src/agGrid/AdaptableAgGrid.js +822 -1589
  1013. package/src/{AdaptableOptions → agGrid}/AdaptableFrameworkComponent.d.ts +1 -7
  1014. package/src/agGrid/AdaptableLogger.d.ts +1 -0
  1015. package/src/agGrid/AdaptableLogger.js +19 -11
  1016. package/src/agGrid/AgGridAdapter.d.ts +25 -10
  1017. package/src/agGrid/AgGridAdapter.js +329 -203
  1018. package/src/agGrid/AgGridColumnAdapter.d.ts +6 -4
  1019. package/src/agGrid/AgGridColumnAdapter.js +209 -142
  1020. package/src/agGrid/AgGridExportAdapter.d.ts +52 -0
  1021. package/src/agGrid/AgGridExportAdapter.js +773 -0
  1022. package/src/agGrid/AgGridMenuAdapter.d.ts +5 -6
  1023. package/src/agGrid/AgGridMenuAdapter.js +116 -104
  1024. package/src/agGrid/AgGridOptionsService.d.ts +1 -1
  1025. package/src/agGrid/AgGridOptionsService.js +1 -1
  1026. package/src/agGrid/FilterWrapper.js +16 -14
  1027. package/src/agGrid/FloatingFilterWrapper.js +7 -7
  1028. package/src/agGrid/agGridDataTypeDefinitions.d.ts +8 -0
  1029. package/src/agGrid/agGridDataTypeDefinitions.js +74 -0
  1030. package/src/agGrid/agGridModules.d.ts +3 -0
  1031. package/src/agGrid/agGridModules.js +15 -0
  1032. package/src/agGrid/{ActionColumnRenderer.d.ts → cellRenderers/ActionColumnRenderer.d.ts} +3 -3
  1033. package/src/agGrid/{ActionColumnRenderer.js → cellRenderers/ActionColumnRenderer.js} +35 -27
  1034. package/src/agGrid/cellRenderers/BadgeRenderer.d.ts +4 -0
  1035. package/src/agGrid/{BadgeRenderer.js → cellRenderers/BadgeRenderer.js} +28 -19
  1036. package/src/agGrid/cellRenderers/PercentBarRenderer.d.ts +4 -0
  1037. package/src/agGrid/{PercentBarRenderer.js → cellRenderers/PercentBarRenderer.js} +2 -3
  1038. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +11 -8
  1039. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +2 -2
  1040. package/src/agGrid/editors/AdaptableDateEditor/index.js +24 -20
  1041. package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +17 -7
  1042. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
  1043. package/src/agGrid/editors/AdaptableNumberEditor/index.js +20 -18
  1044. package/src/agGrid/editors/AdaptablePercentageEditor/InternalAdaptablePercentageEditor.js +10 -7
  1045. package/src/agGrid/editors/AdaptablePercentageEditor/index.d.ts +1 -1
  1046. package/src/agGrid/editors/AdaptablePercentageEditor/index.js +23 -22
  1047. package/src/components/Accordion.js +2 -4
  1048. package/src/components/AdaptableFormComponent/AdaptableFormComponent.d.ts +3 -3
  1049. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +22 -28
  1050. package/src/components/CheckBox/index.d.ts +2 -2
  1051. package/src/components/CheckBox/index.js +5 -7
  1052. package/src/components/CodeBlock/index.d.ts +2 -2
  1053. package/src/components/CodeBlock/index.js +1 -1
  1054. package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
  1055. package/src/components/ColorPicker/ColorPicker.js +5 -7
  1056. package/src/components/Dashboard/Dashboard.d.ts +2 -1
  1057. package/src/components/Dashboard/Dashboard.js +1 -2
  1058. package/src/components/Dashboard/DashboardToolbar.d.ts +2 -1
  1059. package/src/components/Dashboard/DashboardToolbar.js +1 -1
  1060. package/src/components/Datepicker/DatepickerContext.d.ts +2 -0
  1061. package/src/components/Datepicker/index.d.ts +2 -1
  1062. package/src/components/Datepicker/index.js +29 -37
  1063. package/src/components/Dialog/index.js +5 -6
  1064. package/src/components/DragAndDropContext/ModuleManager.js +18 -5
  1065. package/src/components/DragAndDropContext/TabList.d.ts +5 -5
  1066. package/src/components/DragAndDropContext/TabList.js +11 -9
  1067. package/src/components/DragAndDropContext/UnusedPanel.d.ts +2 -2
  1068. package/src/components/DragAndDropContext/UnusedPanel.js +16 -6
  1069. package/src/components/Drawer/index.js +1 -2
  1070. package/src/components/Dropdown/Arrows.d.ts +2 -2
  1071. package/src/components/Dropdown/index.d.ts +1 -1
  1072. package/src/components/Dropdown/index.js +8 -5
  1073. package/src/components/DropdownButton/index.d.ts +3 -1
  1074. package/src/components/DropdownButton/index.js +36 -18
  1075. package/src/components/DropdownButton/renderItem.d.ts +1 -1
  1076. package/src/components/DropdownButton/renderItem.js +2 -2
  1077. package/src/components/EllipsisContainer/index.d.ts +1 -1
  1078. package/src/components/EllipsisContainer/index.js +6 -10
  1079. package/src/components/EmptyContent/index.d.ts +2 -1
  1080. package/src/components/EmptyContent/index.js +2 -4
  1081. package/src/components/ErrorBox/index.d.ts +2 -2
  1082. package/src/components/ErrorBox/index.js +1 -1
  1083. package/src/components/ExpressionEditor/BaseEditorInput.d.ts +2 -1
  1084. package/src/components/ExpressionEditor/BaseEditorInput.js +12 -6
  1085. package/src/components/ExpressionEditor/DataTableEditor.d.ts +2 -2
  1086. package/src/components/ExpressionEditor/DataTableEditor.js +6 -9
  1087. package/src/components/ExpressionEditor/EditorButton.d.ts +2 -2
  1088. package/src/components/ExpressionEditor/EditorButton.js +6 -9
  1089. package/src/components/ExpressionEditor/EditorInput.d.ts +2 -2
  1090. package/src/components/ExpressionEditor/EditorInput.js +4 -1
  1091. package/src/components/ExpressionEditor/EditorInputWithWhereClause.d.ts +2 -2
  1092. package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +4 -1
  1093. package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.d.ts +2 -2
  1094. package/src/components/ExpressionEditor/ExpressionPreview.js +1 -2
  1095. package/src/components/ExpressionEditor/NamedQueryEditor.d.ts +2 -2
  1096. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilder.js +8 -6
  1097. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.d.ts +6 -6
  1098. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +14 -18
  1099. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +58 -32
  1100. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +1 -2
  1101. package/src/components/ExpressionEditor/QueryBuilder/utils.js +9 -25
  1102. package/src/components/ExpressionEditor/index.d.ts +1 -1
  1103. package/src/components/ExpressionEditor/index.js +20 -24
  1104. package/src/components/FieldWrap/index.d.ts +2 -2
  1105. package/src/components/FieldWrap/index.js +2 -2
  1106. package/src/components/FileDroppable/index.d.ts +1 -1
  1107. package/src/components/FileDroppable/index.js +4 -6
  1108. package/src/components/FileDroppable/reducer.js +17 -4
  1109. package/src/components/Flex.d.ts +1 -0
  1110. package/src/components/Flex.js +1 -0
  1111. package/src/components/FlexWithFooter.d.ts +1 -1
  1112. package/src/components/FlexWithFooter.js +3 -4
  1113. package/src/components/FormLayout/index.d.ts +4 -5
  1114. package/src/components/FormLayout/index.js +7 -4
  1115. package/src/components/HelpBlock/index.d.ts +2 -2
  1116. package/src/components/HelpBlock/index.js +1 -1
  1117. package/src/components/Icon/index.d.ts +2 -2
  1118. package/src/components/Icon/index.js +9 -10
  1119. package/src/components/IconSelector/IconSelector.js +4 -5
  1120. package/src/components/InfiniteTable/index.d.ts +3 -1
  1121. package/src/components/InfiniteTable/index.js +6 -7
  1122. package/src/components/Input/NumberInput.d.ts +1 -1
  1123. package/src/components/Input/NumberInput.js +4 -7
  1124. package/src/components/Input/index.d.ts +1 -1
  1125. package/src/components/Input/index.js +2 -3
  1126. package/src/components/InputGroup/InputGroup.d.ts +1 -1
  1127. package/src/components/InputGroup/InputGroup.js +2 -5
  1128. package/src/components/List/GridList/index.d.ts +2 -1
  1129. package/src/components/List/GridList/index.js +4 -5
  1130. package/src/components/List/ListGroup/index.d.ts +2 -2
  1131. package/src/components/List/ListGroup/index.js +2 -3
  1132. package/src/components/List/ListGroupItem/index.d.ts +2 -3
  1133. package/src/components/List/ListGroupItem/index.js +3 -4
  1134. package/src/components/Logo/index.js +1 -1
  1135. package/src/components/Modal/Backdrop.d.ts +2 -2
  1136. package/src/components/Modal/Backdrop.js +4 -1
  1137. package/src/components/Modal/index.d.ts +1 -0
  1138. package/src/components/Modal/index.js +14 -3
  1139. package/src/components/NotifyResize/index.d.ts +2 -2
  1140. package/src/components/OverlayTrigger/Overlay.js +3 -5
  1141. package/src/components/OverlayTrigger/index.d.ts +1 -0
  1142. package/src/components/OverlayTrigger/index.js +12 -11
  1143. package/src/components/Panel/index.d.ts +3 -1
  1144. package/src/components/Panel/index.js +16 -13
  1145. package/src/components/PopupWithFooter.js +2 -3
  1146. package/src/components/ProgressIndicator/ProgressIndicator.js +2 -1
  1147. package/src/components/Radio/index.d.ts +4 -3
  1148. package/src/components/Radio/index.js +13 -7
  1149. package/src/components/ResizeObserver/index.d.ts +1 -1
  1150. package/src/components/ResizeObserver/index.js +2 -5
  1151. package/src/components/Select/Select.d.ts +17 -1
  1152. package/src/components/Select/Select.js +279 -51
  1153. package/src/components/SelectableList/index.d.ts +2 -1
  1154. package/src/components/SelectableList/index.js +2 -2
  1155. package/src/components/SimpleButton/index.d.ts +1 -1
  1156. package/src/components/SimpleButton/index.js +8 -9
  1157. package/src/components/SizedContainer/index.d.ts +2 -1
  1158. package/src/components/SizedContainer/index.js +3 -4
  1159. package/src/components/StylePreview.js +1 -4
  1160. package/src/components/Table/index.d.ts +2 -1
  1161. package/src/components/Table/index.js +1 -1
  1162. package/src/components/Tabs/index.d.ts +6 -5
  1163. package/src/components/Tabs/index.js +11 -14
  1164. package/src/components/Tag/Tag.js +1 -4
  1165. package/src/components/Textarea/index.d.ts +1 -1
  1166. package/src/components/Textarea/index.js +5 -8
  1167. package/src/components/Toggle/Toggle.js +2 -4
  1168. package/src/components/Tooltip/index.d.ts +1 -1
  1169. package/src/components/WarningBox/index.d.ts +2 -2
  1170. package/src/components/WarningBox/index.js +1 -1
  1171. package/src/components/WindowModal/WindowModal.js +4 -4
  1172. package/src/components/WindowModal/useStacking.js +1 -2
  1173. package/src/components/WizardPanel/index.d.ts +2 -2
  1174. package/src/components/WizardPanel/index.js +1 -1
  1175. package/src/components/dnd/index.d.ts +13 -0
  1176. package/src/components/dnd/index.js +55 -0
  1177. package/src/components/icons/DefaultIcon.d.ts +2 -2
  1178. package/src/components/icons/DefaultIcon.js +6 -5
  1179. package/src/components/icons/add-row.d.ts +2 -2
  1180. package/src/components/icons/add-row.js +1 -1
  1181. package/src/components/icons/alert.d.ts +2 -2
  1182. package/src/components/icons/alert.js +1 -1
  1183. package/src/components/icons/align-center.d.ts +2 -2
  1184. package/src/components/icons/align-center.js +1 -1
  1185. package/src/components/icons/align-justify.d.ts +2 -2
  1186. package/src/components/icons/align-justify.js +1 -1
  1187. package/src/components/icons/align-left.d.ts +2 -2
  1188. package/src/components/icons/align-left.js +1 -1
  1189. package/src/components/icons/align-right.d.ts +2 -2
  1190. package/src/components/icons/align-right.js +1 -1
  1191. package/src/components/icons/analysis.d.ts +2 -2
  1192. package/src/components/icons/analysis.js +1 -1
  1193. package/src/components/icons/application.d.ts +2 -2
  1194. package/src/components/icons/application.js +1 -1
  1195. package/src/components/icons/arrow-down-long.d.ts +2 -2
  1196. package/src/components/icons/arrow-down-long.js +1 -1
  1197. package/src/components/icons/arrow-down.d.ts +2 -2
  1198. package/src/components/icons/arrow-down.js +1 -1
  1199. package/src/components/icons/arrow-expand.d.ts +2 -2
  1200. package/src/components/icons/arrow-expand.js +1 -1
  1201. package/src/components/icons/arrow-left.d.ts +2 -2
  1202. package/src/components/icons/arrow-left.js +1 -1
  1203. package/src/components/icons/arrow-right.d.ts +2 -2
  1204. package/src/components/icons/arrow-right.js +1 -1
  1205. package/src/components/icons/arrow-up-long.d.ts +2 -2
  1206. package/src/components/icons/arrow-up-long.js +1 -1
  1207. package/src/components/icons/arrow-up.d.ts +2 -2
  1208. package/src/components/icons/arrow-up.js +1 -1
  1209. package/src/components/icons/attach-file.d.ts +2 -2
  1210. package/src/components/icons/attach-file.js +1 -1
  1211. package/src/components/icons/badge.d.ts +2 -2
  1212. package/src/components/icons/badge.js +1 -1
  1213. package/src/components/icons/blanks.d.ts +2 -2
  1214. package/src/components/icons/blanks.js +1 -1
  1215. package/src/components/icons/bold.d.ts +2 -2
  1216. package/src/components/icons/bold.js +1 -1
  1217. package/src/components/icons/boolean-list.d.ts +2 -2
  1218. package/src/components/icons/boolean-list.js +1 -1
  1219. package/src/components/icons/brush.d.ts +2 -2
  1220. package/src/components/icons/brush.js +1 -1
  1221. package/src/components/icons/build.d.ts +2 -2
  1222. package/src/components/icons/build.js +1 -1
  1223. package/src/components/icons/bulk-update.d.ts +2 -2
  1224. package/src/components/icons/bulk-update.js +2 -6
  1225. package/src/components/icons/calculated-column.d.ts +2 -2
  1226. package/src/components/icons/calculated-column.js +1 -1
  1227. package/src/components/icons/calendar.d.ts +2 -2
  1228. package/src/components/icons/calendar.js +1 -1
  1229. package/src/components/icons/call.d.ts +2 -2
  1230. package/src/components/icons/call.js +1 -1
  1231. package/src/components/icons/campaign.d.ts +2 -2
  1232. package/src/components/icons/campaign.js +1 -1
  1233. package/src/components/icons/case-lower.d.ts +2 -2
  1234. package/src/components/icons/case-lower.js +1 -1
  1235. package/src/components/icons/case-sentence.d.ts +2 -2
  1236. package/src/components/icons/case-sentence.js +1 -1
  1237. package/src/components/icons/case-upper.d.ts +2 -2
  1238. package/src/components/icons/case-upper.js +1 -1
  1239. package/src/components/icons/cell-summary.d.ts +2 -2
  1240. package/src/components/icons/cell-summary.js +1 -1
  1241. package/src/components/icons/cell-validation.d.ts +2 -2
  1242. package/src/components/icons/cell-validation.js +1 -1
  1243. package/src/components/icons/chart.d.ts +2 -2
  1244. package/src/components/icons/chart.js +1 -1
  1245. package/src/components/icons/chat.d.ts +2 -2
  1246. package/src/components/icons/chat.js +1 -1
  1247. package/src/components/icons/check-box-outline.d.ts +2 -2
  1248. package/src/components/icons/check-box-outline.js +1 -1
  1249. package/src/components/icons/check-box.d.ts +2 -2
  1250. package/src/components/icons/check-box.js +1 -1
  1251. package/src/components/icons/check-circle.d.ts +2 -2
  1252. package/src/components/icons/check-circle.js +1 -1
  1253. package/src/components/icons/check.d.ts +2 -2
  1254. package/src/components/icons/check.js +1 -1
  1255. package/src/components/icons/clone.d.ts +2 -2
  1256. package/src/components/icons/clone.js +1 -1
  1257. package/src/components/icons/close.d.ts +2 -2
  1258. package/src/components/icons/close.js +1 -1
  1259. package/src/components/icons/cloud-upload.d.ts +2 -2
  1260. package/src/components/icons/cloud-upload.js +1 -1
  1261. package/src/components/icons/collapse-all.d.ts +2 -2
  1262. package/src/components/icons/collapse-all.js +1 -1
  1263. package/src/components/icons/collapse.d.ts +2 -2
  1264. package/src/components/icons/collapse.js +1 -1
  1265. package/src/components/icons/column-add.d.ts +2 -2
  1266. package/src/components/icons/column-add.js +1 -1
  1267. package/src/components/icons/column-chooser.d.ts +2 -2
  1268. package/src/components/icons/column-chooser.js +1 -1
  1269. package/src/components/icons/column-filter.d.ts +2 -2
  1270. package/src/components/icons/column-filter.js +1 -1
  1271. package/src/components/icons/column-info.d.ts +2 -2
  1272. package/src/components/icons/column-info.js +1 -1
  1273. package/src/components/icons/column-outline.d.ts +2 -2
  1274. package/src/components/icons/column-outline.js +1 -1
  1275. package/src/components/icons/comment.d.ts +2 -2
  1276. package/src/components/icons/comment.js +1 -1
  1277. package/src/components/icons/comments.d.ts +2 -2
  1278. package/src/components/icons/comments.js +1 -1
  1279. package/src/components/icons/contact.d.ts +2 -2
  1280. package/src/components/icons/contact.js +1 -1
  1281. package/src/components/icons/contains.d.ts +2 -2
  1282. package/src/components/icons/contains.js +2 -2
  1283. package/src/components/icons/copy.d.ts +2 -2
  1284. package/src/components/icons/copy.js +1 -1
  1285. package/src/components/icons/csv.d.ts +2 -2
  1286. package/src/components/icons/csv.js +1 -1
  1287. package/src/components/icons/custom-sort.d.ts +2 -2
  1288. package/src/components/icons/custom-sort.js +1 -1
  1289. package/src/components/icons/dashboard.d.ts +2 -2
  1290. package/src/components/icons/dashboard.js +1 -1
  1291. package/src/components/icons/data-object.d.ts +2 -2
  1292. package/src/components/icons/data-object.js +1 -1
  1293. package/src/components/icons/data-set.d.ts +2 -2
  1294. package/src/components/icons/data-set.js +1 -1
  1295. package/src/components/icons/date-range.d.ts +2 -2
  1296. package/src/components/icons/date-range.js +1 -1
  1297. package/src/components/icons/delete.d.ts +2 -2
  1298. package/src/components/icons/delete.js +1 -1
  1299. package/src/components/icons/division.d.ts +2 -2
  1300. package/src/components/icons/division.js +1 -1
  1301. package/src/components/icons/dock.d.ts +2 -2
  1302. package/src/components/icons/dock.js +1 -1
  1303. package/src/components/icons/dollar.d.ts +2 -2
  1304. package/src/components/icons/dollar.js +1 -1
  1305. package/src/components/icons/drag.d.ts +2 -2
  1306. package/src/components/icons/drag.js +1 -1
  1307. package/src/components/icons/edit.d.ts +2 -2
  1308. package/src/components/icons/edit.js +1 -1
  1309. package/src/components/icons/ends-with.d.ts +2 -2
  1310. package/src/components/icons/ends-with.js +1 -1
  1311. package/src/components/icons/equal.d.ts +2 -2
  1312. package/src/components/icons/equal.js +1 -1
  1313. package/src/components/icons/equation.d.ts +2 -2
  1314. package/src/components/icons/equation.js +1 -1
  1315. package/src/components/icons/error.d.ts +2 -2
  1316. package/src/components/icons/error.js +1 -1
  1317. package/src/components/icons/excel.d.ts +2 -2
  1318. package/src/components/icons/excel.js +1 -1
  1319. package/src/components/icons/expand-all.d.ts +2 -2
  1320. package/src/components/icons/expand-all.js +1 -1
  1321. package/src/components/icons/expand.d.ts +2 -2
  1322. package/src/components/icons/expand.js +1 -1
  1323. package/src/components/icons/exponent.d.ts +2 -2
  1324. package/src/components/icons/exponent.js +1 -1
  1325. package/src/components/icons/export.d.ts +2 -2
  1326. package/src/components/icons/export.js +1 -1
  1327. package/src/components/icons/fast-backward.d.ts +2 -2
  1328. package/src/components/icons/fast-backward.js +1 -1
  1329. package/src/components/icons/fast-forward.d.ts +2 -2
  1330. package/src/components/icons/fast-forward.js +1 -1
  1331. package/src/components/icons/fdc3.d.ts +2 -2
  1332. package/src/components/icons/fdc3.js +1 -1
  1333. package/src/components/icons/filter-off.d.ts +2 -2
  1334. package/src/components/icons/filter-off.js +1 -1
  1335. package/src/components/icons/filter.d.ts +2 -2
  1336. package/src/components/icons/filter.js +1 -1
  1337. package/src/components/icons/flashing-cell.d.ts +2 -2
  1338. package/src/components/icons/flashing-cell.js +1 -1
  1339. package/src/components/icons/folder-open.d.ts +2 -2
  1340. package/src/components/icons/folder-open.js +1 -1
  1341. package/src/components/icons/folder-shared.d.ts +2 -2
  1342. package/src/components/icons/folder-shared.js +1 -1
  1343. package/src/components/icons/folder.d.ts +2 -2
  1344. package/src/components/icons/folder.js +1 -1
  1345. package/src/components/icons/format-column.d.ts +2 -2
  1346. package/src/components/icons/format-column.js +1 -1
  1347. package/src/components/icons/freetext-column.d.ts +2 -2
  1348. package/src/components/icons/freetext-column.js +1 -1
  1349. package/src/components/icons/function.d.ts +2 -2
  1350. package/src/components/icons/function.js +1 -1
  1351. package/src/components/icons/gradient-column.d.ts +2 -2
  1352. package/src/components/icons/gradient-column.js +1 -1
  1353. package/src/components/icons/gradient.d.ts +2 -2
  1354. package/src/components/icons/gradient.js +1 -1
  1355. package/src/components/icons/greater-than-or-equal.d.ts +2 -2
  1356. package/src/components/icons/greater-than-or-equal.js +1 -1
  1357. package/src/components/icons/greater-than.d.ts +2 -2
  1358. package/src/components/icons/greater-than.js +1 -1
  1359. package/src/components/icons/grid-filter.d.ts +2 -2
  1360. package/src/components/icons/grid-filter.js +1 -1
  1361. package/src/components/icons/grid-info.d.ts +2 -2
  1362. package/src/components/icons/grid-info.js +1 -1
  1363. package/src/components/icons/hide-column.d.ts +2 -2
  1364. package/src/components/icons/hide-column.js +1 -1
  1365. package/src/components/icons/history.d.ts +2 -2
  1366. package/src/components/icons/history.js +1 -1
  1367. package/src/components/icons/home.d.ts +2 -2
  1368. package/src/components/icons/home.js +1 -1
  1369. package/src/components/icons/import-export.d.ts +2 -2
  1370. package/src/components/icons/import-export.js +1 -1
  1371. package/src/components/icons/import.d.ts +2 -2
  1372. package/src/components/icons/import.js +1 -1
  1373. package/src/components/icons/index.d.ts +7 -4
  1374. package/src/components/icons/index.js +35 -32
  1375. package/src/components/icons/info.d.ts +2 -2
  1376. package/src/components/icons/info.js +1 -1
  1377. package/src/components/icons/instrument.d.ts +2 -2
  1378. package/src/components/icons/instrument.js +1 -1
  1379. package/src/components/icons/interactions.d.ts +2 -2
  1380. package/src/components/icons/interactions.js +1 -1
  1381. package/src/components/icons/invalid.d.ts +2 -2
  1382. package/src/components/icons/invalid.js +1 -1
  1383. package/src/components/icons/ipushpull.d.ts +2 -2
  1384. package/src/components/icons/ipushpull.js +1 -1
  1385. package/src/components/icons/italic.d.ts +2 -2
  1386. package/src/components/icons/italic.js +1 -1
  1387. package/src/components/icons/justify.d.ts +2 -2
  1388. package/src/components/icons/justify.js +1 -1
  1389. package/src/components/icons/layout.d.ts +2 -2
  1390. package/src/components/icons/layout.js +1 -1
  1391. package/src/components/icons/less-than-or-equal.d.ts +2 -2
  1392. package/src/components/icons/less-than-or-equal.js +1 -1
  1393. package/src/components/icons/less-than.d.ts +2 -2
  1394. package/src/components/icons/less-than.js +1 -1
  1395. package/src/components/icons/list.d.ts +2 -2
  1396. package/src/components/icons/list.js +1 -1
  1397. package/src/components/icons/login.d.ts +2 -2
  1398. package/src/components/icons/login.js +1 -1
  1399. package/src/components/icons/logout copy.d.ts +2 -2
  1400. package/src/components/icons/logout copy.js +1 -1
  1401. package/src/components/icons/logout.d.ts +2 -2
  1402. package/src/components/icons/logout.js +1 -1
  1403. package/src/components/icons/mail.d.ts +2 -2
  1404. package/src/components/icons/mail.js +1 -1
  1405. package/src/components/icons/menu.d.ts +2 -2
  1406. package/src/components/icons/menu.js +1 -1
  1407. package/src/components/icons/minus.d.ts +2 -2
  1408. package/src/components/icons/minus.js +1 -1
  1409. package/src/components/icons/money.d.ts +2 -2
  1410. package/src/components/icons/money.js +1 -1
  1411. package/src/components/icons/multiplication.d.ts +2 -2
  1412. package/src/components/icons/multiplication.js +1 -1
  1413. package/src/components/icons/newpage.d.ts +2 -2
  1414. package/src/components/icons/newpage.js +1 -1
  1415. package/src/components/icons/news.d.ts +2 -2
  1416. package/src/components/icons/news.js +1 -1
  1417. package/src/components/icons/non-blanks.d.ts +2 -2
  1418. package/src/components/icons/non-blanks.js +1 -1
  1419. package/src/components/icons/not-contains.d.ts +2 -2
  1420. package/src/components/icons/not-contains.js +2 -2
  1421. package/src/components/icons/not-equal.d.ts +2 -2
  1422. package/src/components/icons/not-equal.js +1 -1
  1423. package/src/components/icons/note.d.ts +2 -2
  1424. package/src/components/icons/note.js +1 -1
  1425. package/src/components/icons/open-in-new.d.ts +2 -2
  1426. package/src/components/icons/open-in-new.js +1 -1
  1427. package/src/components/icons/order.d.ts +2 -2
  1428. package/src/components/icons/order.js +1 -1
  1429. package/src/components/icons/organisation.d.ts +2 -2
  1430. package/src/components/icons/organisation.js +1 -1
  1431. package/src/components/icons/overline.d.ts +2 -2
  1432. package/src/components/icons/overline.js +1 -1
  1433. package/src/components/icons/pause.d.ts +2 -2
  1434. package/src/components/icons/pause.js +1 -1
  1435. package/src/components/icons/percent-bar.d.ts +2 -2
  1436. package/src/components/icons/percent-bar.js +1 -1
  1437. package/src/components/icons/percent.d.ts +2 -2
  1438. package/src/components/icons/percent.js +1 -1
  1439. package/src/components/icons/person.d.ts +2 -2
  1440. package/src/components/icons/person.js +1 -1
  1441. package/src/components/icons/pie-chart.d.ts +2 -2
  1442. package/src/components/icons/pie-chart.js +1 -1
  1443. package/src/components/icons/play.d.ts +2 -2
  1444. package/src/components/icons/play.js +1 -1
  1445. package/src/components/icons/plus-minus.d.ts +2 -2
  1446. package/src/components/icons/plus-minus.js +1 -1
  1447. package/src/components/icons/plus.d.ts +2 -2
  1448. package/src/components/icons/plus.js +1 -1
  1449. package/src/components/icons/query.d.ts +2 -2
  1450. package/src/components/icons/query.js +1 -1
  1451. package/src/components/icons/quick-search.d.ts +2 -2
  1452. package/src/components/icons/quick-search.js +1 -1
  1453. package/src/components/icons/quote.d.ts +2 -2
  1454. package/src/components/icons/quote.js +1 -1
  1455. package/src/components/icons/refresh.d.ts +2 -2
  1456. package/src/components/icons/refresh.js +1 -1
  1457. package/src/components/icons/regex.d.ts +2 -2
  1458. package/src/components/icons/regex.js +1 -1
  1459. package/src/components/icons/reminder.d.ts +2 -2
  1460. package/src/components/icons/reminder.js +1 -1
  1461. package/src/components/icons/resume.d.ts +2 -2
  1462. package/src/components/icons/resume.js +1 -1
  1463. package/src/components/icons/rows.d.ts +2 -2
  1464. package/src/components/icons/rows.js +1 -1
  1465. package/src/components/icons/save.d.ts +2 -2
  1466. package/src/components/icons/save.js +1 -1
  1467. package/src/components/icons/schedule.d.ts +2 -2
  1468. package/src/components/icons/schedule.js +1 -1
  1469. package/src/components/icons/science.d.ts +2 -2
  1470. package/src/components/icons/science.js +1 -1
  1471. package/src/components/icons/select-all.d.ts +2 -2
  1472. package/src/components/icons/select-all.js +1 -1
  1473. package/src/components/icons/select-fwd.d.ts +2 -2
  1474. package/src/components/icons/select-fwd.js +1 -1
  1475. package/src/components/icons/select-off.d.ts +2 -2
  1476. package/src/components/icons/select-off.js +1 -1
  1477. package/src/components/icons/settings.d.ts +2 -2
  1478. package/src/components/icons/settings.js +1 -1
  1479. package/src/components/icons/shortcut.d.ts +2 -2
  1480. package/src/components/icons/shortcut.js +1 -1
  1481. package/src/components/icons/show-column.d.ts +2 -2
  1482. package/src/components/icons/show-column.js +1 -1
  1483. package/src/components/icons/smart-edit.d.ts +2 -2
  1484. package/src/components/icons/smart-edit.js +1 -1
  1485. package/src/components/icons/sort-asc.d.ts +2 -2
  1486. package/src/components/icons/sort-asc.js +1 -1
  1487. package/src/components/icons/sort-desc.d.ts +2 -2
  1488. package/src/components/icons/sort-desc.js +1 -1
  1489. package/src/components/icons/spark-line.d.ts +2 -2
  1490. package/src/components/icons/spark-line.js +1 -1
  1491. package/src/components/icons/starts-with.d.ts +2 -2
  1492. package/src/components/icons/starts-with.js +1 -1
  1493. package/src/components/icons/state-management.d.ts +2 -2
  1494. package/src/components/icons/state-management.js +1 -1
  1495. package/src/components/icons/statusbar.d.ts +2 -2
  1496. package/src/components/icons/statusbar.js +1 -1
  1497. package/src/components/icons/stop.d.ts +2 -2
  1498. package/src/components/icons/stop.js +1 -1
  1499. package/src/components/icons/strikethrough.d.ts +2 -2
  1500. package/src/components/icons/strikethrough.js +1 -1
  1501. package/src/components/icons/styled-grid.d.ts +3 -0
  1502. package/src/components/icons/styled-grid.js +5 -0
  1503. package/src/components/icons/sync.d.ts +2 -2
  1504. package/src/components/icons/sync.js +1 -1
  1505. package/src/components/icons/system-status.d.ts +2 -2
  1506. package/src/components/icons/system-status.js +1 -1
  1507. package/src/components/icons/tab-unselected.d.ts +2 -2
  1508. package/src/components/icons/tab-unselected.js +1 -1
  1509. package/src/components/icons/table-arrow-right.d.ts +2 -2
  1510. package/src/components/icons/table-arrow-right.js +1 -1
  1511. package/src/components/icons/team-share.d.ts +2 -2
  1512. package/src/components/icons/team-share.js +1 -1
  1513. package/src/components/icons/theme.d.ts +2 -2
  1514. package/src/components/icons/theme.js +1 -1
  1515. package/src/components/icons/tool-panel.d.ts +2 -2
  1516. package/src/components/icons/tool-panel.js +1 -1
  1517. package/src/components/icons/track-changes.d.ts +2 -2
  1518. package/src/components/icons/track-changes.js +1 -1
  1519. package/src/components/icons/triangle-down.d.ts +2 -2
  1520. package/src/components/icons/triangle-down.js +1 -1
  1521. package/src/components/icons/triangle-up.d.ts +2 -2
  1522. package/src/components/icons/triangle-up.js +1 -1
  1523. package/src/components/icons/unchecked.d.ts +2 -2
  1524. package/src/components/icons/unchecked.js +1 -1
  1525. package/src/components/icons/underline.d.ts +2 -2
  1526. package/src/components/icons/underline.js +1 -1
  1527. package/src/components/icons/undo.d.ts +2 -2
  1528. package/src/components/icons/undo.js +1 -1
  1529. package/src/components/icons/updated-row.d.ts +2 -2
  1530. package/src/components/icons/updated-row.js +1 -1
  1531. package/src/components/icons/upload.d.ts +2 -2
  1532. package/src/components/icons/upload.js +1 -1
  1533. package/src/components/icons/user-filter.d.ts +2 -2
  1534. package/src/components/icons/user-filter.js +1 -1
  1535. package/src/components/icons/visibility-off.d.ts +2 -2
  1536. package/src/components/icons/visibility-off.js +1 -1
  1537. package/src/components/icons/visibility.d.ts +2 -2
  1538. package/src/components/icons/visibility.js +1 -1
  1539. package/src/components/icons/warning.d.ts +2 -2
  1540. package/src/components/icons/warning.js +1 -1
  1541. package/src/components/utils/useContainerScrollObserver/index.js +1 -2
  1542. package/src/components/utils/useDraggable.d.ts +1 -1
  1543. package/src/components/utils/useDraggable.js +2 -3
  1544. package/src/components/utils/useLatest.d.ts +1 -1
  1545. package/src/components/utils/useProperty.d.ts +1 -1
  1546. package/src/components/utils/useSelectionRange.js +1 -1
  1547. package/src/env.d.ts +1 -1
  1548. package/src/env.js +3 -3
  1549. package/src/layout-manager/src/LMEmitter.d.ts +25 -0
  1550. package/src/layout-manager/src/LMEmitter.js +55 -0
  1551. package/src/layout-manager/src/LMLogger.d.ts +20 -0
  1552. package/src/layout-manager/src/LMLogger.js +62 -0
  1553. package/src/layout-manager/src/LayoutManagerModel.d.ts +111 -0
  1554. package/src/layout-manager/src/index.d.ts +75 -0
  1555. package/src/layout-manager/src/index.js +1042 -0
  1556. package/src/layout-manager/src/isLayoutEqual.d.ts +4 -0
  1557. package/src/layout-manager/src/isLayoutEqual.js +25 -0
  1558. package/src/layout-manager/src/isPivotLayoutModel.d.ts +2 -0
  1559. package/src/layout-manager/src/isPivotLayoutModel.js +3 -0
  1560. package/src/layout-manager/src/normalizeLayoutModel.d.ts +12 -0
  1561. package/src/layout-manager/src/normalizeLayoutModel.js +151 -0
  1562. package/src/layout-manager/src/simplifyLayoutModel.d.ts +4 -0
  1563. package/src/layout-manager/src/simplifyLayoutModel.js +82 -0
  1564. package/src/layout-manager/src/sortColumnIdsByOrder.d.ts +7 -0
  1565. package/src/layout-manager/src/sortColumnIdsByOrder.js +84 -0
  1566. package/src/metamodel/adaptable.metamodel.d.ts +428 -574
  1567. package/src/metamodel/adaptable.metamodel.js +1 -1
  1568. package/src/migration/AdaptableUpgradeHelper.js +5 -4
  1569. package/src/migration/VersionUpgrade17.js +56 -50
  1570. package/src/migration/VersionUpgrade20.d.ts +7 -0
  1571. package/src/migration/VersionUpgrade20.js +130 -0
  1572. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
  1573. package/src/parser/src/predicate/mapQlPredicateToExpression.d.ts +1 -1
  1574. package/src/parser/src/predicate/mapQlPredicateToExpression.js +2 -2
  1575. package/src/parser/src/predicate/types.d.ts +11 -1
  1576. package/src/parser/src/types.d.ts +6 -2
  1577. package/src/parser/src/types.js +1 -1
  1578. package/src/renderReactRoot.d.ts +3 -3
  1579. package/src/types.d.ts +32 -31
  1580. package/tsconfig.esm.tsbuildinfo +1 -1
  1581. package/src/AdaptableOptions/ActionRowOptions.d.ts +0 -175
  1582. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +0 -311
  1583. package/src/AdaptableOptions/GridFilterOptions.d.ts +0 -26
  1584. package/src/AdaptableOptions/GroupingOptions.d.ts +0 -19
  1585. package/src/Api/ActionRowApi.d.ts +0 -24
  1586. package/src/Api/Events/ActionRowSubmitted.d.ts +0 -54
  1587. package/src/Api/Events/AdaptableSearchState.d.ts +0 -22
  1588. package/src/Api/Events/BaseEventInfo.d.ts +0 -18
  1589. package/src/Api/Events/GridDataChanged.d.ts +0 -26
  1590. package/src/Api/Implementation/ActionRowApiImpl.d.ts +0 -12
  1591. package/src/Api/Internal/ActionRowInternalApi.d.ts +0 -29
  1592. package/src/Api/Internal/ActionRowInternalApi.js +0 -280
  1593. package/src/PredefinedConfig/GridState.d.ts +0 -23
  1594. package/src/PredefinedConfig/SystemState.d.ts +0 -110
  1595. package/src/Redux/ActionsReducers/GridRedux.d.ts +0 -224
  1596. package/src/Redux/ActionsReducers/GridRedux.js +0 -398
  1597. package/src/Redux/ActionsReducers/SystemRedux.d.ts +0 -330
  1598. package/src/Redux/ActionsReducers/SystemRedux.js +0 -716
  1599. package/src/Redux/DeadRedux.d.ts +0 -27
  1600. package/src/Redux/DeadRedux.js +0 -72
  1601. package/src/Strategy/Interface/IExportModule.d.ts +0 -6
  1602. package/src/Strategy/Interface/IShortcutModule.js +0 -1
  1603. package/src/Strategy/Utilities/getExpressionViewItems.d.ts +0 -4
  1604. package/src/Strategy/Utilities/getObjectTagsViewItems.d.ts +0 -4
  1605. package/src/Strategy/Utilities/getRuleViewItems.js +0 -11
  1606. package/src/Strategy/Utilities/getScopeViewItems.d.ts +0 -3
  1607. package/src/Utilities/Constants/ConfigConstants.d.ts +0 -10
  1608. package/src/Utilities/Constants/ConfigConstants.js +0 -11
  1609. package/src/Utilities/Constants/FilterConstants.d.ts +0 -10
  1610. package/src/Utilities/Constants/FilterConstants.js +0 -8
  1611. package/src/Utilities/Services/RowEditService.js +0 -35
  1612. package/src/Utilities/divideBy100.d.ts +0 -1
  1613. package/src/Utilities/divideBy100.js +0 -30
  1614. package/src/Utilities/times100.d.ts +0 -1
  1615. package/src/Utilities/times100.js +0 -23
  1616. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsActionColumnsForm.d.ts +0 -6
  1617. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsActionColumnsForm.js +0 -30
  1618. package/src/View/Components/FilterForm/FilterForm.d.ts +0 -18
  1619. package/src/View/Components/FilterForm/FilterForm.js +0 -293
  1620. package/src/View/Components/FilterForm/QuickFilterForm.d.ts +0 -7
  1621. package/src/View/Components/FilterForm/QuickFilterForm.js +0 -250
  1622. package/src/View/Components/FilterForm/QuickFilterValues.d.ts +0 -19
  1623. package/src/View/Components/FilterForm/QuickFilterValues.js +0 -196
  1624. package/src/View/Components/Panels/FilterFormPanel.d.ts +0 -22
  1625. package/src/View/Components/Panels/FilterFormPanel.js +0 -36
  1626. package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.d.ts +0 -8
  1627. package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.js +0 -22
  1628. package/src/View/Components/PermittedValuesSelector/index.d.ts +0 -1
  1629. package/src/View/Components/PermittedValuesSelector/index.js +0 -1
  1630. package/src/View/Export/ExportSelector.d.ts +0 -4
  1631. package/src/View/Export/ExportSelector.js +0 -70
  1632. package/src/View/Export/ExportTablePopup.d.ts +0 -3
  1633. package/src/View/Export/ExportTablePopup.js +0 -56
  1634. package/src/View/Export/ReportExportDropdown.js +0 -34
  1635. package/src/View/Export/constants.d.ts +0 -2
  1636. package/src/View/Export/constants.js +0 -2
  1637. package/src/View/Layout/SaveLayoutButton.d.ts +0 -2
  1638. package/src/View/Layout/SaveLayoutButton.js +0 -24
  1639. package/src/agGrid/BadgeRenderer.d.ts +0 -4
  1640. package/src/agGrid/ColumnSetupInfo.d.ts +0 -8
  1641. package/src/agGrid/PercentBarRenderer.d.ts +0 -4
  1642. package/src/agGrid/attachAddaptableColumnTypes.d.ts +0 -16
  1643. package/src/agGrid/attachAddaptableColumnTypes.js +0 -19
  1644. package/src/components/Datepicker/Caption.d.ts +0 -7
  1645. package/src/components/Datepicker/Caption.js +0 -42
  1646. package/src/components/Datepicker/CaptionLabel.d.ts +0 -8
  1647. package/src/components/Datepicker/CaptionLabel.js +0 -20
  1648. /package/src/AdaptableOptions/{ActionRowOptions.js → FilterOptions.js} +0 -0
  1649. /package/src/AdaptableOptions/{AdaptableFrameworkComponent.js → RowFormOptions.js} +0 -0
  1650. /package/src/{AdaptableOptions/ColumnFilterOptions.js → Api/Events/RowChanged.js} +0 -0
  1651. /package/src/{AdaptableOptions/GridFilterOptions.js → Api/Events/RowFormSubmitted.js} +0 -0
  1652. /package/src/{AdaptableOptions/GroupingOptions.js → Api/FilterApi.js} +0 -0
  1653. /package/src/Api/{ActionRowApi.js → RowFormApi.js} +0 -0
  1654. /package/src/{Api/Events/ActionRowSubmitted.js → PredefinedConfig/Common/AdaptableColumnContext.js} +0 -0
  1655. /package/src/{Api/Events/AdaptableSearchState.js → PredefinedConfig/Common/AdaptableSortState.js} +0 -0
  1656. /package/src/{agGrid → PredefinedConfig/Common}/ColumnSetupInfo.js +0 -0
  1657. /package/src/{Api/Events/BaseEventInfo.js → PredefinedConfig/Common/RowDataChangedInfo.js} +0 -0
  1658. /package/src/{Api/Events/GridDataChanged.js → Strategy/Interface/ICellDataChangeListenerModule.js} +0 -0
  1659. /package/src/{PredefinedConfig/GridState.js → Strategy/Interface/IKeyDownListenerModule.js} +0 -0
  1660. /package/src/{Strategy/Utilities → Utilities}/getScopeViewItems.js +0 -0
  1661. /package/src/{agGrid → Utilities}/sortColumnStateForVisibleColumns.d.ts +0 -0
  1662. /package/src/{agGrid → Utilities}/sortColumnStateForVisibleColumns.js +0 -0
  1663. /package/src/{Strategy/Utilities → Utilities}/updateSingleToMultiplePredicates.d.ts +0 -0
  1664. /package/src/{PredefinedConfig/SystemState.js → agGrid/AdaptableFrameworkComponent.js} +0 -0
  1665. /package/src/{Strategy/Interface/IExportModule.js → layout-manager/src/LayoutManagerModel.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import throttle from 'lodash/throttle';
2
2
  import debounce from 'lodash/debounce';
3
- import { createGrid, EventService, GridOptionsService, LocalEventService, ModuleNames, } from '@ag-grid-community/core';
3
+ import { createGrid, LocalEventService, } from 'ag-grid-enterprise';
4
4
  import { AdaptableLogger } from './AdaptableLogger';
5
5
  import { PrimaryKeyDocsLink } from '../Utilities/Constants/DocumentationLinkConstants';
6
6
  import StringExtensions from '../Utilities/Extensions/StringExtensions';
@@ -8,12 +8,12 @@ import Emitter from '../Utilities/Emitter';
8
8
  import { applyDefaultAdaptableOptions } from '../AdaptableOptions/DefaultAdaptableOptions';
9
9
  import { AgGridAdapter } from './AgGridAdapter';
10
10
  import * as GeneralConstants from '../Utilities/Constants/GeneralConstants';
11
- import { AB_FDC3_COLUMN, AB_SPECIAL_COLUMN, ADAPTABLE_ROW_ACTION_BUTTONS, AG_GRID_GROUPED_COLUMN, AUTOGENERATED_PK_COLUMN, DARK_THEME, DEFAULT_LAYOUT, GROUP_PATH_SEPARATOR, HALF_SECOND, LIGHT_THEME, } from '../Utilities/Constants/GeneralConstants';
11
+ import { AUTOGENERATED_PK_COLUMN, DARK_THEME, ERROR_LAYOUT, GROUP_PATH_SEPARATOR, HALF_SECOND, LIGHT_THEME, QUARTER_SECOND, } from '../Utilities/Constants/GeneralConstants';
12
12
  import { DataService } from '../Utilities/Services/DataService';
13
13
  import { AdaptableStore } from '../Redux/Store/AdaptableStore';
14
14
  import { AdaptableApiImpl } from '../Api/Implementation/AdaptableApiImpl';
15
15
  import { Fdc3Service } from '../Utilities/Services/Fdc3Service';
16
- import { CellPopupService } from '../Utilities/Services/CellPopupService';
16
+ import { AnnotationsService } from '../Utilities/Services/AnnotationsService';
17
17
  import { ChartingService } from '../Utilities/Services/ChartingService';
18
18
  import { ThemeService } from '../Utilities/Services/ThemeService';
19
19
  import { ValidationService } from '../Utilities/Services/ValidationService';
@@ -68,7 +68,6 @@ import { createUuid } from '../components/utils/uuid';
68
68
  import UIHelper from '../View/UIHelper';
69
69
  import { getAdaptableToolPanelAgGridComponent } from '../View/Components/ToolPanel/AdaptableToolPanel';
70
70
  import { ADAPTABLE_STATUS_PANEL } from '../PredefinedConfig/StatusBarState';
71
- import { createAgStatusPanelComponent } from './createAgStatusPanelComponent';
72
71
  import { AdaptableStatusBar } from '../View/StatusBar/AdaptableStatusBar';
73
72
  import ArrayExtensions from '../Utilities/Extensions/ArrayExtensions';
74
73
  import { AgGridMenuAdapter } from './AgGridMenuAdapter';
@@ -76,47 +75,34 @@ import { AdaptableApp } from '../View/AdaptableView';
76
75
  import { renderReactRoot as defaultRenderReactRoot } from '../renderReactRoot';
77
76
  import { AgGridOptionsService } from './AgGridOptionsService';
78
77
  import { parseDateValue } from '../Utilities/Helpers/DateHelper';
79
- import { AgGridColumnAdapter, getEditorsForColumnTypes } from './AgGridColumnAdapter';
80
- import uniqBy from 'lodash/uniqBy';
78
+ import { AgGridColumnAdapter } from './AgGridColumnAdapter';
81
79
  import getScrollbarSize from '../Utilities/getScrollbarSize';
82
- import { isWeightedAverageAggregation, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../PredefinedConfig/Common/AggregationColumns';
83
- import lodashIsEqual from 'lodash/isEqual';
84
- import { RowEditService } from '../Utilities/Services/RowEditService';
85
- import { weightedAverage } from './weightedAverage';
80
+ import { WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../PredefinedConfig/Common/AggregationColumns';
81
+ import { RowFormService } from '../Utilities/Services/RowFormService';
86
82
  import { FilterOnDataChangeOptions } from '../PredefinedConfig/Common/Enums';
87
- import ObjectFactory, { createBaseContext } from '../Utilities/ObjectFactory';
88
83
  import { ADAPTABLE_PUBLISH_TIMESTAMP } from '../EnvVars';
89
84
  import { AdaptableUpgradeHelper } from '../migration/AdaptableUpgradeHelper';
90
- import { ensurePortalElement } from '../components/Modal';
85
+ import { ensureLoadingScreenPortalElement } from '../components/Modal';
91
86
  import { AdaptableLoadingScreen } from '../View/Components/Popups/AdaptableLoadingScreen';
92
87
  import { createElement } from 'react';
93
- import { removeUuidAndSource } from '../Utilities/Helpers/AdaptableHelper';
94
- import { buildSortedColumnStateForLayout } from './buildSortedColumnStateForLayout';
88
+ import { createAgStatusPanelComponent } from '../Utilities/createAgStatusPanelComponent';
89
+ import { weightedAverage } from '../Utilities/weightedAverage';
95
90
  import { ROW_SUMMARY_ROW_ID } from '../PredefinedConfig/Common/RowSummary';
96
91
  import { FlashingCellService } from '../Utilities/Services/FlashingCellService';
92
+ import { AgGridExportAdapter } from './AgGridExportAdapter';
93
+ import { checkForDuplicateColumns, isPivotLayout, layoutModelToLayoutState, layoutStateToLayoutModel, normalizeLayout, tableLayoutToTableLayoutModel, } from '../Api/Implementation/LayoutHelpers';
94
+ import { LayoutManager } from '../layout-manager/src';
95
+ import { isPivotLayoutModel } from '../layout-manager/src/isPivotLayoutModel';
96
+ import { ACTION_COLUMN_TYPE, CALCULATED_COLUMN_TYPE, FDC3_COLUMN_TYPE, FREE_TEXT_COLUMN_TYPE, } from '../PredefinedConfig/Common/AdaptableColumn';
97
+ import { agGridDataTypeDefinitions } from './agGridDataTypeDefinitions';
97
98
  const LocalEventService_Prototype = LocalEventService.prototype;
98
99
  const LocalEventService_dispatchEvent = LocalEventService_Prototype.dispatchEvent;
99
- const GridOptionsService_updateGridOptions = GridOptionsService.prototype.updateGridOptions;
100
- const EventService_Prototype = EventService.prototype;
101
- const EventService_wireBeans = EventService_Prototype.wireBeans;
102
- // AG GRID obfuscates its internals, this is (currently) the best way to get hold of its internal services
103
- const DANGER_AG_GRID_BEANS_MAP = {};
104
- EventService_Prototype.wireBeans = function (beans) {
105
- var _a;
106
- EventService_wireBeans.apply(this, arguments);
107
- const gridId = (_a = beans === null || beans === void 0 ? void 0 : beans.context) === null || _a === void 0 ? void 0 : _a.getGridId();
108
- if (!gridId) {
109
- console.error('CRITICAL: No gridId found in beans, this should never happen!');
110
- }
111
- DANGER_AG_GRID_BEANS_MAP[gridId] = beans;
112
- };
113
100
  LocalEventService_Prototype.dispatchEvent = function (event) {
114
101
  LocalEventService_dispatchEvent.apply(this, arguments);
115
102
  if (event.type === 'cellChanged' || event.type === 'dataChanged') {
116
103
  const eventRowNode = event.node;
117
104
  const extractGridApiFromRowNode = (rowNode) => {
118
- var _a;
119
- const rowNodeApi = (_a = rowNode === null || rowNode === void 0 ? void 0 : rowNode.beans) === null || _a === void 0 ? void 0 : _a.gridApi;
105
+ const rowNodeApi = rowNode?.beans?.gridApi;
120
106
  if (!rowNodeApi) {
121
107
  AdaptableLogger.consoleErrorBase(`No GridAPI found in passed RowNode, this should never happen!`, rowNode);
122
108
  }
@@ -126,8 +112,7 @@ LocalEventService_Prototype.dispatchEvent = function (event) {
126
112
  // as this fn is shared by all instances
127
113
  if (eventRowNode) {
128
114
  AdaptableAgGrid.forEachAdaptable((adaptable) => {
129
- var _a;
130
- if (extractGridApiFromRowNode(eventRowNode) !== ((_a = adaptable.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi(true))) {
115
+ if (extractGridApiFromRowNode(eventRowNode) !== adaptable.agGridAdapter?.getAgGridApi(true)) {
131
116
  // the event is coming from another aggrid instance
132
117
  // so IGNORE IT
133
118
  return;
@@ -145,19 +130,15 @@ LocalEventService_Prototype.dispatchEvent = function (event) {
145
130
  const adaptableInstances = {};
146
131
  const publishTimestamp = Number(ADAPTABLE_PUBLISH_TIMESTAMP);
147
132
  export class AdaptableAgGrid {
148
- constructor() {
133
+ constructor(config) {
149
134
  /**
150
135
  * once layouts are properly handled with the new aggrid methods & events
151
136
  * we can remove this hack
152
137
  */
153
138
  this.previousAgGridLayoutState = '';
139
+ this.filteredOutPrimaryKeys = new Set();
154
140
  this.columnMinMaxValuesCache = {};
155
141
  this.renderReactRoot = (node, container) => defaultRenderReactRoot(node, container);
156
- /**
157
- * do NOT mutate this array reference, this is passed only initially to AG Grid and we can only change it's internal state
158
- */
159
- this.DANGER_excelStyles = [];
160
- this.originalExcelStyles = [];
161
142
  /**
162
143
  * Temporary, these are MIGRATION technical debts, and should be removed as soon as possible
163
144
  */
@@ -189,9 +170,10 @@ export class AdaptableAgGrid {
189
170
  this.lifecycleState = 'initial';
190
171
  this.emitter = new Emitter();
191
172
  this.agGridOptionsService = new AgGridOptionsService(this);
192
- this.agGridAdapter = new AgGridAdapter(this);
173
+ this.agGridAdapter = new AgGridAdapter(this, config);
193
174
  this.agGridMenuAdapter = new AgGridMenuAdapter(this);
194
175
  this.agGridColumnAdapter = new AgGridColumnAdapter(this);
176
+ this.agGridExportAdapter = new AgGridExportAdapter(this);
195
177
  this.DataService = new DataService(this);
196
178
  }
197
179
  static forEachAdaptable(fn) {
@@ -257,17 +239,20 @@ export class AdaptableAgGrid {
257
239
  };
258
240
  if (promise && promise.then) {
259
241
  return promise.then(() => {
260
- const adaptableInstance = new AdaptableAgGrid();
242
+ const adaptableInstance = new AdaptableAgGrid({
243
+ getAgGridColumnApiModuleReference: config.getAgGridColumnApiModuleReference,
244
+ });
261
245
  return doInit(adaptableInstance);
262
246
  });
263
247
  }
264
248
  else {
265
- const adaptableInstance = new AdaptableAgGrid();
249
+ const adaptableInstance = new AdaptableAgGrid({
250
+ getAgGridColumnApiModuleReference: config.getAgGridColumnApiModuleReference,
251
+ });
266
252
  return doInit(adaptableInstance);
267
253
  }
268
254
  }
269
255
  async _initAdaptableAgGrid(config) {
270
- var _a, _b;
271
256
  // Phase 1: Preprocess Adaptable Options
272
257
  this._isDetailGrid = config.isDetailGrid === true;
273
258
  this._isDetailGridForIndex = config.isDetailGridForRowIndex;
@@ -276,7 +261,7 @@ export class AdaptableAgGrid {
276
261
  if (StringExtensions.IsNullOrEmptyOrWhiteSpace(this._rawAdaptableOptions.adaptableId)) {
277
262
  this._rawAdaptableOptions.adaptableId = `adaptable_id_${Date.now()}`;
278
263
  }
279
- this.logger = (_a = this.logger) !== null && _a !== void 0 ? _a : new AdaptableLogger(this._rawAdaptableOptions.adaptableId);
264
+ this.logger = this.logger ?? new AdaptableLogger(this._rawAdaptableOptions.adaptableId);
280
265
  const perfInitAdaptableAgGrid = this.logger.beginPerf(`Adaptable._initAdaptableAgGrid()`);
281
266
  AdaptableAgGrid.collectInstance(this, this._rawAdaptableOptions.adaptableId);
282
267
  this.variant = config.variant;
@@ -285,10 +270,15 @@ export class AdaptableAgGrid {
285
270
  this.hasAutogeneratedPrimaryKey = !!this._rawAdaptableOptions.autogeneratePrimaryKey;
286
271
  this.adaptableOptions = applyDefaultAdaptableOptions(this._rawAdaptableOptions);
287
272
  this.adaptableOptions = this.normalizeAdaptableOptions(this.adaptableOptions);
288
- const { showLoadingScreen, loadingScreenDelay, loadingScreenText, loadingScreenTitle } = this.adaptableOptions.userInterfaceOptions;
273
+ const { showLoadingScreen, loadingScreenDelay, loadingScreenText, loadingScreenTitle } = this.adaptableOptions.userInterfaceOptions.loadingScreenOptions;
289
274
  if (showLoadingScreen) {
290
275
  this.logger.info(`Show Loading Screen`);
291
- const portalElement = ensurePortalElement();
276
+ // it's important to use ensureLoadingScreenPortalElement
277
+ // and not ensurePortalElement, because multiple adaptable instances share the same portal element
278
+ // so when displaying the second one, the react root associated to the portal element
279
+ // seems to be somewhat shared via the html element, so the portal element of the first one is destroyed
280
+ // resulting in the settings popup not being displayed anymore
281
+ const portalElement = ensureLoadingScreenPortalElement();
292
282
  if (portalElement) {
293
283
  this.unmountLoadingScreen = this.renderReactRoot(createElement(AdaptableLoadingScreen, {
294
284
  showLoadingScreen,
@@ -323,7 +313,7 @@ export class AdaptableAgGrid {
323
313
  /**
324
314
  * This method is called after the store is loaded;
325
315
  * it allows to modify the state before it is used by the application
326
- * e.g. adding default Layout, migrating deprecated state, etc.
316
+ * e.g. migrating deprecated state, etc.
327
317
  */
328
318
  postLoadHook: (state) => {
329
319
  if (this.adaptableOptions.stateOptions.autoMigrateState) {
@@ -353,10 +343,20 @@ export class AdaptableAgGrid {
353
343
  this.lifecycleState = 'setupAgGrid';
354
344
  const gridOptions = config.gridOptions;
355
345
  // Needed here because special column defs are required for deriving the adaptable column state
356
- const columnDefs = this.getColumnDefinitionsInclSpecialColumns(gridOptions.columnDefs || []);
346
+ const columnDefs = this.agGridAdapter.getColumnDefinitionsInclSpecialColumns(gridOptions.columnDefs || []);
357
347
  gridOptions.columnDefs = columnDefs;
358
348
  this.setInitialGridOptions(gridOptions, config.variant);
359
- gridOptions.initialState = this.mapAdaptableStateToAgGridState(this.adaptableStore.TheStore.getState(), gridOptions.columnDefs);
349
+ const { gridState: initialGridState, layoutModel } = this.mapAdaptableStateToAgGridState(this.adaptableStore.TheStore.getState(), gridOptions.columnDefs, { isTree: !!gridOptions.treeData });
350
+ gridOptions.initialState = initialGridState;
351
+ if (layoutModel) {
352
+ if (isPivotLayoutModel(layoutModel)) {
353
+ gridOptions.pivotDefaultExpanded = layoutModel.PivotExpandLevel;
354
+ }
355
+ else {
356
+ gridOptions.groupDisplayType =
357
+ layoutModel.RowGroupDisplayType === 'multi' ? 'multipleColumns' : 'singleColumn';
358
+ }
359
+ }
360
360
  this.lifecycleState = 'initAgGrid';
361
361
  this.agGridAdapter.initialGridOptions = gridOptions;
362
362
  const perfInitAgGrid = this.logger.beginPerf(`initAgGrid()`);
@@ -368,14 +368,40 @@ export class AdaptableAgGrid {
368
368
  this.logger.consoleError(`Adaptable failed to initialize AG Grid!`);
369
369
  return Promise.reject('Adaptable failed to initialize AG Grid!');
370
370
  }
371
+ this.layoutManager = new LayoutManager({
372
+ gridApi: agGridApi,
373
+ debugId: this.adaptableOptions.adaptableId,
374
+ });
375
+ this.layoutManager.silentSetCurrentLayout(layoutModel, {
376
+ normalize: true,
377
+ });
378
+ // this shouldn't be needed
379
+ // but AG Grid has a bug, and in pivot layout,
380
+ // even if we provide an initial AG Grid state with
381
+ // the aggregations in the correct order,
382
+ // they will end up in the wrong order
383
+ // so we need to force the layout to be applied again
384
+ if (isPivotLayoutModel(layoutModel)) {
385
+ this.layoutManager.setLayout(layoutModel, {
386
+ force: true,
387
+ });
388
+ }
389
+ this.layoutManager.onChange((layoutModel) => {
390
+ const currentLayout = this.api.layoutApi.getCurrentLayout();
391
+ const newLayoutObject = layoutModelToLayoutState(layoutModel, currentLayout);
392
+ this.onLayoutChange(newLayoutObject);
393
+ });
394
+ this.layoutManager.onColumnDefsChanged(() => {
395
+ this.updateColumnModelAndRefreshGrid();
396
+ });
371
397
  this.logger.info(`Hide Loading Screen`);
372
- (_b = this.unmountLoadingScreen) === null || _b === void 0 ? void 0 : _b.call(this);
398
+ this.unmountLoadingScreen?.();
373
399
  perfInitAgGrid.end();
374
400
  // we need to intercept several AG Grid Api methods and trigger Adaptale state changes
375
- this.monkeyPatchingGridOptionsUpdates(agGridApi);
376
401
  this.agGridAdapter.setAgGridApi(agGridApi);
402
+ this.agGridAdapter.monkeyPatchingGridOptionsUpdates(agGridApi);
377
403
  this.lifecycleState = 'agGridReady';
378
- this.logger.info(`Registered AG Grid modules: `, this.agGridAdapter.getRegisteredModuleNames().sort());
404
+ this.logger.info(`Registered AG Grid modules: `, this.agGridAdapter.getAgGridRegisteredModuleNames().sort());
379
405
  /**
380
406
  * At this point AG Grid is initialized!
381
407
  */
@@ -385,17 +411,17 @@ export class AdaptableAgGrid {
385
411
  this.lifecycleState = 'available';
386
412
  this.api.themeApi.applyCurrentTheme();
387
413
  this.validatePrimaryKey();
388
- this.embedColumnMenu = this.agGridAdapter.isModulePresent(ModuleNames.MenuModule);
389
- this.api.internalApi.setTreeMode(!!this.agGridAdapter.getAgGridApi().getGridOption('treeData'));
390
414
  // TODO AFL MIG: we could just patch the defautl Layout on init? instead
391
415
  this.checkShouldClearExistingFiltersOrSearches();
392
- this.applyColumnFiltering();
416
+ this.applyFiltering();
393
417
  this.addGridEventListeners();
394
418
  this.temporaryAdaptableStateUpdates();
395
419
  this.redrawBody();
396
420
  this.refreshHeader();
397
421
  const currentLayout = this.api.layoutApi.getCurrentLayout();
398
- if (currentLayout.EnablePivot) {
422
+ checkForDuplicateColumns(currentLayout);
423
+ this.layoutManager.silentSetCurrentLayout(layoutStateToLayoutModel(currentLayout));
424
+ if (isPivotLayout(currentLayout)) {
399
425
  // this is very very strange!
400
426
  // for some projects, if the initial layout is pivot, the columnDefs of the pivot resutl columns are NOT derived correctly from the main colDefs
401
427
  // doing the following line fixes the issue because it foces the pivot columns to be created again
@@ -403,12 +429,16 @@ export class AdaptableAgGrid {
403
429
  // but this proj needs the hack: /tests/pages/format-column/initial-pivot-layout-docs.page.tsx
404
430
  this.agGridAdapter.setGridOption('pivotMode', false);
405
431
  this.agGridAdapter.setGridOption('pivotMode', true);
432
+ // also quick search is not working initially, although the setupColumns is called correctly
433
+ // so we need to do this to make it work
434
+ // see test /tests/pages/quick-search/pivot-search.spec.ts
435
+ this.updateColumnModelAndRefreshGrid();
406
436
  }
407
- // create the module menu (for use in the dashboard and the toolpanel)
408
- // TODO see #create-create-module-menu - make sure it's the same here and there
409
- this.ModuleService.createModuleMenus();
410
- // update initial mode of DataChangeHistory
411
- this.api.internalApi.initializeDataChangeHistory();
437
+ else {
438
+ this.layoutManager.applyRowGroupValues(layoutStateToLayoutModel(currentLayout).RowGroupValues);
439
+ }
440
+ this.autoSizeLayoutIfNeeded();
441
+ this.ModuleService.createModuleUIItems();
412
442
  const adaptableContainerElem = this.getAdaptableContainerElement();
413
443
  if (adaptableContainerElem != null) {
414
444
  adaptableContainerElem.innerHTML = '';
@@ -429,13 +459,12 @@ export class AdaptableAgGrid {
429
459
  this.lifecycleState = 'ready';
430
460
  this.forPlugins((plugin) => plugin.onAdaptableReady(this, this.adaptableOptions));
431
461
  setTimeout(() => {
432
- var _a, _b;
433
462
  // without the setTimeout, calling autoSizeAllColumns immediately in the onAdaptableReady
434
463
  // does not work. (I prefer setTimeout to rAF, as raf is not running when you switch tabs)
435
464
  //
436
465
  // it also makes it possible to listen to CALCULATED_COLUMN_READY, DASHBOARD_READY, etc.
437
466
  // in onAdaptableReady - without this those event listeners are not triggered
438
- (_b = (_a = this.api) === null || _a === void 0 ? void 0 : _a.eventApi) === null || _b === void 0 ? void 0 : _b.emit('AdaptableReady', {
467
+ this.api?.eventApi?.emit('AdaptableReady', {
439
468
  adaptableApi: this.api,
440
469
  agGridApi: this.agGridAdapter.getAgGridApi(),
441
470
  });
@@ -449,95 +478,70 @@ export class AdaptableAgGrid {
449
478
  return state;
450
479
  }
451
480
  normaliseLayoutState(state, gridOptions) {
452
- var _a, _b, _c, _d, _e, _f;
453
- if (this.shouldCreateDefaultLayout(state, this.adaptableOptions)) {
454
- const defaultLayout = this.createDefaultLayout(state, gridOptions);
455
- const layoutState = state.Layout || {};
456
- const availableLayouts = layoutState.Layouts || [];
457
- availableLayouts.push(defaultLayout);
458
- layoutState.Layouts = availableLayouts;
459
- layoutState.CurrentLayout = defaultLayout.Name;
460
- state.Layout = layoutState;
461
- }
462
- else {
463
- const layoutState = state.Layout;
464
- // ensure CurrentLayout is valid
465
- if (!layoutState.CurrentLayout ||
466
- !layoutState.Layouts.find((l) => l.Name === layoutState.CurrentLayout)) {
467
- layoutState.CurrentLayout = (_b = (_a = layoutState.Layouts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.Name;
468
- }
481
+ const layoutState = state.Layout;
482
+ // ensure that at least one Layout has been provided
483
+ if (!layoutState || !layoutState.Layouts?.length) {
484
+ this.logger
485
+ .consoleError(`You have not defined any Layout in your predefinedConfig.Layout.Layouts[] state!
486
+
487
+ You need to define at least one Layout!`);
469
488
  }
470
- // for the initial state, we need to dynamically add the ActionRowColumn (if necessary)
471
- // for subsequent layout changes, the `Adaptable.setLayout()` method handles this
472
- // this is a serious code smell, hopefully we will delete `setLayout()` at some point
473
- const hasActionRowButtons = !!((_c = this.adaptableOptions.actionRowOptions) === null || _c === void 0 ? void 0 : _c.actionRowButtons);
474
- if (hasActionRowButtons) {
475
- const currentLayout = state.Layout.Layouts.find((l) => l.Name === state.Layout.CurrentLayout);
476
- if (currentLayout && !currentLayout.Columns.includes(ADAPTABLE_ROW_ACTION_BUTTONS)) {
477
- currentLayout.Columns.push(ADAPTABLE_ROW_ACTION_BUTTONS);
478
- const columnPosition = (_e = (_d = this.adaptableOptions.actionRowOptions) === null || _d === void 0 ? void 0 : _d.actionRowButtonOptions) === null || _e === void 0 ? void 0 : _e.position;
479
- currentLayout.PinnedColumnsMap = currentLayout.PinnedColumnsMap || {};
480
- currentLayout.PinnedColumnsMap[ADAPTABLE_ROW_ACTION_BUTTONS] =
481
- columnPosition === 'pinnedRight' ? 'right' : 'left';
482
- }
489
+ // ensure CurrentLayout is valid
490
+ if (!layoutState.CurrentLayout ||
491
+ !layoutState.Layouts.find((l) => l.Name === layoutState.CurrentLayout)) {
492
+ layoutState.CurrentLayout = layoutState.Layouts?.[0]?.Name;
483
493
  }
484
494
  /**
485
- * Viewport mode does not support a few
486
- * features instead of complicating the
487
- * logic where layout is applied, it is easier and
488
- * less error prone to just remove it.
495
+ * Viewport mode does not support a few AG Grid features which are contained in a Layout
496
+ * Accordingly we remove this when using this Row Model
489
497
  */
490
498
  if (gridOptions.rowModelType === 'viewport') {
491
- (_f = state.Layout.Layouts) === null || _f === void 0 ? void 0 : _f.forEach((layout) => {
492
- if (layout.RowGroupedColumns) {
493
- delete layout.RowGroupedColumns;
494
- }
495
- if (layout.AggregationColumns) {
496
- delete layout.AggregationColumns;
497
- }
498
- if (layout.PivotColumns) {
499
- delete layout.PivotColumns;
500
- delete layout.EnablePivot;
501
- }
502
- });
499
+ if (state.Layout.Layouts) {
500
+ state.Layout.Layouts = state.Layout.Layouts.filter((layout) => {
501
+ if (isPivotLayout(layout)) {
502
+ return false;
503
+ }
504
+ if (layout.RowGroupedColumns) {
505
+ delete layout.RowGroupedColumns;
506
+ }
507
+ if (layout.TableAggregationColumns) {
508
+ delete layout.TableAggregationColumns;
509
+ }
510
+ return true;
511
+ });
512
+ }
513
+ }
514
+ if (state.Layout.Layouts) {
515
+ const normalizeOptions = {
516
+ isTree: !!gridOptions.treeData,
517
+ };
518
+ // it's very important that we do this here
519
+ // as the layout may not be fully specified in the predefinedConfig
520
+ // eg: might not include the generated row group columns in the column order
521
+ // but the normalization does this for us
522
+ state.Layout.Layouts = state.Layout.Layouts.map((layout) => normalizeLayout(layout, normalizeOptions));
503
523
  }
504
524
  return state;
505
525
  }
506
526
  normaliseToolPanelState(state) {
507
- var _a, _b, _c;
508
- if ((_a = state === null || state === void 0 ? void 0 : state.ToolPanel) === null || _a === void 0 ? void 0 : _a.ToolPanels) {
527
+ if (state?.ToolPanel?.ToolPanels) {
509
528
  return state;
510
529
  }
511
530
  // no predefined config provided, we will display all the panels collapsed (custom & module)
512
531
  const defaultToolPanels = [];
513
- (_c = (_b = this.adaptableOptions.toolPanelOptions) === null || _b === void 0 ? void 0 : _b.customToolPanels) === null || _c === void 0 ? void 0 : _c.forEach((customToolPanel) => defaultToolPanels.push({ Name: customToolPanel.name }));
532
+ this.adaptableOptions.toolPanelOptions?.customToolPanels?.forEach((customToolPanel) => defaultToolPanels.push({ Name: customToolPanel.name }));
514
533
  ALL_TOOL_PANELS.forEach((moduleToolPanel) => defaultToolPanels.push({ Name: moduleToolPanel }));
515
534
  const toolPanelState = state.ToolPanel || {};
516
535
  toolPanelState.ToolPanels = defaultToolPanels;
517
536
  state.ToolPanel = toolPanelState;
518
537
  return state;
519
538
  }
520
- refreshQuickFilter() {
521
- const isQuickFilterVisible = this.api.internalApi.getSystemState().IsQuickFilterVisible;
522
- if (this.isQuickFilterAvailable()) {
523
- if (isQuickFilterVisible) {
524
- this.api.columnFilterApi.showQuickFilterBar();
525
- }
526
- else {
527
- this.api.columnFilterApi.hideQuickFilterBar();
528
- }
529
- }
530
- }
531
- applyColumnFiltering() {
532
- this.refreshQuickFilter();
533
- this.applyGridFiltering();
534
- this.agGridAdapter.updateColumnFilterActiveState();
535
- }
536
- applyGridFiltering() {
539
+ applyFiltering() {
537
540
  this.agGridAdapter.getAgGridApi().onFilterChanged();
538
541
  this._emit('AdapTableFiltersApplied');
539
542
  this.refreshSelectedCellsState();
540
543
  this.refreshSelectedRowsState();
544
+ this.agGridAdapter.updateColumnFilterActiveState();
541
545
  }
542
546
  // refreshAgGridWithAdaptableState() {
543
547
  // this.refreshColDefs();
@@ -546,12 +550,8 @@ export class AdaptableAgGrid {
546
550
  // this.checkShouldClearExistingFiltersOrSearches();
547
551
  // this.applyColumnFiltering();
548
552
  // }
549
- refreshColDefs(agGridColDefs) {
550
- const freshColDefs = this.getColumnDefinitionsInclSpecialColumns(agGridColDefs);
551
- this.agGridAdapter.setGridOption('columnDefs', freshColDefs);
552
- }
553
553
  showQuickFilter() {
554
- const height = this.api.optionsApi.getColumnFilterOptions().quickFilterOptions.quickFilterHeight;
554
+ const height = this.api.optionsApi.getFilterOptions().columnFilterOptions.quickFilterHeight;
555
555
  this.agGridAdapter.getAgGridApi().setGridOption('floatingFiltersHeight', height);
556
556
  }
557
557
  hideQuickFilter() {
@@ -581,7 +581,11 @@ export class AdaptableAgGrid {
581
581
  */
582
582
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'context', (original_context) => {
583
583
  const userContext = original_context || {};
584
- return Object.assign(Object.assign({}, userContext), { __adaptable: this, adaptableApi: this.api });
584
+ return {
585
+ ...userContext,
586
+ __adaptable: this,
587
+ adaptableApi: this.api,
588
+ };
585
589
  });
586
590
  /**
587
591
  * `gridId`
@@ -591,9 +595,16 @@ export class AdaptableAgGrid {
591
595
  if (this._isDetailGridForIndex != null) {
592
596
  agGridId = `${agGridId}_detail-${this._isDetailGridForIndex}`;
593
597
  }
594
- this._agGridId = agGridId;
598
+ this.agGridAdapter.setAgGridId(agGridId);
595
599
  return agGridId;
596
600
  });
601
+ // FIXME AFL: handle both ThemingApi and legacy CSS
602
+ /**
603
+ * `theme`
604
+ */
605
+ this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'theme', (original_gridId) => {
606
+ return 'legacy';
607
+ });
597
608
  /**
598
609
  * `getRowId`
599
610
  */
@@ -619,20 +630,19 @@ export class AdaptableAgGrid {
619
630
  };
620
631
  }
621
632
  return (params) => {
622
- var _a, _b, _c;
623
- if ((_a = params.data) === null || _a === void 0 ? void 0 : _a[primaryKey]) {
633
+ if (params.data?.[primaryKey]) {
624
634
  const primaryKeyValue = params.data[primaryKey];
625
635
  return typeof primaryKeyValue === 'number'
626
636
  ? `${primaryKeyValue}`
627
637
  : params.data[primaryKey];
628
638
  }
629
639
  // might be a summary row
630
- if ((_b = params.data) === null || _b === void 0 ? void 0 : _b[ROW_SUMMARY_ROW_ID]) {
640
+ if (params.data?.[ROW_SUMMARY_ROW_ID]) {
631
641
  return params.data[ROW_SUMMARY_ROW_ID];
632
642
  }
633
643
  // AFL 2024.08.17 - no idea why is this here and when it's used
634
644
  // might be a group row
635
- const parentKeys = (_c = params.parentKeys) !== null && _c !== void 0 ? _c : [];
645
+ const parentKeys = params.parentKeys ?? [];
636
646
  const values = Object.values(params.data);
637
647
  if (values.length) {
638
648
  const id = [...parentKeys, values[0]].join('/');
@@ -684,9 +694,8 @@ export class AdaptableAgGrid {
684
694
  if (!this.isAvailable) {
685
695
  return true;
686
696
  }
687
- const columnFilters = this.api.columnFilterApi.getActiveColumnFilters();
688
- const isColumnFiltersActive = ArrayExtensions.IsNotNullOrEmpty(columnFilters);
689
- const isGridFilterActive = StringExtensions.IsNotNullOrEmpty(this.api.gridFilterApi.getCurrentGridFilterExpression());
697
+ const isColumnFiltersActive = ArrayExtensions.IsNotNullOrEmpty(this.api.filterApi.columnFilterApi.getActiveColumnFilters());
698
+ const isGridFilterActive = StringExtensions.IsNotNullOrEmpty(this.api.filterApi.gridFilterApi.getCurrentGridFilterExpression());
690
699
  return (isColumnFiltersActive ||
691
700
  isGridFilterActive ||
692
701
  // it means that userPropertyValue will be called so we re-init that collection
@@ -697,39 +706,65 @@ export class AdaptableAgGrid {
697
706
  * `doesExternalFilterPass`
698
707
  */
699
708
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'doesExternalFilterPass', (original_doesExternalFilterPass) => {
709
+ const { filteredOutPrimaryKeys } = this;
710
+ filteredOutPrimaryKeys.clear();
700
711
  return (node) => {
712
+ if (node.rowIndex === 0) {
713
+ filteredOutPrimaryKeys.clear();
714
+ }
701
715
  if (!this.isAvailable) {
702
716
  return true;
703
717
  }
704
- // first we assess a Grid Filter (if its running locally)
705
- if (!this.isGroupRowNode(node)) {
706
- const currentGridFilter = this.api.gridFilterApi.getCurrentGridFilterExpression();
707
- if (currentGridFilter) {
708
- const evaluateGridFilterOnClient = this.api.expressionApi.internalApi.evaluateExpressionInAdaptableQL('GridFilter', undefined, currentGridFilter);
709
- if (evaluateGridFilterOnClient) {
710
- const isCurrentGridFilterValid = this.api.expressionApi.isValidBooleanExpression(currentGridFilter, GridFilterModuleId, `Invalid Grid Filter '${currentGridFilter}'`);
711
- if (!isCurrentGridFilterValid ||
712
- !this.api.internalApi
713
- .getQueryLanguageService()
714
- .evaluateBooleanExpression(currentGridFilter, GridFilterModuleId, node)) {
715
- return false;
716
- }
718
+ // Note: not sure we need this check as doubtful AG Grid ever passes in a Group Row node to filter...
719
+ // But if it does, then we might change this IF we allow Column filtering (but not Grid Filters) for Group nodes
720
+ if (this.isGroupRowNode(node)) {
721
+ return true;
722
+ }
723
+ // first assess if the Row is filterable - if not, then return true so it appears in Grid
724
+ const isRowFilterable = this.api.optionsApi.getFilterOptions().isRowFilterable;
725
+ if (typeof isRowFilterable === 'function') {
726
+ const rowFilterableContext = {
727
+ ...this.api.internalApi.buildBaseContext(),
728
+ rowNode: node,
729
+ data: node.data,
730
+ };
731
+ if (!isRowFilterable(rowFilterableContext)) {
732
+ return true;
733
+ }
734
+ }
735
+ // get the Primary Key Value for the Row Node being evaluated
736
+ const primaryKey = this.getPrimaryKeyValueFromRowNode(node);
737
+ // next we assess a Grid Filter (if its running locally)
738
+ const currentGridFilterExpression = this.api.filterApi.gridFilterApi.getCurrentGridFilterExpression();
739
+ if (StringExtensions.IsNotNullOrEmpty(currentGridFilterExpression)) {
740
+ const evaluateGridFilterOnClient = this.api.expressionApi.internalApi.evaluateExpressionInAdaptableQL('GridFilter', undefined, currentGridFilterExpression);
741
+ if (evaluateGridFilterOnClient) {
742
+ const isCurrentGridFilterValid = this.api.expressionApi.isValidBooleanExpression(currentGridFilterExpression, GridFilterModuleId, `Invalid Grid Filter '${currentGridFilterExpression}'`);
743
+ // Not sure about this - what should we do with an invalid Grid Filter?
744
+ // Here we essentially clear the Grid for invalid Grid Filter by returning false for each row
745
+ if (!isCurrentGridFilterValid) {
746
+ filteredOutPrimaryKeys.add(primaryKey);
747
+ return false;
748
+ }
749
+ const gridFilterEvaluationResult = this.api.internalApi
750
+ .getQueryLanguageService()
751
+ .evaluateBooleanExpression(currentGridFilterExpression, GridFilterModuleId, node);
752
+ if (!gridFilterEvaluationResult) {
753
+ filteredOutPrimaryKeys.add(primaryKey);
754
+ return false;
717
755
  }
718
756
  }
719
757
  }
720
- const columnFilters = this.api.columnFilterApi.getActiveColumnFilters();
758
+ // finally we evaluate column filters
759
+ const columnFilters = this.api.filterApi.columnFilterApi.getActiveColumnFilters();
721
760
  try {
722
761
  if (columnFilters.length > 0) {
723
- const isRowFiltrable = this.api.optionsApi.getColumnFilterOptions().isRowFilterable;
724
762
  for (const columnFilter of columnFilters) {
725
- const evaluateFilterOnClient = this.api.expressionApi.internalApi.evaluatePredicatesInAdaptableQL('ColumnFilter', columnFilter, [columnFilter.Predicate]);
726
- if (evaluateFilterOnClient) {
727
- // we then assess filters (if running locally)
728
- if (typeof isRowFiltrable === 'function' &&
729
- !isRowFiltrable(Object.assign(Object.assign({}, createBaseContext(this.api)), { rowNode: node, data: node.data }))) {
730
- return true;
731
- }
732
- if (!this.api.columnFilterApi.internalApi.evaluateColumnFilter(columnFilter, node)) {
763
+ const evaluateColumnFilterOnClient = this.api.expressionApi.internalApi.evaluatePredicatesInAdaptableQL('ColumnFilter', columnFilter, columnFilter.Predicates);
764
+ if (evaluateColumnFilterOnClient) {
765
+ const columnFilterEvaluationResult = this.api.filterApi.columnFilterApi.internalApi.evaluateColumnFilter(columnFilter, node);
766
+ if (!columnFilterEvaluationResult) {
767
+ filteredOutPrimaryKeys.add(primaryKey);
733
768
  return false;
734
769
  }
735
770
  }
@@ -738,9 +773,16 @@ export class AdaptableAgGrid {
738
773
  }
739
774
  catch (ex) {
740
775
  this.logger.error(ex);
776
+ filteredOutPrimaryKeys.add(primaryKey);
741
777
  return false;
742
778
  }
743
- return original_doesExternalFilterPass ? original_doesExternalFilterPass(node) : true;
779
+ const result = original_doesExternalFilterPass
780
+ ? original_doesExternalFilterPass(node)
781
+ : true;
782
+ if (!result) {
783
+ filteredOutPrimaryKeys.add(primaryKey);
784
+ }
785
+ return result;
744
786
  };
745
787
  });
746
788
  /**
@@ -760,59 +802,16 @@ export class AdaptableAgGrid {
760
802
  return this.agGridMenuAdapter.buildContextMenu(params, original_getContextMenuItems);
761
803
  };
762
804
  });
763
- /**
764
- * `initialGroupOrderComparator
765
- */
766
- // Build the default group sort comparator - will get custom sort values (but not functions) in real time
767
- // TODO: if a custom 'aggFunc' property is defined (see setupColumnAggFunc()), it won't be evaluated
768
- if (this.getAgGridRowModelType(gridOptions) === 'clientSide' &&
769
- this.adaptableOptions.groupingOptions.autoOrderGroupedColumns) {
770
- this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'initialGroupOrderComparator', (original_initialGroupOrderComparator) => {
771
- if (original_initialGroupOrderComparator) {
772
- return original_initialGroupOrderComparator;
773
- }
774
- return (params) => {
775
- const { nodeA, nodeB } = params;
776
- const firstGroupedColumnId = this.agGridAdapter.getFirstGroupedColumn();
777
- if (firstGroupedColumnId) {
778
- const definedColumnComparator = this.api.columnApi.internalApi.getActiveColumnComparator(firstGroupedColumnId, this.api.customSortApi.getCustomSortForColumn(firstGroupedColumnId), this.api.customSortApi.internalApi.getCustomSortComparer(firstGroupedColumnId));
779
- if (definedColumnComparator) {
780
- return definedColumnComparator(nodeA.key, nodeB.key);
781
- }
782
- const sortOder = this.api.layoutApi.getCurrentLayoutColumnSort(firstGroupedColumnId);
783
- if (sortOder === 'Desc') {
784
- return nodeA.key > nodeB.key ? -1 : 1;
785
- }
786
- }
787
- // if no comparator available, just sort alphanumerically
788
- if (nodeA.key == nodeB.key) {
789
- return 0;
790
- }
791
- return nodeA.key < nodeB.key ? -1 : 1;
792
- };
793
- });
794
- /**
795
- * `autoSizeStrategy`
796
- *
797
- * This is needed here, even if we do auto sizing on FIRST_DATA_RENDERED.
798
- * Sometimes FIRST_DATA_RENDERED is triggered too early and autoSizing doesn't work initially
799
- * so we need this block
800
- */
801
- this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'autoSizeStrategy', (original_autoSizeStrategy) => {
802
- return this.shouldAutoSizeLayout()
803
- ? {
804
- type: 'fitCellContents',
805
- }
806
- : original_autoSizeStrategy;
807
- });
808
- }
809
805
  /**
810
806
  * `components`
811
807
  */
812
808
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'components', (original_components) => {
813
809
  const AdaptableToolPanel = getAdaptableToolPanelAgGridComponent(this);
814
810
  const components = original_components || {};
815
- const adaptableComponents = Object.assign(Object.assign({}, components), { AdaptableToolPanel });
811
+ const adaptableComponents = {
812
+ ...components,
813
+ AdaptableToolPanel,
814
+ };
816
815
  return adaptableComponents;
817
816
  });
818
817
  if (variant === 'react') {
@@ -828,7 +827,6 @@ export class AdaptableAgGrid {
828
827
  * `sidebar`
829
828
  */
830
829
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'sideBar', (original_sideBar) => {
831
- var _a, _b;
832
830
  if (!original_sideBar) {
833
831
  // lucky us, no sideBar is defined, so we don't have to do anything
834
832
  return original_sideBar;
@@ -851,7 +849,7 @@ export class AdaptableAgGrid {
851
849
  : toolPanelDef);
852
850
  };
853
851
  const isSideBarDefObject = (sidebarDef) => {
854
- return Array.isArray(sidebarDef === null || sidebarDef === void 0 ? void 0 : sidebarDef.toolPanels);
852
+ return Array.isArray(sidebarDef?.toolPanels);
855
853
  };
856
854
  let result;
857
855
  if (original_sideBar === true) {
@@ -891,45 +889,54 @@ export class AdaptableAgGrid {
891
889
  }
892
890
  // if it's fully-fledged SideBarDef, process its tool panel definitions
893
891
  else if (isSideBarDefObject(original_sideBar)) {
894
- if ((_a = original_sideBar.toolPanels) === null || _a === void 0 ? void 0 : _a.some((toolpanelDef) => typeof toolpanelDef !== 'string' &&
892
+ if (original_sideBar.toolPanels?.some((toolpanelDef) => typeof toolpanelDef !== 'string' &&
895
893
  toolpanelDef.id === GeneralConstants.ADAPTABLE_TOOLPANEL_ID &&
896
894
  !isAdaptableToolPanelHidden)) {
897
895
  // if there is an Adaptable SideBarDef, don't touch it as it may contain user-defined properties
898
896
  result = original_sideBar;
899
897
  }
900
898
  else {
901
- result = Object.assign(Object.assign({}, original_sideBar), { toolPanels: mapToolPanelDefs(original_sideBar.toolPanels) });
899
+ result = {
900
+ ...original_sideBar,
901
+ toolPanels: mapToolPanelDefs(original_sideBar.toolPanels),
902
+ };
902
903
  }
903
904
  }
904
905
  this.hasAdaptableToolPanel =
905
906
  isSideBarDefObject(result) &&
906
- ((_b = result.toolPanels) === null || _b === void 0 ? void 0 : _b.some((toolPanelDef) => typeof toolPanelDef !== 'string' &&
907
- toolPanelDef.id === GeneralConstants.ADAPTABLE_TOOLPANEL_ID));
907
+ result.toolPanels?.some((toolPanelDef) => typeof toolPanelDef !== 'string' &&
908
+ toolPanelDef.id === GeneralConstants.ADAPTABLE_TOOLPANEL_ID);
908
909
  return result;
909
910
  });
910
911
  /**
911
912
  * `statusBar`
912
913
  */
913
914
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'statusBar', (original_statusBar) => {
914
- var _a, _b;
915
- const statusPanels = (_b = ((_a = original_statusBar === null || original_statusBar === void 0 ? void 0 : original_statusBar.statusPanels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.map((statusPanel) => {
915
+ const statusPanels = (original_statusBar?.statusPanels ?? [])?.map((statusPanel) => {
916
916
  if (statusPanel.statusPanel === ADAPTABLE_STATUS_PANEL) {
917
917
  this.adaptableStatusPanelKeys.push(statusPanel.key);
918
918
  const context = {
919
919
  Key: statusPanel.key,
920
920
  };
921
- return Object.assign(Object.assign({}, statusPanel), { statusPanel: createAgStatusPanelComponent(AdaptableStatusBar, this, context) });
921
+ return {
922
+ ...statusPanel,
923
+ statusPanel: createAgStatusPanelComponent(AdaptableStatusBar, this, context),
924
+ };
922
925
  }
923
926
  return statusPanel;
924
927
  });
925
- return Object.assign(Object.assign({}, original_statusBar), { statusPanels });
928
+ return { ...original_statusBar, statusPanels };
926
929
  });
927
930
  /**
928
931
  * `getRowStyle`
929
932
  */
930
933
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'getRowStyle', (original_getRowStyle) => {
931
934
  return (params) => {
932
- const result = Object.assign(Object.assign(Object.assign({}, original_getRowStyle === null || original_getRowStyle === void 0 ? void 0 : original_getRowStyle(params)), this.api.gridApi.internalApi.getRowHighlightStyle(params)), this.api.gridApi.internalApi.getAlertRowStyle(params));
935
+ const result = {
936
+ ...original_getRowStyle?.(params),
937
+ ...this.api.gridApi.internalApi.getRowHighlightStyle(params),
938
+ ...this.api.gridApi.internalApi.getAlertRowStyle(params),
939
+ };
933
940
  return result;
934
941
  };
935
942
  });
@@ -950,15 +957,15 @@ export class AdaptableAgGrid {
950
957
  // we flatten it because 'original_getRowClass' might return a string[]
951
958
  .flat()
952
959
  .filter((x) => !!x);
953
- return (returnValue === null || returnValue === void 0 ? void 0 : returnValue.length) ? returnValue : undefined;
960
+ return returnValue?.length ? returnValue : undefined;
954
961
  };
955
962
  });
956
963
  /**
957
964
  * `floatingFiltersHeight`
958
965
  */
959
966
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'floatingFiltersHeight', (original_floatingFiltersHeight) => {
960
- if (this.api.layoutApi.getCurrentLayout().EnablePivot) {
961
- // if the default layout is a pivot on, hide the floating filters from the beginning, otherwise we get an annoying flicker
967
+ if (this.api.layoutApi.isCurrentLayoutPivot()) {
968
+ // if Current Layout is Pivot, hide the floating filters from the beginning, otherwise we get an annoying flicker
962
969
  return 0;
963
970
  }
964
971
  return original_floatingFiltersHeight;
@@ -967,21 +974,30 @@ export class AdaptableAgGrid {
967
974
  * `excelStyles`
968
975
  */
969
976
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'excelStyles', (original_excelStyles) => {
970
- this.originalExcelStyles = original_excelStyles !== null && original_excelStyles !== void 0 ? original_excelStyles : [];
971
- this.DANGER_excelStyles = this.originalExcelStyles;
977
+ const excelStyles = original_excelStyles || [];
978
+ // see ##masterDetailHeader
979
+ excelStyles.push({
980
+ id: '_masterDetailHeader',
981
+ interior: {
982
+ color: '#aaaaaa',
983
+ pattern: 'Solid',
984
+ },
985
+ });
986
+ this.agGridExportAdapter.originalExcelStyles = excelStyles;
987
+ this.agGridExportAdapter.DANGER_excelStyles = this.agGridExportAdapter.originalExcelStyles;
972
988
  // this array reference will be used for the entire AG Grid session
973
- return this.DANGER_excelStyles;
989
+ return this.agGridExportAdapter.DANGER_excelStyles;
974
990
  });
975
991
  /**
976
992
  * `processPivotResultColDef`
977
993
  */
978
994
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'processPivotResultColDef', (original_processPivotResultColDef) => {
979
995
  return (colDef) => {
980
- if (this.adaptableOptions.columnFilterOptions.useAdaptableColumnFiltering) {
996
+ if (this.adaptableOptions.filterOptions.useAdaptableFiltering) {
981
997
  colDef.floatingFilter = false;
982
998
  colDef.filter = false;
983
999
  }
984
- original_processPivotResultColDef === null || original_processPivotResultColDef === void 0 ? void 0 : original_processPivotResultColDef(colDef);
1000
+ original_processPivotResultColDef?.(colDef);
985
1001
  };
986
1002
  });
987
1003
  /**
@@ -997,80 +1013,34 @@ export class AdaptableAgGrid {
997
1013
  */
998
1014
  // this will have to go/be heavily extended with https://github.com/AdaptableTools/adaptable/issues/2230
999
1015
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'columnTypes', (original_columnTypes) => {
1000
- var _a;
1001
1016
  const providedColumnTypes = original_columnTypes || {};
1002
- const gridOptionsColumnTypes = gridOptions.columnTypes || {};
1003
- const patchedColumnTypes = Object.assign({}, providedColumnTypes, {
1004
- [AB_SPECIAL_COLUMN]: {},
1005
- [AB_FDC3_COLUMN]: {},
1006
- abColDefNumber: Object.assign({}, gridOptionsColumnTypes.abColDefNumber),
1007
- abColDefString: Object.assign({}, gridOptionsColumnTypes.abColDefString),
1008
- abColDefBoolean: Object.assign({}, gridOptionsColumnTypes.abColDefBoolean),
1009
- abColDefDate: Object.assign({}, gridOptionsColumnTypes.abColDefDate),
1010
- abColDefObject: Object.assign({}, gridOptionsColumnTypes.abColDefObject),
1011
- abColDefCustom: Object.assign({}, gridOptionsColumnTypes.abColDefCustom),
1012
- abColDefStringArray: Object.assign({}, gridOptionsColumnTypes.abColDefStringArray),
1013
- abColDefNumberArray: Object.assign({}, gridOptionsColumnTypes.abColDefNumberArray),
1014
- abColDefTupleNumberArray: Object.assign({}, gridOptionsColumnTypes.abColDefTupleNumberArray),
1015
- abColDefObjectNumberArray: Object.assign({}, gridOptionsColumnTypes.abColDefObjectNumberArray),
1016
- });
1017
- const customColumnTypes = (_a = this.api.columnApi.getColumnTypes()) !== null && _a !== void 0 ? _a : [];
1017
+ const adaptableColumnTypes = {
1018
+ [CALCULATED_COLUMN_TYPE]: {},
1019
+ [FREE_TEXT_COLUMN_TYPE]: {},
1020
+ [ACTION_COLUMN_TYPE]: {},
1021
+ [FDC3_COLUMN_TYPE]: {},
1022
+ };
1023
+ const patchedColumnTypes = Object.assign({}, providedColumnTypes, adaptableColumnTypes);
1024
+ const customColumnTypes = this.api.columnApi.getColumnTypes() ?? [];
1018
1025
  for (const customColumnType of customColumnTypes) {
1019
1026
  if (!patchedColumnTypes[customColumnType]) {
1020
1027
  patchedColumnTypes[customColumnType] = {};
1021
1028
  }
1022
1029
  }
1023
- const colTypesToEditors = getEditorsForColumnTypes(this.variant);
1024
- // we used to patch here the column types
1025
- // and have the editors for abColDefNumber and abColDefDate set here
1026
- // but AG Grid seems to have a bug where if we have a custom editor
1027
- // for a specific number column, it's applied to all abColDefNumber columns, because they
1028
- // share the same column type
1029
- // so we're now doing this logic in AgGridColumnAdaptapter.setupColumnCellEditor
1030
- // and instead, here we're just assigning the editor to null
1031
- // because if we don't assign to null, the default that AG Grid provides
1032
- // will be used instead, and we don't want that for those column types
1033
- Object.keys(colTypesToEditors).forEach((colType) => {
1034
- if (patchedColumnTypes[colType].cellEditor == undefined) {
1035
- patchedColumnTypes[colType].cellEditor = null; // colTypesToEditors[colType];
1036
- // if you dont believe me, just put colTypesToEditors[colType] in the line above instead of the null value
1037
- // and see the editing/percentage-editor.spec.ts test fail as it wont be using the correct editor
1038
- }
1039
- });
1040
1030
  return patchedColumnTypes;
1041
1031
  });
1042
1032
  /**
1043
1033
  * `dataTypeDefinitions`
1044
1034
  */
1045
1035
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'dataTypeDefinitions', () => {
1046
- // temporary workaround until https://github.com/AdaptableTools/adaptable/issues/2230
1047
- const revertedDateTypeDefinitions = {
1048
- date: {
1049
- baseDataType: 'date',
1050
- extendsDataType: 'date',
1051
- valueParser: null,
1052
- valueFormatter: null,
1053
- suppressDefaultProperties: true,
1054
- },
1055
- dateString: {
1056
- baseDataType: 'dateString',
1057
- extendsDataType: 'dateString',
1058
- valueParser: null,
1059
- valueFormatter: null,
1060
- suppressDefaultProperties: true,
1061
- },
1062
- };
1036
+ const revertedDateTypeDefinitions = agGridDataTypeDefinitions;
1063
1037
  return revertedDateTypeDefinitions;
1064
1038
  });
1065
1039
  }
1066
- isDetailGrid() {
1067
- return this._isDetailGrid;
1068
- }
1069
1040
  /**
1070
1041
  * Either initializes the AG Grid instance or delegates it to the framework wrappers (React/Anglar)
1071
1042
  */
1072
1043
  async initializeAgGrid(gridOptions, modules, renderAgGridFrameworkComponent) {
1073
- var _a;
1074
1044
  if (renderAgGridFrameworkComponent) {
1075
1045
  const result = await renderAgGridFrameworkComponent(gridOptions);
1076
1046
  if (result === false) {
@@ -1092,9 +1062,8 @@ export class AdaptableAgGrid {
1092
1062
  }
1093
1063
  if (!this.getAgGridContainerElement()) {
1094
1064
  // initialize the agGridContainerElement from the AgGrid instance
1095
- // @ts-ignore
1096
- const gridRoot = (_a = this.DANGER_getPrivateAgGridBeans()) === null || _a === void 0 ? void 0 : _a.eGridDiv;
1097
- const gridContainer = gridRoot === null || gridRoot === void 0 ? void 0 : gridRoot.closest('[class*="ag-theme"]');
1065
+ const gridRoot = this.agGridAdapter.getAgGridRootElement();
1066
+ const gridContainer = gridRoot?.closest('[class*="ag-theme"]');
1098
1067
  if (!gridContainer) {
1099
1068
  this.logger.consoleError(`No AG Grid container could be derived from the Adaptable framework wrapper.
1100
1069
  Please contact AdapTable Support and in the meantime provide a valid container element in 'ContainerOptions.agGridContainer'!`);
@@ -1109,108 +1078,33 @@ export class AdaptableAgGrid {
1109
1078
  return Promise.resolve(false);
1110
1079
  }
1111
1080
  let gridParams;
1112
- if (modules === null || modules === void 0 ? void 0 : modules.length) {
1081
+ if (modules?.length) {
1113
1082
  gridParams = { modules };
1114
1083
  }
1115
1084
  const agGridApi = createGrid(agGridContainer, gridOptions, gridParams);
1116
1085
  return agGridApi;
1117
1086
  }
1118
- getColumnDefinitionsInclSpecialColumns(agGridColDefs) {
1119
- const allColDefs = this.enhanceColDefsWithSpecialColumns(agGridColDefs !== null && agGridColDefs !== void 0 ? agGridColDefs : this.agGridAdapter.getAgGridApi().getColumnDefs());
1120
- return allColDefs;
1121
- }
1122
- getSpecialColDefs() {
1123
- const specialColDefs = [
1124
- ...this.api.calculatedColumnApi.internalApi.getColDefsForCalculatedColumns(),
1125
- ...this.api.actionColumnApi.getColDefsForActionColumns(),
1126
- ...this.api.freeTextColumnApi.internalApi.getColDefsForFreeTextColumns(),
1127
- ...this.api.actionRowApi.internalApi.getColDefsForActionRowColumns(),
1128
- ...this.api.fdc3Api.internalApi.getFdc3ActionColDefs(),
1129
- ];
1130
- this.agGridAdapter.assignColumnIdsToColDefs(specialColDefs);
1131
- return specialColDefs;
1132
- }
1133
- enhanceColDefsWithSpecialColumns(agGridColDefs) {
1134
- this.agGridAdapter.assignColumnIdsToColDefs(agGridColDefs);
1135
- const specialColDefs = this.getSpecialColDefs();
1136
- const isSpecialColDef = (colDef) => {
1137
- const { type } = colDef;
1138
- if (type === AB_SPECIAL_COLUMN || (Array.isArray(type) && type.includes(AB_SPECIAL_COLUMN))) {
1139
- return true;
1140
- }
1141
- return false;
1142
- };
1143
- const processedSpecialColDefIds = [];
1144
- const mapColDefs = (colDefs) => {
1145
- return colDefs.map((colDef) => {
1146
- if (this.agGridColumnAdapter.isColGroupDef(colDef)) {
1147
- // if it's a group column, recursively map its children
1148
- colDef.children = mapColDefs(colDef.children);
1149
- return colDef;
1150
- }
1151
- else {
1152
- if (!isSpecialColDef(colDef)) {
1153
- // if it's not a special column, return it as is
1154
- // without a minWidth, columns in details grid are VERY wide
1155
- // so the line below fixes https://github.com/AdaptableTools/adaptable/issues/2559
1156
- return Object.assign({ minWidth: 10 }, colDef);
1157
- }
1158
- const newlyCreatedSpecialColDef = specialColDefs.find((specialColDef) => specialColDef.colId === colDef.colId);
1159
- if (newlyCreatedSpecialColDef) {
1160
- // if it's a special column and we have a special col def for it, return the special col def
1161
- processedSpecialColDefIds.push(colDef.colId);
1162
- // merge the user defined colDef with the special col def
1163
- // this way the user may provide some custom settings for the special col def (tooltip, etc)
1164
- const mergedColDef = Object.assign(Object.assign({
1165
- // see above comment for minWidth
1166
- minWidth: 10 }, colDef), newlyCreatedSpecialColDef);
1167
- return mergedColDef;
1168
- }
1169
- else {
1170
- // otherwise, return the original col def
1171
- return colDef;
1172
- }
1173
- }
1174
- });
1175
- };
1176
- let resultColDefs = mapColDefs(agGridColDefs);
1177
- // check if there are any special colDefs that were not processed
1178
- // in that case, add them to the end of the colDefs
1179
- specialColDefs.forEach((specialColDef) => {
1180
- if (!processedSpecialColDefIds.includes(specialColDef.colId)) {
1181
- resultColDefs.push(specialColDef);
1182
- }
1183
- });
1184
- // remove special column that are no longer defined
1185
- resultColDefs = resultColDefs.filter((colDef) => {
1186
- if (isSpecialColDef(colDef)) {
1187
- // must be in specialColDefs
1188
- return specialColDefs.some((specialColDef) => specialColDef.colId === colDef.colId);
1189
- }
1190
- return true;
1191
- });
1192
- return resultColDefs;
1193
- }
1194
1087
  useRowNodeLookUp() {
1195
1088
  return this.agGridAdapter.getAgGridApi().getGridOption('getRowId') != undefined;
1196
1089
  }
1090
+ getAgGridRegisteredModules() {
1091
+ return this.agGridAdapter.getAgGridRegisteredModules();
1092
+ }
1197
1093
  getAgGridContainerElement() {
1198
- var _a, _b, _c, _d, _e, _f;
1199
1094
  if (!this.DANGER_USE_GETTER_agGridContainerElement) {
1200
1095
  this.DANGER_USE_GETTER_agGridContainerElement =
1201
- typeof ((_b = (_a = this.adaptableOptions) === null || _a === void 0 ? void 0 : _a.containerOptions) === null || _b === void 0 ? void 0 : _b.agGridContainer) === 'string'
1202
- ? document.getElementById((_d = (_c = this.adaptableOptions) === null || _c === void 0 ? void 0 : _c.containerOptions) === null || _d === void 0 ? void 0 : _d.agGridContainer)
1203
- : (_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.containerOptions) === null || _f === void 0 ? void 0 : _f.agGridContainer;
1096
+ typeof this.adaptableOptions?.containerOptions?.agGridContainer === 'string'
1097
+ ? document.getElementById(this.adaptableOptions?.containerOptions?.agGridContainer)
1098
+ : this.adaptableOptions?.containerOptions?.agGridContainer;
1204
1099
  }
1205
1100
  return this.DANGER_USE_GETTER_agGridContainerElement;
1206
1101
  }
1207
1102
  getAdaptableContainerElement() {
1208
- var _a, _b, _c, _d, _e, _f;
1209
1103
  if (!this.DANGER_USE_GETTER_adaptableContainerElement) {
1210
1104
  this.DANGER_USE_GETTER_adaptableContainerElement =
1211
- typeof ((_b = (_a = this.adaptableOptions) === null || _a === void 0 ? void 0 : _a.containerOptions) === null || _b === void 0 ? void 0 : _b.adaptableContainer) === 'string'
1212
- ? document.getElementById((_d = (_c = this.adaptableOptions) === null || _c === void 0 ? void 0 : _c.containerOptions) === null || _d === void 0 ? void 0 : _d.adaptableContainer)
1213
- : (_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.containerOptions) === null || _f === void 0 ? void 0 : _f.adaptableContainer;
1105
+ typeof this.adaptableOptions?.containerOptions?.adaptableContainer === 'string'
1106
+ ? document.getElementById(this.adaptableOptions?.containerOptions?.adaptableContainer)
1107
+ : this.adaptableOptions?.containerOptions?.adaptableContainer;
1214
1108
  }
1215
1109
  return this.DANGER_USE_GETTER_adaptableContainerElement;
1216
1110
  }
@@ -1223,7 +1117,10 @@ export class AdaptableAgGrid {
1223
1117
  const selectedCellInfo = this.agGridAdapter.deriveSelectedCellInfoFromAgGrid();
1224
1118
  this.api.gridApi.internalApi.setSelectedCells(selectedCellInfo);
1225
1119
  this._emit('CellsSelected');
1226
- let cellSelectionChangedInfo = Object.assign(Object.assign({}, this.api.internalApi.buildBaseContext()), { selectedCellInfo: this.api.gridApi.getGridState().SelectedCellInfo });
1120
+ let cellSelectionChangedInfo = {
1121
+ ...this.api.internalApi.buildBaseContext(),
1122
+ selectedCellInfo: this.api.gridApi.getInternalState().SelectedCellInfo,
1123
+ };
1227
1124
  this.api.eventApi.emit('CellSelectionChanged', cellSelectionChangedInfo);
1228
1125
  return selectedCellInfo;
1229
1126
  }
@@ -1233,7 +1130,10 @@ export class AdaptableAgGrid {
1233
1130
  }
1234
1131
  const selectedRowInfo = this.agGridAdapter.deriveSelectedRowInfoFromAgGrid();
1235
1132
  this.api.gridApi.internalApi.setSelectedRows(selectedRowInfo);
1236
- const rowSelectionChangedInfo = Object.assign(Object.assign({}, this.api.internalApi.buildBaseContext()), { selectedRowInfo: this.api.gridApi.getGridState().SelectedRowInfo });
1133
+ const rowSelectionChangedInfo = {
1134
+ ...this.api.internalApi.buildBaseContext(),
1135
+ selectedRowInfo: this.api.gridApi.getInternalState().SelectedRowInfo,
1136
+ };
1237
1137
  this.api.eventApi.emit('RowSelectionChanged', rowSelectionChangedInfo);
1238
1138
  return selectedRowInfo;
1239
1139
  }
@@ -1251,7 +1151,7 @@ export class AdaptableAgGrid {
1251
1151
  return false;
1252
1152
  }
1253
1153
  isGridRangeSelectable() {
1254
- return (this.agGridAdapter.isModulePresent(ModuleNames.RangeSelectionModule) &&
1154
+ return (this.agGridAdapter.isAgGridModuleRegistered('CellSelection') &&
1255
1155
  (this.agGridAdapter.getGridOption('enableRangeSelection') ||
1256
1156
  !!this.agGridAdapter.getGridOption('cellSelection')));
1257
1157
  }
@@ -1259,114 +1159,34 @@ export class AdaptableAgGrid {
1259
1159
  const perfNewAdaptableStore = this.logger.beginPerf(`initAdaptableStore()`);
1260
1160
  const adaptableStore = new AdaptableStore(this);
1261
1161
  adaptableStore.onAny((eventName, data) => {
1262
- this.performAudit(data.action, data.state, data.newState);
1162
+ if (this.isReady) {
1163
+ this.api.eventApi.internalApi.fireAdaptableStateChangedEvent(data.action, data.state, data.newState);
1164
+ }
1263
1165
  this.forPlugins((plugin) => plugin.onStoreEvent(eventName, data, this.adaptableStore));
1264
1166
  });
1265
1167
  perfNewAdaptableStore.end();
1266
1168
  return adaptableStore;
1267
1169
  }
1268
- mapAdaptableStateToAgGridState(adaptableState, agGridColDefs) {
1269
- var _a, _b, _c;
1270
- const agGridState = {};
1271
- const currentLayoutName = (_a = adaptableState.Layout) === null || _a === void 0 ? void 0 : _a.CurrentLayout;
1272
- const _currentLayout = currentLayoutName &&
1273
- ((_c = (_b = adaptableState.Layout) === null || _b === void 0 ? void 0 : _b.Layouts) === null || _c === void 0 ? void 0 : _c.find((l) => l.Name === currentLayoutName));
1274
- if (!_currentLayout) {
1275
- return agGridState;
1276
- }
1277
- const currentLayout = removeUuidAndSource(_currentLayout);
1278
- const allAgGridFlattenedColDefs = this.agGridAdapter.getFlattenedColDefs(agGridColDefs);
1279
- const allAgGridColDefIds = allAgGridFlattenedColDefs.map((colDef) => colDef.colId);
1280
- const { columnApi } = this.api;
1281
- // also add the row group columns, if they are specified in the layout
1282
- currentLayout.Columns.forEach((colId) => {
1283
- if (columnApi.isAutoRowGroupColumn(colId)) {
1284
- allAgGridColDefIds.push(colId);
1285
- }
1286
- });
1287
- const getColDef = (colId) => allAgGridFlattenedColDefs.find((colDef) => colDef.colId === colId);
1288
- agGridState.columnVisibility = {
1289
- hiddenColIds: allAgGridFlattenedColDefs
1290
- .filter((colDef) => { var _a; return !((_a = currentLayout.Columns) === null || _a === void 0 ? void 0 : _a.includes(colDef.colId)) || colDef.hide || colDef.initialHide; })
1291
- .map((colDef) => colDef.colId),
1292
- };
1293
- agGridState.columnOrder = {
1294
- orderedColIds: ArrayExtensions.sortArrayWithOrder(allAgGridColDefIds, currentLayout.Columns || [], {
1295
- sortUnorderedItems: false,
1296
- }),
1297
- };
1298
- if (currentLayout.ColumnWidthMap) {
1299
- agGridState.columnSizing = {
1300
- columnSizingModel: Object.keys(currentLayout.ColumnWidthMap).map((colId) => {
1301
- const width = currentLayout.ColumnWidthMap[colId];
1302
- return {
1303
- colId,
1304
- width,
1305
- };
1306
- }),
1307
- };
1308
- }
1309
- if (currentLayout.ColumnSorts) {
1310
- agGridState.sort = {
1311
- sortModel: currentLayout.ColumnSorts.map((columnSort) => {
1312
- return {
1313
- colId: columnSort.ColumnId,
1314
- sort: columnSort.SortOrder === 'Asc' ? 'asc' : 'desc',
1315
- };
1316
- }),
1317
- };
1318
- }
1319
- if (currentLayout.RowGroupedColumns) {
1320
- agGridState.rowGroup = {
1321
- groupColIds: currentLayout.RowGroupedColumns,
1322
- };
1323
- }
1324
- if (currentLayout.AggregationColumns) {
1325
- agGridState.aggregation = {
1326
- aggregationModel: Object.keys(currentLayout.AggregationColumns).map((colId) => {
1327
- let aggFunc = currentLayout.AggregationColumns[colId];
1328
- if (aggFunc === true) {
1329
- const colDef = getColDef(colId);
1330
- // fallback to SUM if no defaultAggFunc is defined
1331
- aggFunc = (colDef === null || colDef === void 0 ? void 0 : colDef.defaultAggFunc) || 'sum';
1332
- }
1333
- if (isWeightedAverageAggregation(aggFunc)) {
1334
- aggFunc = WEIGHTED_AVERAGE_AGG_FN_NAME;
1335
- }
1336
- return {
1337
- colId,
1338
- aggFunc,
1339
- };
1340
- }),
1341
- };
1342
- }
1343
- if (currentLayout.PivotColumns || currentLayout.EnablePivot) {
1344
- agGridState.pivot = {
1345
- pivotMode: currentLayout.EnablePivot,
1346
- pivotColIds: currentLayout.PivotColumns || [],
1347
- };
1348
- }
1349
- if (currentLayout.PinnedColumnsMap) {
1350
- const columnPinning = {
1351
- leftColIds: [],
1352
- rightColIds: [],
1353
- };
1354
- Object.keys(currentLayout.PinnedColumnsMap).forEach((colId) => {
1355
- const pinned = currentLayout.PinnedColumnsMap[colId];
1356
- if (pinned === 'left') {
1357
- columnPinning.leftColIds.push(colId);
1358
- }
1359
- else if (pinned === 'right') {
1360
- columnPinning.rightColIds.push(colId);
1361
- }
1362
- });
1363
- agGridState.columnPinning = columnPinning;
1170
+ mapAdaptableStateToAgGridState(adaptableState, agGridColDefs, options) {
1171
+ const currentLayoutName = adaptableState.Layout?.CurrentLayout;
1172
+ let currentLayout = currentLayoutName &&
1173
+ adaptableState.Layout?.Layouts?.find((l) => l.Name === currentLayoutName);
1174
+ if (!currentLayout) {
1175
+ currentLayout = ERROR_LAYOUT;
1364
1176
  }
1365
- return agGridState;
1177
+ const layoutModel = layoutStateToLayoutModel(currentLayout);
1178
+ return {
1179
+ gridState: LayoutManager.getAGGridInitialStateForLayout(layoutModel, agGridColDefs, options),
1180
+ currentLayout: currentLayout,
1181
+ layoutModel,
1182
+ };
1366
1183
  }
1367
1184
  addGridEventListeners() {
1368
1185
  /**
1369
- * Intercept DOM events and emit them as Adaptable events
1186
+ * Intercept 3 DOM events and emit them as Adaptable events:
1187
+ * KeyDown
1188
+ * MouseEnter
1189
+ * MouseLeave
1370
1190
  */
1371
1191
  const gridContainerElement = this.getAgGridContainerElement();
1372
1192
  if (gridContainerElement) {
@@ -1379,80 +1199,33 @@ export class AdaptableAgGrid {
1379
1199
  }), true);
1380
1200
  gridContainerElement.addEventListener('mouseleave', (this.agGridListenerMouseLeave = (event) => this._emit('MouseLeave', event)));
1381
1201
  }
1382
- this.throttleFilterOnEditDataChange = throttle(
1202
+ this.throttleFilterOnDataChange = throttle(
1383
1203
  // the extra function is to make sure we have a reference to ag-grid-api
1384
- () => { var _a; return (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.onFilterChanged(); }, this.adaptableOptions.columnFilterOptions.filterActionOnUserDataChange.throttleDelay, {
1385
- trailing: true,
1386
- leading: false,
1387
- });
1388
- this.throttleFilterOnTickingDataChange = throttle(() => { var _a; return (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.onFilterChanged(); }, this.adaptableOptions.columnFilterOptions.filterActionOnExternalDataChange.throttleDelay, {
1204
+ () => this.agGridAdapter.getAgGridApi()?.onFilterChanged(), this.adaptableOptions.filterOptions.filterActionOnDataChange.throttleDelay, {
1389
1205
  trailing: true,
1390
1206
  leading: false,
1391
1207
  });
1392
1208
  /**
1393
- * Use Case: AG Grid columns have changed
1394
- * Action: Set Columns in store and filter grid
1395
- */
1396
- this.debouncedSetColumnIntoStore = debounce(() => {
1397
- if (!this.isReady) {
1398
- return;
1399
- }
1400
- this.deriveAdaptableColumnStateFromAgGrid();
1401
- }, HALF_SECOND);
1402
- const columnEventsThatTriggersStateChange = [
1403
- 'columnMoved',
1404
- 'gridColumnsChanged',
1405
- 'displayedColumnsChanged',
1406
- 'columnVisible',
1407
- 'newColumnsLoaded',
1408
- ];
1409
- this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalColumnEventsThatTriggerStateChange = (type) => {
1410
- if (columnEventsThatTriggersStateChange.indexOf(type) > -1) {
1411
- this.debouncedSetColumnIntoStore();
1412
- }
1413
- }));
1414
- /**
1415
- * Use Case: User has started inline editing but its distabled in Action Row Options
1209
+ * Use Case: User has started inline editing but its disabled in Row Form Options
1416
1210
  * Action: Stop editing
1417
1211
  */
1418
1212
  this.agGridAdapter.getAgGridApi().addEventListener('cellEditingStarted', (this.listenerCellEditingStarted = () => {
1419
- var _a;
1420
- if ((_a = this.adaptableOptions.actionRowOptions) === null || _a === void 0 ? void 0 : _a.disableInlineEditing)
1213
+ if (this.adaptableOptions.rowFormOptions.disableInlineEditing)
1421
1214
  this.agGridAdapter.getAgGridApi().stopEditing();
1422
1215
  }));
1423
1216
  /**
1424
- * Use Case: initial data has been displayed in grid
1425
- * Action1: Set the Layout
1426
- * Action2: Ensure that we have set column data types
1427
- * Note: Deals with scenario where the data is provided to AdapTable after grid has been setup
1217
+ * Use Case: Grid was already set up and now the initial data has been displayed
1218
+ * Action1: Update the Column Model
1219
+ * Action2: Refresh Calculated Columns
1428
1220
  */
1429
1221
  this.agGridAdapter.getAgGridApi().addEventListener('firstDataRendered', (this.listenerFirstDataRendered = () => {
1430
1222
  if (this.initWithLazyData) {
1431
- this.updateColumnModelAndRefreshGrid({ skipColDefsRefresh: true });
1223
+ this.updateColumnModelAndRefreshGrid();
1432
1224
  this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
1433
1225
  this._emit('FirstDataRendered');
1434
1226
  }
1435
1227
  this.autoSizeLayoutIfNeeded();
1436
1228
  }));
1437
- /**
1438
- * Use Case: Entered or Left Pivot Mode
1439
- * Action 1: Autosize pivot columns when entering pivot mode (if autosize pivot in Layout is true)
1440
- * Action 2: Set pivot mode on / off in api as necessary
1441
- */
1442
- this.agGridAdapter.getAgGridApi().addEventListener('columnPivotModeChanged', (this.listenerPivotModeChanged = (params) => {
1443
- if (params.type == 'columnPivotModeChanged' &&
1444
- params.columnApi != null &&
1445
- params.columnApi.columnController != null &&
1446
- params.columnApi.columnController.pivotMode == true) {
1447
- if (this.adaptableOptions.layoutOptions.autoSizeColumnsInPivotLayout == true) {
1448
- this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
1449
- }
1450
- this.api.internalApi.setPivotModeOn();
1451
- }
1452
- else {
1453
- this.api.internalApi.setPivotModeOff();
1454
- }
1455
- }));
1456
1229
  /**
1457
1230
  * Use Case: A pivot column has changed
1458
1231
  * Action: Autosize pivot columns (if autosize pivot in Layout is true)
@@ -1462,77 +1235,14 @@ export class AdaptableAgGrid {
1462
1235
  params.columnApi != null &&
1463
1236
  params.columnApi.columnController != null &&
1464
1237
  params.columnApi.columnController.pivotMode == true) {
1465
- if (this.adaptableOptions.layoutOptions.autoSizeColumnsInPivotLayout == true) {
1238
+ if (this.api.layoutApi.getCurrentLayout().AutoSizeColumns) {
1466
1239
  this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
1467
1240
  }
1468
1241
  }
1469
1242
  }));
1470
1243
  /**
1471
- * Use Case: Things have changed in the grid that require the Layout to be saved
1472
- * Action: Save the Layout (on a debounce)
1473
- */
1474
- const columnEventsThatTriggersAutoLayoutSave = [
1475
- 'columnPinned',
1476
- 'columnPivotChanged',
1477
- 'columnPivotModeChanged',
1478
- 'displayedColumnsChanged',
1479
- 'sortChanged',
1480
- 'columnRowGroupChanged',
1481
- 'columnValueChanged',
1482
- ];
1483
- // ADD filter event
1484
- this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalColumnEventsThatTriggerAutoLayoutSave = (type) => {
1485
- if (columnEventsThatTriggersAutoLayoutSave.indexOf(type) > -1) {
1486
- this.debouncedSaveGridLayout(type);
1487
- }
1488
- }));
1489
- /**
1490
- * Save Layout if Display Row Groups is "dynamic
1491
- */
1492
- this.debouncedSaveGridLayout = debounce((type) => {
1493
- if (!this.isReady) {
1494
- return;
1495
- }
1496
- this.logger.info('Event Triggering Auto Layout Save', type || '');
1497
- this.updateLayoutFromGrid();
1498
- }, HALF_SECOND);
1499
- const rowGroupEventsThatTriggersAutoLayoutSave = [
1500
- 'rowGroupOpened',
1501
- 'expandOrCollapseAll',
1502
- ];
1503
- this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = (type) => {
1504
- if (rowGroupEventsThatTriggersAutoLayoutSave.indexOf(type) > -1) {
1505
- if (this.adaptableOptions.layoutOptions.displayRowGroups == 'dynamic') {
1506
- this.debouncedSaveGridLayout(type);
1507
- }
1508
- }
1509
- }));
1510
- /**
1511
- * Use Case: Column Row Grouping changes and 'restoreUngroupedColumns' is true
1512
- * Action: Make the column invisiblel
1513
- */
1514
- this.agGridAdapter.getAgGridApi().addEventListener('columnRowGroupChanged', (this.listenerColumnRowGroupChanged = (params) => {
1515
- var _a, _b;
1516
- if (this.api.internalApi.isGridInPivotMode()) {
1517
- return;
1518
- }
1519
- if ((_b = (_a = this.adaptableOptions) === null || _a === void 0 ? void 0 : _a.groupingOptions) === null || _b === void 0 ? void 0 : _b.restoreUngroupedColumns) {
1520
- this.persistColumnIndexBeforeGrouping(params);
1521
- }
1522
- }));
1523
- /**
1524
- * Use Case: A Column has finished being resized
1525
- * Action 1: Save the Layout (on a debounce)
1526
- * Action 2: Emit the internal ColumnResized event - used by Sparkline Column (in Charts)
1527
- */
1528
- this.agGridAdapter.getAgGridApi().addEventListener('columnResized', (this.listenerColumnResized = (params) => {
1529
- if (params.finished == true && params.type == 'columnResized' && params.column) {
1530
- this.debouncedSaveGridLayout(params.type);
1531
- }
1532
- }));
1533
- /**
1534
- * Use Case: Row Selection has changed
1535
- * Action: Set Selected Rows (on a debeounce)
1244
+ * Use Case: User has selected Rows or opened a Row Group
1245
+ * Action: Set Selected Rows (on a debounce of 500ms)
1536
1246
  */
1537
1247
  this.debouncedSetSelectedRows = debounce(() => {
1538
1248
  if (!this.isReady) {
@@ -1552,14 +1262,14 @@ export class AdaptableAgGrid {
1552
1262
  }));
1553
1263
  /**
1554
1264
  * Use Case: User has selected a range of cells
1555
- * Action: Set Selected Cells (on a debounce)
1265
+ * Action: Set Selected Cells (on a debounce of 250ms)
1556
1266
  */
1557
1267
  this.debouncedSetSelectedCells = debounce(() => {
1558
1268
  if (!this.isReady) {
1559
1269
  return;
1560
1270
  }
1561
1271
  this.refreshSelectedCellsState();
1562
- }, 250);
1272
+ }, QUARTER_SECOND);
1563
1273
  this.agGridAdapter.getAgGridApi().addEventListener('cellSelectionChanged', (this.listenerCellSelectionChanged = (params) => {
1564
1274
  if (params.finished == true) {
1565
1275
  this.debouncedSetSelectedCells();
@@ -1567,20 +1277,21 @@ export class AdaptableAgGrid {
1567
1277
  }));
1568
1278
  /**
1569
1279
  * Use Case: Sort has changed in the Grid
1570
- * Action1: Update AdapTable Sort Info
1280
+ * Action1: Fire the Grid Sorted Event
1571
1281
  * Action2: Set Selected Cells (on a debounce)
1572
1282
  */
1573
1283
  this.agGridAdapter.getAgGridApi().addEventListener('sortChanged', (this.listenerSortChanged = () => {
1574
- this.onSortChanged();
1284
+ this.api.eventApi.internalApi.fireGridSortedEvent();
1575
1285
  this.debouncedSetSelectedCells();
1576
1286
  }));
1287
+ /**
1288
+ * Use Case: Charts have been created or destroyed, Chart ranges selected or Chart options changed
1289
+ * Action: Call onChartModelChange in Charting Service
1290
+ */
1577
1291
  const eventsThatTriggerChartingChanges = [
1578
1292
  'chartCreated',
1579
- /** Chart Range selection has changed */
1580
1293
  'chartRangeSelectionChanged',
1581
- /** Chart Options have changed */
1582
1294
  'chartOptionsChanged',
1583
- /** Chart was destroyed */
1584
1295
  'chartDestroyed',
1585
1296
  ];
1586
1297
  const chartingModule = this.ModuleService.getModuleById('Charting');
@@ -1617,32 +1328,21 @@ export class AdaptableAgGrid {
1617
1328
  }
1618
1329
  shouldAutoSizeLayout() {
1619
1330
  const { layoutApi } = this.api;
1620
- const { layoutOptions } = this.adaptableOptions;
1621
1331
  const currentLayout = layoutApi.getCurrentLayout();
1622
- if (currentLayout.ColumnWidthMap && Object.keys(currentLayout.ColumnWidthMap).length > 0) {
1332
+ if (currentLayout.ColumnWidths && Object.keys(currentLayout.ColumnWidths).length > 0) {
1623
1333
  return;
1624
1334
  }
1625
- const autoSize = currentLayout.EnablePivot
1626
- ? layoutOptions.autoSizeColumnsInPivotLayout
1627
- : layoutOptions.autoSizeColumnsInLayout;
1628
- return autoSize;
1335
+ return currentLayout.AutoSizeColumns;
1629
1336
  }
1630
1337
  autoSizeLayoutIfNeeded() {
1631
1338
  if (this.shouldAutoSizeLayout()) {
1632
1339
  requestAnimationFrame(() => {
1633
- var _a;
1634
1340
  if (this.isAvailable) {
1635
- (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.autoSizeAllColumns();
1341
+ this.autoSizeAllColumns();
1636
1342
  }
1637
1343
  });
1638
1344
  }
1639
1345
  }
1640
- performAudit(action, oldState, newState) {
1641
- if (this.isReady) {
1642
- const adaptableStateChangedInfo = Object.assign(Object.assign({ actionName: action.type, clientTimestamp: new Date() }, this.api.internalApi.buildBaseContext()), { adaptableStateKey: this.adaptableOptions.adaptableStateKey, action: action, oldState: oldState, newState: newState });
1643
- this.api.eventApi.emit('AdaptableStateChanged', adaptableStateChangedInfo);
1644
- }
1645
- }
1646
1346
  forPlugins(callback) {
1647
1347
  if (Array.isArray(this.adaptableOptions.plugins)) {
1648
1348
  this.adaptableOptions.plugins.forEach((plugin) => {
@@ -1680,9 +1380,9 @@ export class AdaptableAgGrid {
1680
1380
  this.AlertService = new AlertService(this.api);
1681
1381
  this.TeamSharingService = new TeamSharingService(this.api);
1682
1382
  this.Fdc3Service = new Fdc3Service(this.api);
1683
- this.CellPopupService = new CellPopupService(this.api);
1383
+ this.AnnotationsService = new AnnotationsService(this.api);
1684
1384
  this.FlashingCellService = new FlashingCellService(this.api);
1685
- this.RowEditService = new RowEditService(this.api);
1385
+ this.RowFormService = new RowFormService(this.api);
1686
1386
  this.MetamodelService = new MetamodelService(() => this.api.optionsApi.getAdaptableOptions(), true);
1687
1387
  }
1688
1388
  initLicenseService() {
@@ -1739,18 +1439,17 @@ export class AdaptableAgGrid {
1739
1439
  */
1740
1440
  temporaryAdaptableStateUpdates() {
1741
1441
  this.api.eventApi.on('AdaptableReady', () => {
1742
- var _a, _b;
1743
1442
  // update status bar state
1744
- const adaptableStatusPanels = (_b = (_a = this.agGridAdapter
1443
+ const adaptableStatusPanels = this.agGridAdapter
1745
1444
  .getAgGridApi()
1746
- .getGridOption('statusBar')) === null || _a === void 0 ? void 0 : _a.statusPanels) === null || _b === void 0 ? void 0 : _b.filter((statusPanel) => this.adaptableStatusPanelKeys.includes(statusPanel.key));
1445
+ .getGridOption('statusBar')
1446
+ ?.statusPanels?.filter((statusPanel) => this.adaptableStatusPanelKeys.includes(statusPanel.key));
1747
1447
  const statusBarModule = this.ModuleService.getModuleById(ModuleConstants.StatusBarModuleId);
1748
1448
  // need to add only the adaptable panels
1749
1449
  statusBarModule.syncStateWithOptions(adaptableStatusPanels);
1750
1450
  });
1751
1451
  }
1752
1452
  validatePrimaryKey() {
1753
- var _a;
1754
1453
  if (this.hasAutogeneratedPrimaryKey) {
1755
1454
  return;
1756
1455
  }
@@ -1760,7 +1459,7 @@ export class AdaptableAgGrid {
1760
1459
  if (!primaryKeyColDef) {
1761
1460
  let errorMessage;
1762
1461
  // if no primary key column then lets check the first row to see if its a data item
1763
- const primaryKeyDataItem = (_a = this.getFirstRowNode()) === null || _a === void 0 ? void 0 : _a.data[primaryKey];
1462
+ const primaryKeyDataItem = this.getFirstRowNode()?.data[primaryKey];
1764
1463
  if (!primaryKeyDataItem) {
1765
1464
  errorMessage = `The Primary Key '${this.adaptableOptions.primaryKey}' does not exist. This will affect many functions in AdapTable.`;
1766
1465
  if (this.adaptableOptions.alertOptions.showMissingPrimaryKeyAlert) {
@@ -1777,21 +1476,31 @@ export class AdaptableAgGrid {
1777
1476
  }
1778
1477
  deriveAdaptableColumnStateFromAgGrid() {
1779
1478
  const allColumns = [];
1780
- const agGridCols = this.agGridAdapter.getAgGridApi().getColumns();
1781
- const columnGroupChildren = this.agGridAdapter
1782
- .getAgGridApi()
1479
+ const gridApi = this.agGridAdapter.getAgGridApi();
1480
+ const isPivot = gridApi.isPivotMode();
1481
+ let agGridCols = isPivot
1482
+ ? gridApi.getColumns()
1483
+ : // we call getAllGridColumns because we want to also have the generated group columns
1484
+ gridApi.getAllGridColumns();
1485
+ if (isPivot) {
1486
+ // let's also support the pivot result columns
1487
+ const pivotResultColumns = gridApi.getPivotResultColumns() || [];
1488
+ if (pivotResultColumns.length) {
1489
+ agGridCols = [...agGridCols, ...pivotResultColumns];
1490
+ }
1491
+ }
1492
+ const columnGroupChildren = gridApi
1783
1493
  // TODO AFL MIG: check why this assertion is here
1784
1494
  .getAllDisplayedColumnGroups();
1785
1495
  const groupsCount = {};
1786
- const colsToGroups = (columnGroupChildren !== null && columnGroupChildren !== void 0 ? columnGroupChildren : []).reduce((acc, columnGroup) => {
1787
- var _a, _b, _c;
1788
- if (!((_b = (_a = columnGroup.getProvidedColumnGroup) === null || _a === void 0 ? void 0 : _a.call(columnGroup)) === null || _b === void 0 ? void 0 : _b.getColGroupDef())) {
1496
+ const colsToGroups = (columnGroupChildren ?? []).reduce((acc, columnGroup) => {
1497
+ if (!columnGroup.getProvidedColumnGroup?.()?.getColGroupDef()) {
1789
1498
  return acc;
1790
1499
  }
1791
1500
  const ColumnGroupId = columnGroup.getGroupId();
1792
1501
  const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef()
1793
1502
  .marryChildren;
1794
- const FriendlyName = (_c = columnGroup.getProvidedColumnGroup().getColGroupDef().headerName) !== null && _c !== void 0 ? _c : ColumnGroupId;
1503
+ const FriendlyName = columnGroup.getProvidedColumnGroup().getColGroupDef().headerName ?? ColumnGroupId;
1795
1504
  const columnsInGroup = columnGroup.getLeafColumns();
1796
1505
  columnsInGroup.forEach((col) => {
1797
1506
  const group = {
@@ -1809,58 +1518,96 @@ export class AdaptableAgGrid {
1809
1518
  Object.keys(colsToGroups).forEach((colId) => {
1810
1519
  colsToGroups[colId].groupCount = groupsCount[colsToGroups[colId].columnGroupId];
1811
1520
  });
1812
- // TODO sort the visible columns by layout order
1521
+ agGridCols = agGridCols.filter((agGridColumn) => !this.agGridColumnAdapter.shouldSkipColumn(agGridColumn.getId()));
1813
1522
  agGridCols.forEach((agGridColumn) => {
1814
- const colId = agGridColumn.getColId();
1815
- if (!this.api.columnApi.isAutoRowGroupColumn(colId)) {
1816
- allColumns.push(this.agGridAdapter.createAdaptableColumnFromAgGridColumn(agGridColumn, colsToGroups));
1817
- }
1523
+ allColumns.push(this.agGridAdapter.createAdaptableColumnFromAgGridColumn(agGridColumn, colsToGroups));
1818
1524
  });
1819
1525
  this.api.gridApi.internalApi.setColumns(allColumns);
1820
1526
  }
1821
1527
  checkShouldClearExistingFiltersOrSearches() {
1822
- // if they have selected to clear column filters on startup then do it
1823
- if (this.adaptableOptions.columnFilterOptions.clearColumnFiltersOnStartUp) {
1824
- if (ArrayExtensions.IsNotNullOrEmpty(this.api.columnFilterApi.getColumnFilters())) {
1825
- this.logger.warn('Clearing existing Column Filters as "clearColumnFiltersOnStartUp" is true');
1826
- this.api.columnFilterApi.clearColumnFilters();
1827
- }
1828
- }
1829
- // if they have selected to clear the Grid filter on startup then do it
1830
- if (this.adaptableOptions.gridFilterOptions.clearGridFilterOnStartUp) {
1831
- if (StringExtensions.IsNotNullOrEmpty(this.api.gridFilterApi.getCurrentGridFilterExpression())) {
1832
- this.logger.warn('Clearing existing Grid Filter as "clearGridFilterOnStartUp" is true');
1833
- this.api.gridFilterApi.setGridFilterExpression('');
1834
- }
1528
+ // if they have selected to clear Filters on startup then do it
1529
+ if (this.adaptableOptions.filterOptions.clearFiltersOnStartUp) {
1530
+ this.logger.warn('Clearing any saved Filters as "clearFiltersOnStartUp" is true');
1531
+ this.api.filterApi.clearAllFilters();
1835
1532
  }
1836
1533
  // if they have selected to clear searches on startup then do it
1837
1534
  if (this.adaptableOptions.quickSearchOptions.clearQuickSearchOnStartUp) {
1838
- if (StringExtensions.IsNotNullOrEmpty(this.api.quickSearchApi.getQuickSearchState().QuickSearchText)) {
1839
- this.logger.warn('Clearing existing Searches as "clearQuickSearchOnStartUp" is true');
1840
- this.api.quickSearchApi.clearQuickSearch();
1841
- }
1535
+ this.logger.warn('Clearing any saved Searches as "clearQuickSearchOnStartUp" is true');
1536
+ this.api.quickSearchApi.clearQuickSearch();
1842
1537
  }
1843
1538
  }
1844
1539
  getGridCellFromRowNode(rowNode, columnId) {
1845
1540
  if (rowNode == null) {
1846
1541
  return undefined;
1847
1542
  }
1848
- const abColumn = this.api.columnApi.getColumnWithColumnId(columnId);
1849
- const pkValue = this.getPrimaryKeyValueFromRowNode(rowNode);
1850
- const rawValue = this.getRawValueFromRowNode(rowNode, columnId);
1851
- const displayValue = this.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
1852
- const normalisedValue = this.getNormalisedValueFromRawValue(rawValue, abColumn);
1853
- const isPivotCell = this.api.columnApi.isAutoPivotColumn(columnId);
1854
- const isRowGroupCell = rowNode.group;
1543
+ return this.createGridCell(rowNode, columnId);
1544
+ }
1545
+ /**
1546
+ * Use (lazy evaluated) getters to avoid unnecessary calculations and memoization to avoid recalculating the same values
1547
+ */
1548
+ createGridCell(rowNode, columnId) {
1549
+ let _column;
1550
+ let _primaryKeyValue;
1551
+ let _rawValue;
1552
+ let _displayValue;
1553
+ let _normalisedValue;
1554
+ let _isPivotCell;
1555
+ let _isRowGroupCell;
1556
+ const self = this;
1557
+ const api = this.api;
1558
+ const getRawValue = () => {
1559
+ if (_rawValue === undefined) {
1560
+ _rawValue = self.getRawValueFromRowNode(rowNode, columnId);
1561
+ }
1562
+ return _rawValue;
1563
+ };
1564
+ const getColumn = () => {
1565
+ if (_column === undefined) {
1566
+ _column = api.columnApi.getColumnWithColumnId(columnId);
1567
+ }
1568
+ return _column;
1569
+ };
1855
1570
  return {
1856
- rawValue: rawValue,
1857
- displayValue: displayValue,
1858
- normalisedValue: normalisedValue,
1859
- column: abColumn,
1860
- primaryKeyValue: pkValue,
1571
+ get rawValue() {
1572
+ return getRawValue();
1573
+ },
1574
+ get visible() {
1575
+ return self.isPrimaryKeyVisible(this.primaryKeyValue);
1576
+ },
1577
+ get displayValue() {
1578
+ if (_displayValue === undefined) {
1579
+ _displayValue = self.getDisplayValueFromRawValue(rowNode, columnId, getRawValue());
1580
+ }
1581
+ return _displayValue;
1582
+ },
1583
+ get normalisedValue() {
1584
+ if (_normalisedValue === undefined) {
1585
+ _normalisedValue = self.getNormalisedValueFromRawValue(getRawValue(), getColumn());
1586
+ }
1587
+ return _normalisedValue;
1588
+ },
1589
+ get column() {
1590
+ return getColumn();
1591
+ },
1592
+ get primaryKeyValue() {
1593
+ if (_primaryKeyValue === undefined) {
1594
+ _primaryKeyValue = self.getPrimaryKeyValueFromRowNode(rowNode);
1595
+ }
1596
+ return _primaryKeyValue;
1597
+ },
1598
+ get isPivotCell() {
1599
+ if (_isPivotCell === undefined) {
1600
+ _isPivotCell = api.columnApi.isPivotResultColumn(columnId);
1601
+ }
1602
+ return _isPivotCell;
1603
+ },
1604
+ get isRowGroupCell() {
1605
+ if (_isRowGroupCell === undefined) {
1606
+ _isRowGroupCell = rowNode.group;
1607
+ }
1608
+ return _isRowGroupCell;
1609
+ },
1861
1610
  rowNode: rowNode,
1862
- isPivotCell,
1863
- isRowGroupCell,
1864
1611
  };
1865
1612
  }
1866
1613
  getPrimaryKeyValueFromRowNode(rowNode, gridApi) {
@@ -1940,31 +1687,25 @@ export class AdaptableAgGrid {
1940
1687
  return rawValue;
1941
1688
  }
1942
1689
  const dataType = column.dataType;
1943
- if (dataType === 'String') {
1690
+ if (dataType === 'text') {
1944
1691
  return typeof rawValue !== 'string' ? String(rawValue) : rawValue;
1945
1692
  }
1946
- if (dataType === 'Number') {
1693
+ if (dataType === 'number') {
1947
1694
  // empty string or space should not be converted to 0
1948
1695
  return typeof rawValue !== 'number' && StringExtensions.IsNumeric(rawValue)
1949
1696
  ? Number(rawValue)
1950
1697
  : rawValue;
1951
1698
  }
1952
- if (dataType === 'Boolean') {
1699
+ if (dataType === 'boolean') {
1953
1700
  return typeof rawValue !== 'boolean' ? Boolean(rawValue) : rawValue;
1954
1701
  }
1955
- if (dataType === 'Date') {
1702
+ if (dataType === 'date' || dataType === 'dateString') {
1956
1703
  return rawValue instanceof Date ? rawValue : parseDateValue(rawValue);
1957
1704
  }
1958
1705
  return rawValue;
1959
1706
  }
1960
- updateColumnModelAndRefreshGrid(config) {
1961
- this.logger.info(`Updating Column Model and Refreshing Grid ${config ? `with config ${JSON.stringify(config)}` : ''}`);
1962
- if (config === null || config === void 0 ? void 0 : config.preemptiveColumnStateRefresh) {
1963
- this.deriveAdaptableColumnStateFromAgGrid();
1964
- }
1965
- if (!(config === null || config === void 0 ? void 0 : config.skipColDefsRefresh)) {
1966
- this.refreshColDefs();
1967
- }
1707
+ updateColumnModelAndRefreshGrid() {
1708
+ this.logger.info(`Updating Column Model and Refreshing Grid.`);
1968
1709
  this.deriveAdaptableColumnStateFromAgGrid();
1969
1710
  this.agGridColumnAdapter.setupColumns();
1970
1711
  this.redrawBody();
@@ -1996,9 +1737,12 @@ export class AdaptableAgGrid {
1996
1737
  redrawRow(rowNode) {
1997
1738
  this.redrawRows([rowNode]);
1998
1739
  }
1999
- refreshCells(rowNodes, columns, forceUpdate, suppressFlash = false) {
1740
+ refreshCell(rowNode, column, forceUpdate, suppressFlash = false) {
1741
+ this.refreshCells(rowNode, [column], forceUpdate, suppressFlash);
1742
+ }
1743
+ refreshCells(rowNode, columns, forceUpdate, suppressFlash = false) {
2000
1744
  const refreshCellParams = {
2001
- rowNodes,
1745
+ rowNodes: [rowNode],
2002
1746
  columns: columns,
2003
1747
  force: forceUpdate,
2004
1748
  suppressFlash,
@@ -2009,7 +1753,13 @@ export class AdaptableAgGrid {
2009
1753
  this.agGridAdapter.getAgGridApi().refreshCells({ force: forceUpdate });
2010
1754
  }
2011
1755
  refreshColumns(columns, forceUpdate, suppressFlash) {
2012
- this.refreshCells(null, columns, forceUpdate, suppressFlash);
1756
+ const refreshCellParams = {
1757
+ rowNodes: null,
1758
+ columns: columns,
1759
+ force: forceUpdate,
1760
+ suppressFlash,
1761
+ };
1762
+ this.agGridAdapter.getAgGridApi().refreshCells(refreshCellParams);
2013
1763
  }
2014
1764
  jumpToRow(rowNode) {
2015
1765
  this.agGridAdapter.getAgGridApi().ensureNodeVisible(rowNode, 'middle');
@@ -2022,7 +1772,7 @@ export class AdaptableAgGrid {
2022
1772
  this.jumpToColumn(columnId);
2023
1773
  }
2024
1774
  selectColumn(columnId, config) {
2025
- if (!(config === null || config === void 0 ? void 0 : config.keepExistingSelection)) {
1775
+ if (!config?.keepExistingSelection) {
2026
1776
  this.agGridAdapter.getAgGridApi().clearCellSelection();
2027
1777
  }
2028
1778
  const cellRangeParams = {
@@ -2034,7 +1784,7 @@ export class AdaptableAgGrid {
2034
1784
  this.agGridAdapter.getAgGridApi().addCellRange(cellRangeParams);
2035
1785
  }
2036
1786
  selectColumns(columnIds, config) {
2037
- if (!(config === null || config === void 0 ? void 0 : config.keepExistingSelection)) {
1787
+ if (!config?.keepExistingSelection) {
2038
1788
  this.agGridAdapter.getAgGridApi().clearCellSelection();
2039
1789
  }
2040
1790
  const rowCount = this.agGridAdapter.getAgGridApi().getDisplayedRowCount();
@@ -2065,7 +1815,7 @@ export class AdaptableAgGrid {
2065
1815
  }
2066
1816
  this.agGridAdapter.setGridOption('rowData', dataSource);
2067
1817
  this.updateRowGroupsExpandedState();
2068
- this.updateColumnModelAndRefreshGrid();
1818
+ // this.updateColumnModelAndRefreshGrid();
2069
1819
  }
2070
1820
  getGridData() {
2071
1821
  const data = [];
@@ -2098,7 +1848,7 @@ export class AdaptableAgGrid {
2098
1848
  }
2099
1849
  getFirstRowNode() {
2100
1850
  let firstRowNode = this.getFirstDisplayedRowNode();
2101
- if (firstRowNode === null || firstRowNode === void 0 ? void 0 : firstRowNode.group) {
1851
+ if (firstRowNode?.group) {
2102
1852
  // all groups may be closed so it is safer to get first leaf node
2103
1853
  // all groups should have at least one leafe node (though not necessarily if using SSRM)
2104
1854
  if (ArrayExtensions.IsNotNullOrEmpty(firstRowNode.allLeafChildren)) {
@@ -2111,12 +1861,10 @@ export class AdaptableAgGrid {
2111
1861
  if (!layout) {
2112
1862
  layout = this.api.layoutApi.getCurrentLayout();
2113
1863
  }
2114
- if (this.api.layoutApi.internalApi.areExpandedRowGroupsSavedInLayouts() &&
2115
- ArrayExtensions.IsNotNullOrEmpty(layout.ExpandedRowGroupValues)) {
2116
- this.expandRowGroupsForValues(layout.ExpandedRowGroupValues);
2117
- }
2118
- if (this.adaptableOptions.layoutOptions.displayRowGroups === 'expanded') {
2119
- this.expandAllRowGroups();
1864
+ if (!isPivotLayout(layout)) {
1865
+ const layoutModel = tableLayoutToTableLayoutModel(layout);
1866
+ this.layoutManager.applyRowGroupValues(layoutModel.RowGroupValues);
1867
+ return;
2120
1868
  }
2121
1869
  }
2122
1870
  isGroupRowNode(rowNode) {
@@ -2150,7 +1898,7 @@ export class AdaptableAgGrid {
2150
1898
  if (typeof dataUpdateConfig.callback === 'function') {
2151
1899
  dataUpdateConfig.callback(transaction);
2152
1900
  }
2153
- resolve(transaction === null || transaction === void 0 ? void 0 : transaction.update);
1901
+ resolve(transaction?.update);
2154
1902
  });
2155
1903
  if (dataUpdateConfig.flushAsync) {
2156
1904
  this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
@@ -2164,7 +1912,7 @@ export class AdaptableAgGrid {
2164
1912
  if (dataUpdateConfig.flushAsync) {
2165
1913
  this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2166
1914
  }
2167
- return Promise.resolve(transaction === null || transaction === void 0 ? void 0 : transaction.update);
1915
+ return Promise.resolve(transaction?.update);
2168
1916
  }
2169
1917
  }
2170
1918
  addRows(dataRows, dataUpdateConfig) {
@@ -2182,7 +1930,7 @@ export class AdaptableAgGrid {
2182
1930
  if (typeof dataUpdateConfig.callback === 'function') {
2183
1931
  dataUpdateConfig.callback(transaction);
2184
1932
  }
2185
- resolve(transaction === null || transaction === void 0 ? void 0 : transaction.add);
1933
+ resolve(transaction?.add);
2186
1934
  this.updateRowGroupsExpandedState();
2187
1935
  });
2188
1936
  if (dataUpdateConfig.flushAsync) {
@@ -2196,7 +1944,7 @@ export class AdaptableAgGrid {
2196
1944
  this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2197
1945
  }
2198
1946
  this.updateRowGroupsExpandedState();
2199
- return Promise.resolve(transaction === null || transaction === void 0 ? void 0 : transaction.add);
1947
+ return Promise.resolve(transaction?.add);
2200
1948
  }
2201
1949
  }
2202
1950
  addOrUpdateRows(dataRows, dataUpdateConfig) {
@@ -2224,12 +1972,12 @@ export class AdaptableAgGrid {
2224
1972
  if (typeof dataUpdateConfig.callback === 'function') {
2225
1973
  dataUpdateConfig.callback(transaction);
2226
1974
  }
2227
- if (transaction === null || transaction === void 0 ? void 0 : transaction.add) {
1975
+ if (transaction?.add) {
2228
1976
  this.updateRowGroupsExpandedState();
2229
1977
  }
2230
1978
  resolve({
2231
- added: transaction === null || transaction === void 0 ? void 0 : transaction.add,
2232
- updated: transaction === null || transaction === void 0 ? void 0 : transaction.update,
1979
+ added: transaction?.add,
1980
+ updated: transaction?.update,
2233
1981
  });
2234
1982
  });
2235
1983
  if (dataUpdateConfig.flushAsync) {
@@ -2243,15 +1991,15 @@ export class AdaptableAgGrid {
2243
1991
  add: addDataRows,
2244
1992
  addIndex: dataUpdateConfig.addIndex,
2245
1993
  });
2246
- if (transaction === null || transaction === void 0 ? void 0 : transaction.add) {
1994
+ if (transaction?.add) {
2247
1995
  this.updateRowGroupsExpandedState();
2248
1996
  }
2249
1997
  if (dataUpdateConfig.flushAsync) {
2250
1998
  this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2251
1999
  }
2252
2000
  return Promise.resolve({
2253
- added: transaction === null || transaction === void 0 ? void 0 : transaction.add,
2254
- updated: transaction === null || transaction === void 0 ? void 0 : transaction.update,
2001
+ added: transaction?.add,
2002
+ updated: transaction?.update,
2255
2003
  });
2256
2004
  }
2257
2005
  }
@@ -2265,7 +2013,7 @@ export class AdaptableAgGrid {
2265
2013
  if (typeof dataUpdateConfig.callback === 'function') {
2266
2014
  dataUpdateConfig.callback(transaction);
2267
2015
  }
2268
- resolve(transaction === null || transaction === void 0 ? void 0 : transaction.remove);
2016
+ resolve(transaction?.remove);
2269
2017
  });
2270
2018
  if (dataUpdateConfig.flushAsync) {
2271
2019
  this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
@@ -2312,51 +2060,137 @@ export class AdaptableAgGrid {
2312
2060
  this.autoSizeColumns([columnId]);
2313
2061
  }
2314
2062
  autoSizeColumns(columnIds) {
2315
- this.agGridAdapter.getAgGridApi().autoSizeColumns(columnIds);
2063
+ this.layoutManager.autoSizeColumns(columnIds);
2316
2064
  }
2317
2065
  autoSizeAllColumns() {
2318
- this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
2319
- }
2320
- setColumnOrder(VisibleColumnList) {
2321
- const newColumnState = this.getSortedColumnStateForVisibleColumns(VisibleColumnList);
2322
- this.agGridAdapter.getAgGridApi().applyColumnState({
2323
- state: newColumnState,
2324
- applyOrder: true,
2325
- });
2326
- this.deriveAdaptableColumnStateFromAgGrid();
2327
- }
2328
- getSortedColumnStateForVisibleColumns(visibleColumnList, columnState, layout) {
2329
- layout = layout || this.api.layoutApi.getCurrentLayout();
2330
- visibleColumnList = visibleColumnList || layout.Columns;
2331
- columnState = columnState || this.agGridAdapter.getAgGridApi().getColumnState();
2332
- return buildSortedColumnStateForLayout({
2333
- columnState: columnState.map((colState) => {
2334
- return {
2335
- colId: colState.colId,
2336
- hide: colState.hide,
2337
- };
2338
- }),
2339
- layout: Object.assign(Object.assign({}, layout), { Columns: visibleColumnList }),
2340
- groupDisplayType: this.agGridAdapter.getGridOption('groupDisplayType'),
2341
- });
2342
- }
2343
- getDistinctValuesForColumn(column, distinctValuesParams) {
2344
- let gridCells = this.getGridCellsForPermittedValues(column, distinctValuesParams);
2345
- if (ArrayExtensions.IsNullOrEmpty(gridCells)) {
2346
- gridCells = this.getDistinctGridCellsForColumn(column, distinctValuesParams);
2347
- }
2348
- return this.getUniqueGridCells(column, gridCells);
2349
- }
2350
- getGridCellsForPermittedValues(column, distinctValuesParams) {
2351
- var _a;
2352
- let gridCells = [];
2353
- const permittedValues = (_a = distinctValuesParams.permittedValues) !== null && _a !== void 0 ? _a : this.api.userInterfaceApi.getPermittedValuesForColumn(column);
2354
- if (ArrayExtensions.IsNotNullOrEmpty(permittedValues)) {
2355
- gridCells = permittedValues.map((pv) => {
2066
+ const agGridApi = this.agGridAdapter.getAgGridApi();
2067
+ if (agGridApi) {
2068
+ agGridApi.autoSizeAllColumns();
2069
+ }
2070
+ }
2071
+ async getDistinctValuesForColumn(column) {
2072
+ return this.getDistinctGridCellsForColumn(column);
2073
+ }
2074
+ async getDistinctFilterValuesForColumn(options) {
2075
+ const { column } = options;
2076
+ // First get the Grid Cells in the Column
2077
+ const currentGridCells = this.getDistinctGridCellsForColumn(column);
2078
+ // If there are custom distinct value, return them; otherwise return the Grids Cells just retrieved
2079
+ const customInFilterValues = this.adaptableOptions.filterOptions.customInFilterValues;
2080
+ if (customInFilterValues) {
2081
+ const gridApiInternal = this.api.gridApi.internalApi;
2082
+ const customInFilterValuesContext = {
2083
+ ...this.api.internalApi.buildBaseContext(),
2084
+ column,
2085
+ get currentSearchValue() {
2086
+ return options.currentSearchValue;
2087
+ },
2088
+ get sortedValues() {
2089
+ const result = gridApiInternal
2090
+ .sortDistinctValues(currentGridCells, column)
2091
+ .map((gridCell) => {
2092
+ return {
2093
+ label: gridCell.displayValue,
2094
+ value: gridCell.rawValue,
2095
+ isSelected: gridCell.rowNode.displayed,
2096
+ count: gridCell.count,
2097
+ get visible() {
2098
+ return gridCell.visible;
2099
+ },
2100
+ };
2101
+ });
2102
+ return result;
2103
+ },
2104
+ get defaultValues() {
2105
+ const result = currentGridCells.map((gridCell) => {
2106
+ return {
2107
+ label: gridCell.displayValue,
2108
+ value: gridCell.rawValue,
2109
+ isSelected: gridCell.rowNode.displayed,
2110
+ count: gridCell.count,
2111
+ get visible() {
2112
+ return gridCell.visible;
2113
+ },
2114
+ };
2115
+ });
2116
+ return result;
2117
+ },
2118
+ };
2119
+ let customDistinctValues;
2120
+ try {
2121
+ customDistinctValues = await customInFilterValues(customInFilterValuesContext);
2122
+ }
2123
+ catch (error) {
2124
+ this.logger.consoleError(`Failed to fetch custom filter values`, column, error);
2125
+ }
2126
+ if (customDistinctValues) {
2127
+ return this.getGridCellsForCustomColumnValues(customDistinctValues, column);
2128
+ }
2129
+ }
2130
+ // No distinct values so lets return unique grid cells
2131
+ return currentGridCells;
2132
+ }
2133
+ async getDistinctEditValuesForColumn(options) {
2134
+ const { column, gridCell } = options;
2135
+ // First get the Grid Cells in the Column
2136
+ const currentGridCells = this.getDistinctGridCellsForColumn(column);
2137
+ // If there are custom distinct value, return them, but only if a module has been specifically set
2138
+ const customEditColumnValues = this.adaptableOptions.editOptions.customEditColumnValues;
2139
+ if (customEditColumnValues) {
2140
+ const customEditValuesContext = {
2141
+ ...this.api.internalApi.buildBaseContext(),
2142
+ column,
2143
+ gridCell: gridCell,
2144
+ get currentSearchValue() {
2145
+ return options.currentSearchValue;
2146
+ },
2147
+ get defaultValues() {
2148
+ const result = currentGridCells.map((gridCell) => {
2149
+ return {
2150
+ label: gridCell.displayValue,
2151
+ value: gridCell.rawValue,
2152
+ get visible() {
2153
+ return gridCell.visible;
2154
+ },
2155
+ };
2156
+ });
2157
+ return result;
2158
+ },
2159
+ };
2160
+ if (customEditColumnValues) {
2161
+ let customDistinctValues;
2162
+ try {
2163
+ customDistinctValues = await customEditColumnValues(customEditValuesContext);
2164
+ }
2165
+ catch (error) {
2166
+ this.logger.consoleError(`Failed to fetch custom edit values`, column, error);
2167
+ }
2168
+ if (customDistinctValues) {
2169
+ return this.getGridCellsForCustomColumnValues(customDistinctValues, column);
2170
+ }
2171
+ }
2172
+ }
2173
+ // No distinct values so lets return unique grid cells
2174
+ return currentGridCells;
2175
+ }
2176
+ getDistinctGridCellsForColumn(column) {
2177
+ let gridCells = [];
2178
+ this.agGridAdapter.getAgGridApi().forEachNode((rowNode) => {
2179
+ const gridCell = this.addDistinctColumnValue(rowNode, column.columnId);
2180
+ if (gridCell) {
2181
+ gridCells.push(gridCell);
2182
+ }
2183
+ });
2184
+ return this.getUniqueGridCells(column, gridCells);
2185
+ }
2186
+ getGridCellsForCustomColumnValues(customColumnValues, column) {
2187
+ let gridCells = [];
2188
+ if (ArrayExtensions.IsNotNullOrEmpty(customColumnValues)) {
2189
+ gridCells = customColumnValues.map((pv) => {
2356
2190
  return {
2357
- rawValue: pv,
2358
- displayValue: pv,
2359
- normalisedValue: pv,
2191
+ rawValue: pv.value,
2192
+ displayValue: pv.label ?? pv.value,
2193
+ normalisedValue: pv.value,
2360
2194
  columnId: column.columnId,
2361
2195
  column: column,
2362
2196
  rowNode: undefined,
@@ -2367,25 +2201,8 @@ export class AdaptableAgGrid {
2367
2201
  return gridCells;
2368
2202
  }
2369
2203
  }
2370
- getDistinctGridCellsForColumn(column, distinctValuesParams) {
2371
- let gridCells = [];
2372
- if (distinctValuesParams.visibleRowsOnly === true) {
2373
- this.agGridAdapter.getAgGridApi().forEachNodeAfterFilter((rowNode) => {
2374
- const gridCell = this.addDistinctColumnValue(rowNode, column.columnId);
2375
- if (gridCell && gridCell.rowNode !== distinctValuesParams.skipRowNode) {
2376
- gridCells.push(gridCell);
2377
- }
2378
- });
2379
- }
2380
- else {
2381
- this.agGridAdapter.getAgGridApi().forEachNode((rowNode) => {
2382
- const gridCell = this.addDistinctColumnValue(rowNode, column.columnId);
2383
- if (gridCell && gridCell.rowNode !== distinctValuesParams.skipRowNode) {
2384
- gridCells.push(gridCell);
2385
- }
2386
- });
2387
- }
2388
- return gridCells;
2204
+ isPrimaryKeyVisible(primaryKey) {
2205
+ return !this.filteredOutPrimaryKeys.has(primaryKey);
2389
2206
  }
2390
2207
  addDistinctColumnValue(rowNode, columnId) {
2391
2208
  // we do not return the values of the aggregates when in grouping mode
@@ -2401,17 +2218,43 @@ export class AdaptableAgGrid {
2401
2218
  }
2402
2219
  }
2403
2220
  getUniqueGridCells(column, gridCells) {
2404
- let uniqueVals = uniqBy(gridCells, (dataItem) => {
2405
- const value = dataItem.rawValue;
2221
+ const cache = new Map();
2222
+ const lowercase = this.api.predicateApi.useCaseSensitivity();
2223
+ const getter = (dataItem) => {
2224
+ let value = dataItem.rawValue;
2406
2225
  if (value instanceof Date) {
2407
2226
  return value.toISOString();
2408
2227
  }
2228
+ if (lowercase && column.dataType == 'text') {
2229
+ value = dataItem.displayValue.toLowerCase();
2230
+ }
2409
2231
  return value;
2232
+ };
2233
+ gridCells.forEach((dataItem) => {
2234
+ const value = getter(dataItem);
2235
+ const primaryKey = dataItem.primaryKeyValue;
2236
+ if (!cache.has(value)) {
2237
+ cache.set(value, {
2238
+ count: 1,
2239
+ cell: dataItem,
2240
+ visible: this.isPrimaryKeyVisible(primaryKey),
2241
+ });
2242
+ }
2243
+ else {
2244
+ const data = cache.get(value);
2245
+ data.count++;
2246
+ data.visible = data.visible || this.isPrimaryKeyVisible(primaryKey);
2247
+ }
2410
2248
  });
2411
- if (column.dataType == 'String' && this.api.predicateApi.useCaseSensitivity()) {
2412
- uniqueVals = uniqBy(uniqueVals, (d) => d.displayValue.toLowerCase());
2413
- }
2414
- return uniqueVals.slice(0, this.api.columnFilterApi.internalApi.getFilterValuesMaxNumberOfItems(column));
2249
+ const result = [];
2250
+ cache.forEach(({ count, cell, visible }) => {
2251
+ result.push({
2252
+ ...cell,
2253
+ count,
2254
+ visible,
2255
+ });
2256
+ });
2257
+ return result;
2415
2258
  }
2416
2259
  getGridCellsForColumn(columnId, onlyVisibleRows = false) {
2417
2260
  let returnValues = [];
@@ -2431,27 +2274,6 @@ export class AdaptableAgGrid {
2431
2274
  }
2432
2275
  return returnValues;
2433
2276
  }
2434
- // This horrible method is temporary until we can get rid of having predicates inside values which is coming soon
2435
- // We need it in case Blanks is requested
2436
- // once we go to the new multi predicate screen then we wont show blanks any more - which we should never have done
2437
- getGridCellsForColumnTemp(columnId, onlyVisibleRows) {
2438
- let returnValues = [];
2439
- const handler = (rowNode) => {
2440
- if (!this.isGroupRowNode(rowNode)) {
2441
- const gridCell = this.getGridCellFromRowNode(rowNode, columnId);
2442
- if (gridCell) {
2443
- returnValues.push(gridCell);
2444
- }
2445
- }
2446
- };
2447
- if (onlyVisibleRows) {
2448
- this.agGridAdapter.getAgGridApi().forEachNodeAfterFilter(handler);
2449
- }
2450
- else {
2451
- this.agGridAdapter.getAgGridApi().forEachNode(handler);
2452
- }
2453
- return returnValues;
2454
- }
2455
2277
  getRowNodesForPrimaryKeys(primaryKeyValues) {
2456
2278
  let rowNodes = [];
2457
2279
  if (this.useRowNodeLookUp) {
@@ -2479,15 +2301,14 @@ export class AdaptableAgGrid {
2479
2301
  return this.agGridAdapter.getAgGridApi().getDisplayedRowAtIndex(index);
2480
2302
  }
2481
2303
  getAgGridStatusPanels() {
2482
- var _a, _b;
2483
- return (_b = (_a = this.agGridAdapter.getGridOption('statusBar')) === null || _a === void 0 ? void 0 : _a.statusPanels) !== null && _b !== void 0 ? _b : [];
2304
+ return this.agGridAdapter.getGridOption('statusBar')?.statusPanels ?? [];
2484
2305
  }
2485
2306
  setDataValue(value, column, primaryKeyValue, rowNode) {
2486
2307
  // note: because we use RowNode.setDataValue() this will cause Validation to fire
2487
2308
  // see https://www.ag-grid.com/javascript-data-grid/change-detection/#triggering-value-change-detection
2488
2309
  let newValue;
2489
2310
  let dataType = column.dataType;
2490
- newValue = dataType == 'Number' ? Number(value) : value;
2311
+ newValue = dataType == 'number' ? Number(value) : value;
2491
2312
  if (dataType == undefined) {
2492
2313
  return; // no point continuing as probably a wrong column
2493
2314
  }
@@ -2517,8 +2338,8 @@ export class AdaptableAgGrid {
2517
2338
  }
2518
2339
  forAllRowNodesDo(func, config) {
2519
2340
  this.agGridAdapter.getAgGridApi().forEachNode((rowNode, rowIndex) => {
2520
- const includeGroupRows = (config === null || config === void 0 ? void 0 : config.includeGroupRows) || !this.isGroupRowNode(rowNode);
2521
- const filterFnFulfilled = !(config === null || config === void 0 ? void 0 : config.filterFn) || (config === null || config === void 0 ? void 0 : config.filterFn(rowNode));
2341
+ const includeGroupRows = config?.includeGroupRows || !this.isGroupRowNode(rowNode);
2342
+ const filterFnFulfilled = !config?.filterFn || config?.filterFn(rowNode);
2522
2343
  if (includeGroupRows && filterFnFulfilled) {
2523
2344
  func(rowNode, rowIndex);
2524
2345
  }
@@ -2532,8 +2353,8 @@ export class AdaptableAgGrid {
2532
2353
  return this.forAllRowNodesDo(func, config);
2533
2354
  }
2534
2355
  this.agGridAdapter.getAgGridApi().forEachNodeAfterFilterAndSort((rowNode, rowIndex) => {
2535
- const includeGroupRows = (config === null || config === void 0 ? void 0 : config.includeGroupRows) || !this.isGroupRowNode(rowNode);
2536
- const filterFnFulfilled = !(config === null || config === void 0 ? void 0 : config.filterFn) || (config === null || config === void 0 ? void 0 : config.filterFn(rowNode));
2356
+ const includeGroupRows = config?.includeGroupRows || !this.isGroupRowNode(rowNode);
2357
+ const filterFnFulfilled = !config?.filterFn || config?.filterFn(rowNode);
2537
2358
  if (includeGroupRows && filterFnFulfilled) {
2538
2359
  func(rowNode, rowIndex);
2539
2360
  }
@@ -2542,11 +2363,10 @@ export class AdaptableAgGrid {
2542
2363
  getAgGridRowModelType(gridOptions) {
2543
2364
  // it seems that this can be null so we need explicitly to return "clientSide" in this case
2544
2365
  // need to check that for ServerSideRowModel it is ALWAYS returned...
2545
- var _a, _b;
2546
2366
  if (gridOptions) {
2547
- return (_a = gridOptions.rowModelType) !== null && _a !== void 0 ? _a : 'clientSide';
2367
+ return gridOptions.rowModelType ?? 'clientSide';
2548
2368
  }
2549
- return (_b = this.agGridAdapter.getAgGridApi().getGridOption('rowModelType')) !== null && _b !== void 0 ? _b : 'clientSide';
2369
+ return this.agGridAdapter.getAgGridApi().getGridOption('rowModelType') ?? 'clientSide';
2550
2370
  }
2551
2371
  getAllRowNodes(config) {
2552
2372
  let rowNodes = [];
@@ -2605,16 +2425,18 @@ export class AdaptableAgGrid {
2605
2425
  this.agGridAdapter.getAgGridApi().addCellRange(cellRangeParams);
2606
2426
  }
2607
2427
  getAgGridColumnType(columnId) {
2608
- var _a;
2609
- const { type } = (_a = this.agGridAdapter.getAgGridApi().getColumnDef(columnId)) !== null && _a !== void 0 ? _a : {};
2428
+ const { type } = this.agGridAdapter.getAgGridApi().getColumnDef(columnId) ?? {};
2610
2429
  return type || '';
2611
2430
  }
2612
2431
  setColumnSort(columnSorts) {
2613
2432
  if (!this.isReady) {
2614
2433
  return;
2615
2434
  }
2616
- const columnSortsMap = columnSorts === null || columnSorts === void 0 ? void 0 : columnSorts.reduce((acc, columnSort, index) => {
2617
- acc[columnSort.ColumnId] = Object.assign(Object.assign({}, columnSort), { SortIndex: index });
2435
+ const columnSortsMap = columnSorts?.reduce((acc, columnSort, index) => {
2436
+ acc[columnSort.ColumnId] = {
2437
+ ...columnSort,
2438
+ SortIndex: index,
2439
+ };
2618
2440
  return acc;
2619
2441
  }, {});
2620
2442
  const newColumnState = this.agGridAdapter
@@ -2622,7 +2444,7 @@ export class AdaptableAgGrid {
2622
2444
  .getColumnState()
2623
2445
  .map((colState) => {
2624
2446
  const { colId } = colState;
2625
- const state = Object.assign({}, colState);
2447
+ const state = { ...colState };
2626
2448
  const colSort = columnSortsMap ? columnSortsMap[colId] : undefined;
2627
2449
  if (colSort) {
2628
2450
  state.sort = colSort.SortOrder === 'Asc' ? 'asc' : 'desc';
@@ -2643,11 +2465,6 @@ export class AdaptableAgGrid {
2643
2465
  clearColumnSort() {
2644
2466
  this.setColumnSort(null);
2645
2467
  }
2646
- hideColumnFilterForm() {
2647
- if (this.hideFilterFormPopup) {
2648
- this.hideFilterFormPopup();
2649
- }
2650
- }
2651
2468
  clearColumnFiltering() {
2652
2469
  this.agGridAdapter
2653
2470
  .getAgGridApi()
@@ -2668,11 +2485,11 @@ export class AdaptableAgGrid {
2668
2485
  });
2669
2486
  }
2670
2487
  canGenerateCharts() {
2671
- return (this.agGridAdapter.isModulePresent(ModuleNames.GridChartsModule) &&
2488
+ return (this.agGridAdapter.isAgGridModuleRegistered('IntegratedCharts') &&
2672
2489
  this.agGridAdapter.getAgGridApi().getGridOption('enableCharts'));
2673
2490
  }
2674
2491
  canDisplaySparklines() {
2675
- return this.agGridAdapter.isModulePresent(ModuleNames.SparklinesModule);
2492
+ return this.agGridAdapter.isAgGridModuleRegistered('Sparklines');
2676
2493
  }
2677
2494
  showCharts(chartsDefinitions, chartContainer) {
2678
2495
  return chartsDefinitions.map((chartDefinition) => this.showChart(chartDefinition, chartContainer));
@@ -2692,7 +2509,10 @@ export class AdaptableAgGrid {
2692
2509
  .restoreChart(chartDefinition.Model, container);
2693
2510
  const chartModel = this.getChartModels().find((chartModel) => chartModel.chartId === chartRef.chartId);
2694
2511
  // Update the definition in state so it is not considered new
2695
- this.api.chartingApi.editChartDefinition(Object.assign(Object.assign({}, chartDefinition), { Model: chartModel }));
2512
+ this.api.chartingApi.editChartDefinition({
2513
+ ...chartDefinition,
2514
+ Model: chartModel,
2515
+ });
2696
2516
  return chartRef;
2697
2517
  }
2698
2518
  updateChart(chart) {
@@ -2722,17 +2542,13 @@ export class AdaptableAgGrid {
2722
2542
  return this.agGridAdapter.getAgGridApi().getDisplayedRowCount();
2723
2543
  }
2724
2544
  getColumnCount() {
2725
- var _a, _b;
2726
- return (_b = (_a = this.agGridAdapter.getAgGridApi().getColumns()) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
2545
+ return this.agGridAdapter.getAgGridApi().getColumns()?.length ?? 0;
2727
2546
  }
2728
2547
  getVisibleColumnCount() {
2729
- var _a, _b;
2730
- return ((_b = (_a = this.agGridAdapter
2548
+ return (this.agGridAdapter
2731
2549
  .getAgGridApi()
2732
- .getColumns()) === null || _a === void 0 ? void 0 : _a.filter((c) => c.isVisible()).length) !== null && _b !== void 0 ? _b : 0);
2733
- }
2734
- isGridGroupable() {
2735
- return !this.api.internalApi.isGridInTreeMode();
2550
+ .getColumns()
2551
+ ?.filter((c) => c.isVisible()).length ?? 0);
2736
2552
  }
2737
2553
  isGridGroupingActive() {
2738
2554
  let isGroupedActive = false;
@@ -2748,6 +2564,9 @@ export class AdaptableAgGrid {
2748
2564
  setAgGridQuickSearch(searchText) {
2749
2565
  this.agGridAdapter.setGridOption('quickFilterText', searchText);
2750
2566
  }
2567
+ clearAgGridQuickSearch() {
2568
+ this.setAgGridQuickSearch('');
2569
+ }
2751
2570
  getAgGridCurrentThemeName() {
2752
2571
  const container = this.getAgGridContainerElement();
2753
2572
  if (container && container.classList) {
@@ -2786,7 +2605,7 @@ export class AdaptableAgGrid {
2786
2605
  const container = this.getAgGridContainerElement();
2787
2606
  if (container != null) {
2788
2607
  container.classList.add('ab-Grid');
2789
- if (this.adaptableOptions.columnFilterOptions.indicateFilteredColumns) {
2608
+ if (this.adaptableOptions.filterOptions.columnFilterOptions.indicateFilteredColumns) {
2790
2609
  container.classList.add('ab-Grid--indicate-filtered-columns');
2791
2610
  }
2792
2611
  }
@@ -2802,7 +2621,7 @@ export class AdaptableAgGrid {
2802
2621
  // we mutate the theme later,
2803
2622
  // and since we don't want the mutation to end up in state
2804
2623
  // we better clone it here
2805
- return Object.assign({}, t);
2624
+ return { ...t };
2806
2625
  });
2807
2626
  const allThemesMap = allThemes.reduce((acc, theme) => {
2808
2627
  acc[theme.Name] = theme;
@@ -2934,36 +2753,15 @@ export class AdaptableAgGrid {
2934
2753
  this.agGridAdapter.getAgGridApi().onGroupExpandedOrCollapsed();
2935
2754
  }
2936
2755
  }
2937
- getExpandRowGroupsKeys() {
2938
- let returnValues = [];
2939
- if (this.api.layoutApi.internalApi.areExpandedRowGroupsSavedInLayouts()) {
2940
- this.agGridAdapter.getAgGridApi().forEachNode((node) => {
2941
- if (node.group && node.expanded) {
2942
- let current = node;
2943
- const path = [];
2944
- while (current) {
2945
- path.push(current.key);
2946
- current = current.parent;
2947
- }
2948
- returnValues.push(path
2949
- .filter((x) => !!x)
2950
- .reverse()
2951
- .join(GROUP_PATH_SEPARATOR));
2952
- }
2953
- });
2954
- }
2955
- return returnValues;
2956
- }
2957
2756
  getAgGridColumnForColumnId(columnId) {
2958
2757
  return this.agGridAdapter.getAgGridApi().getColumn(columnId);
2959
2758
  }
2960
2759
  getMinMaxCachedValueForColumn(column, minMax) {
2961
- var _a;
2962
2760
  const { columnId, dataType } = column;
2963
- if (dataType !== 'Number') {
2761
+ if (dataType !== 'number') {
2964
2762
  return undefined;
2965
2763
  }
2966
- let value = (_a = this.columnMinMaxValuesCache[columnId]) === null || _a === void 0 ? void 0 : _a[minMax];
2764
+ let value = this.columnMinMaxValuesCache[columnId]?.[minMax];
2967
2765
  if (value !== undefined) {
2968
2766
  return value;
2969
2767
  }
@@ -2971,14 +2769,13 @@ export class AdaptableAgGrid {
2971
2769
  .getUnsortedDistinctRawValuesForColumn(columnId)
2972
2770
  .map((item) => item.rawValue);
2973
2771
  value = minMax === 'min' ? Math.min(...distinctRawValues) : Math.max(...distinctRawValues);
2974
- this.columnMinMaxValuesCache[columnId] = Object.assign(Object.assign({}, this.columnMinMaxValuesCache[columnId]), { [minMax]: value });
2772
+ this.columnMinMaxValuesCache[columnId] = {
2773
+ ...this.columnMinMaxValuesCache[columnId],
2774
+ [minMax]: value,
2775
+ };
2975
2776
  return value;
2976
2777
  }
2977
- getAgGridRegisteredModules() {
2978
- return this.agGridAdapter.getRegisteredModules();
2979
- }
2980
2778
  destroy(config) {
2981
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
2982
2779
  if (!config) {
2983
2780
  config = {
2984
2781
  unmount: true,
@@ -2994,16 +2791,13 @@ export class AdaptableAgGrid {
2994
2791
  config.destroyAgGrid = true;
2995
2792
  }
2996
2793
  }
2997
- if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true) {
2998
- this.logger.warn(`Use of 'destroyApi' is deprecated. Use 'destroyAgGrid' instead.`);
2999
- }
3000
- if (((_a = this.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi()) && !this.agGridAdapter.getAgGridApi().isDestroyed()) {
2794
+ this.__prevLayoutForOnChange = undefined;
2795
+ this.layoutManager.destroy();
2796
+ this.filteredOutPrimaryKeys.clear();
2797
+ if (this.agGridAdapter?.getAgGridApi() && !this.agGridAdapter.getAgGridApi().isDestroyed()) {
3001
2798
  this.agGridAdapter
3002
2799
  .getAgGridApi()
3003
2800
  .removeEventListener('firstDataRendered', this.listenerFirstDataRendered);
3004
- this.agGridAdapter
3005
- .getAgGridApi()
3006
- .removeEventListener('columnPivotModeChanged', this.listenerPivotModeChanged);
3007
2801
  this.agGridAdapter
3008
2802
  .getAgGridApi()
3009
2803
  .removeEventListener('columnPivotChanged', this.listenerPivotChanged);
@@ -3036,7 +2830,6 @@ export class AdaptableAgGrid {
3036
2830
  .getAgGridApi()
3037
2831
  .removeGlobalListener(this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave);
3038
2832
  this.listenerFirstDataRendered = null;
3039
- this.listenerPivotModeChanged = null;
3040
2833
  this.listenerPivotChanged = null;
3041
2834
  this.listenerCellEditingStarted = null;
3042
2835
  this.listenerColumnRowGroupChanged = null;
@@ -3048,9 +2841,8 @@ export class AdaptableAgGrid {
3048
2841
  this.listenerGlobalColumnEventsThatTriggerStateChange = null;
3049
2842
  this.listenerGlobalColumnEventsThatTriggerAutoLayoutSave = null;
3050
2843
  this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = null;
3051
- this.throttleFilterOnEditDataChange = null;
3052
- this.throttleFilterOnTickingDataChange = null;
3053
- const liveGridOptions = this.DANGER_getPrivateAgGridBeans().gridOptions;
2844
+ this.throttleFilterOnDataChange = null;
2845
+ const liveGridOptions = this.agGridAdapter.DANGER_getLiveGridOptions();
3054
2846
  if (liveGridOptions) {
3055
2847
  this.agGridOptionsService.revertGridOptionsPropertiesToUserValue(liveGridOptions, [
3056
2848
  'aggFuncs',
@@ -3067,7 +2859,6 @@ export class AdaptableAgGrid {
3067
2859
  'getRowId',
3068
2860
  'getRowStyle',
3069
2861
  'gridId',
3070
- 'initialGroupOrderComparator',
3071
2862
  'isExternalFilterPresent',
3072
2863
  'sideBar',
3073
2864
  'statusBar',
@@ -3078,10 +2869,8 @@ export class AdaptableAgGrid {
3078
2869
  }
3079
2870
  }
3080
2871
  }
3081
- DANGER_AG_GRID_BEANS_MAP[this._agGridId] = null;
3082
- this.DANGER_updateGridOptionsMonkeyPatcher = null;
3083
- if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true || (config === null || config === void 0 ? void 0 : config.destroyAgGrid) === true) {
3084
- (_b = this.agGridAdapter.getAgGridApi()) === null || _b === void 0 ? void 0 : _b.destroy();
2872
+ if (config?.destroyAgGrid === true) {
2873
+ this.agGridAdapter.getAgGridApi()?.destroy();
3085
2874
  }
3086
2875
  this.previousAgGridLayoutState = '';
3087
2876
  const gridContainerElement = this.getAgGridContainerElement();
@@ -3094,14 +2883,18 @@ export class AdaptableAgGrid {
3094
2883
  this.agGridListenerMouseLeave = null;
3095
2884
  }
3096
2885
  this.api._internalDestroySelf();
3097
- (_c = this.agGridOptionsService) === null || _c === void 0 ? void 0 : _c.destroy();
2886
+ this.layoutManager?.destroy();
2887
+ this.layoutManager = null;
2888
+ this.agGridOptionsService?.destroy();
3098
2889
  this.agGridOptionsService = null;
3099
- (_d = this.agGridAdapter) === null || _d === void 0 ? void 0 : _d.destroy();
2890
+ this.agGridAdapter?.destroy();
3100
2891
  this.agGridAdapter = null;
3101
- (_e = this.agGridMenuAdapter) === null || _e === void 0 ? void 0 : _e.destroy();
2892
+ this.agGridMenuAdapter?.destroy();
3102
2893
  this.agGridMenuAdapter = null;
3103
- (_f = this.agGridColumnAdapter) === null || _f === void 0 ? void 0 : _f.destroy();
2894
+ this.agGridColumnAdapter?.destroy();
3104
2895
  this.agGridColumnAdapter = null;
2896
+ this.agGridExportAdapter?.destroy();
2897
+ this.agGridExportAdapter = null;
3105
2898
  this.rowListeners = null;
3106
2899
  this.emitter.destroy();
3107
2900
  this.emitter = null;
@@ -3110,189 +2903,65 @@ export class AdaptableAgGrid {
3110
2903
  this.lifecycleState = 'preDestroyed';
3111
2904
  AdaptableAgGrid.dismissInstance(this);
3112
2905
  // !! this has to be before clearing up references to container and/or adaptableOptions
3113
- if (config === null || config === void 0 ? void 0 : config.unmount) {
2906
+ if (config?.unmount) {
3114
2907
  const abContainerElement = this.getAdaptableContainerElement();
3115
2908
  if (abContainerElement != null) {
3116
- (_g = this.unmountReactRoot) === null || _g === void 0 ? void 0 : _g.call(this);
2909
+ this.unmountReactRoot?.();
3117
2910
  }
3118
2911
  this.unmountReactRoot = null;
3119
2912
  }
3120
2913
  this.DANGER_USE_GETTER_adaptableContainerElement = null;
3121
2914
  this.DANGER_USE_GETTER_agGridContainerElement = null;
3122
- this.debouncedSaveGridLayout = null;
3123
- this.debouncedSetColumnIntoStore = null;
3124
2915
  this.debouncedSetSelectedCells = null;
3125
2916
  this.debouncedSetSelectedRows = null;
3126
- (_h = this.adaptableStore) === null || _h === void 0 ? void 0 : _h.destroy();
2917
+ this.adaptableStore?.destroy();
3127
2918
  this.adaptableStore = null;
3128
- (_j = this.adaptableModules) === null || _j === void 0 ? void 0 : _j.clear();
2919
+ this.adaptableModules?.clear();
3129
2920
  this.adaptableModules = null;
3130
2921
  this.adaptableOptions = null;
3131
2922
  this.adaptableStatusPanelKeys = null;
3132
- (_l = (_k = this.CalculatedColumnExpressionService) === null || _k === void 0 ? void 0 : _k.destroy) === null || _l === void 0 ? void 0 : _l.call(_k);
2923
+ this.CalculatedColumnExpressionService?.destroy?.();
3133
2924
  this.CalculatedColumnExpressionService = null;
3134
- (_o = (_m = this.DataService) === null || _m === void 0 ? void 0 : _m.destroy) === null || _o === void 0 ? void 0 : _o.call(_m);
2925
+ this.DataService?.destroy?.();
3135
2926
  this.DataService = null;
3136
- (_q = (_p = this.Fdc3Service) === null || _p === void 0 ? void 0 : _p.destroy) === null || _q === void 0 ? void 0 : _q.call(_p);
2927
+ this.Fdc3Service?.destroy?.();
3137
2928
  this.Fdc3Service = null;
3138
- (_s = (_r = this.ModuleService) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
2929
+ this.ModuleService?.destroy?.();
3139
2930
  this.ModuleService = null;
3140
- (_u = (_t = this.ValidationService) === null || _t === void 0 ? void 0 : _t.destroy) === null || _u === void 0 ? void 0 : _u.call(_t);
2931
+ this.ValidationService?.destroy?.();
3141
2932
  this.ValidationService = null;
3142
- (_w = (_v = this.QueryLanguageService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
2933
+ this.QueryLanguageService?.destroy?.();
3143
2934
  this.QueryLanguageService = null;
3144
- (_y = (_x = this.AlertService) === null || _x === void 0 ? void 0 : _x.destroy) === null || _y === void 0 ? void 0 : _y.call(_x);
2935
+ this.AlertService?.destroy?.();
3145
2936
  this.AlertService = null;
3146
- (_0 = (_z = this.TeamSharingService) === null || _z === void 0 ? void 0 : _z.destroy) === null || _0 === void 0 ? void 0 : _0.call(_z);
2937
+ this.TeamSharingService?.destroy?.();
3147
2938
  this.TeamSharingService = null;
3148
- (_2 = (_1 = this.RowEditService) === null || _1 === void 0 ? void 0 : _1.destroy) === null || _2 === void 0 ? void 0 : _2.call(_1);
3149
- this.RowEditService = null;
3150
- (_4 = (_3 = this.MetamodelService) === null || _3 === void 0 ? void 0 : _3.destroy) === null || _4 === void 0 ? void 0 : _4.call(_3);
2939
+ this.RowFormService?.destroy?.();
2940
+ this.RowFormService = null;
2941
+ this.MetamodelService?.destroy?.();
3151
2942
  this.MetamodelService = null;
3152
- (_6 = (_5 = this.LicenseService) === null || _5 === void 0 ? void 0 : _5.destroy) === null || _6 === void 0 ? void 0 : _6.call(_5);
2943
+ this.LicenseService?.destroy?.();
3153
2944
  this.LicenseService = null;
3154
- (_8 = (_7 = this.FlashingCellService) === null || _7 === void 0 ? void 0 : _7.destroy) === null || _8 === void 0 ? void 0 : _8.call(_7);
2945
+ this.FlashingCellService?.destroy?.();
3155
2946
  this.FlashingCellService = null;
3156
- (_10 = (_9 = this.ThemeService) === null || _9 === void 0 ? void 0 : _9.destroy) === null || _10 === void 0 ? void 0 : _10.call(_9);
2947
+ this.ThemeService?.destroy?.();
3157
2948
  this.ThemeService = null;
3158
- (_12 = (_11 = this.ChartingService) === null || _11 === void 0 ? void 0 : _11.destroy) === null || _12 === void 0 ? void 0 : _12.call(_11);
2949
+ this.ChartingService?.destroy?.();
3159
2950
  this.ChartingService = null;
3160
- (_14 = (_13 = this.CellPopupService) === null || _13 === void 0 ? void 0 : _13.destroy) === null || _14 === void 0 ? void 0 : _14.call(_13);
3161
- this.CellPopupService = null;
3162
- (_15 = this.unmountLoadingScreen) === null || _15 === void 0 ? void 0 : _15.call(this);
2951
+ this.AnnotationsService?.destroy?.();
2952
+ this.AnnotationsService = null;
2953
+ this.unmountLoadingScreen?.();
3163
2954
  this.unmountLoadingScreen = null;
3164
2955
  }
3165
2956
  canExportToExcel() {
3166
- return this.agGridAdapter.isModulePresent(ModuleNames.ExcelExportModule);
2957
+ return this.agGridAdapter.isAgGridModuleRegistered('ExcelExport');
3167
2958
  }
3168
- exportToExcel(reportData, fileName) {
3169
- const columnDefs = reportData.columns.map((column) => ({
3170
- field: column.columnId,
3171
- headerName: column.friendlyName,
3172
- }));
3173
- const NESTED_COL_SEPARATOR = '.';
3174
- const nestedColumns = reportData.columns.filter((column) => column.columnId.includes(NESTED_COL_SEPARATOR));
3175
- if (nestedColumns.length) {
3176
- // the rowData of nested fields (containing dots) was flattened during the report data extraction and we need to un-flatten it back
3177
- // ex.
3178
- // current state: { field: 'outerKey.innerKey', value: 2}
3179
- // original (desired) state: { field: 'outerKey.innerKey', value: {outerKey: {innerKey: 2}}}
3180
- reportData.rows.forEach((rowDataEntry) => nestedColumns.forEach((nestedColumn) => {
3181
- const cellExportValue = rowDataEntry[nestedColumn.columnId];
3182
- let intermediaryValue = rowDataEntry;
3183
- // augment the rowDataEntry with the new object
3184
- nestedColumn.columnId
3185
- .split(NESTED_COL_SEPARATOR)
3186
- .forEach((nestedKey, index, nestedCols) => {
3187
- // we reached the leaf node, so we set the cell value and break
3188
- if (index === nestedCols.length - 1) {
3189
- intermediaryValue[nestedKey] = cellExportValue;
3190
- return;
3191
- }
3192
- if (intermediaryValue[nestedKey] == undefined) {
3193
- intermediaryValue[nestedKey] = {};
3194
- } // else means that the object already has a property with this key
3195
- intermediaryValue = intermediaryValue[nestedKey];
3196
- });
3197
- // delete the obsolete flattened property
3198
- delete rowDataEntry[nestedColumn.columnId];
3199
- }));
3200
- }
3201
- const gridOptions = {
3202
- columnDefs,
3203
- rowData: reportData.rows,
3204
- };
3205
- let gridParams = { modules: this.getAgGridRegisteredModules() };
3206
- const ephemeralGridApi = createGrid(document.createElement('div'), gridOptions, gridParams);
3207
- ephemeralGridApi.exportDataAsExcel({
3208
- sheetName: 'Sheet 1',
3209
- fileName: fileName,
3210
- });
3211
- ephemeralGridApi.destroy();
3212
- }
3213
- exportVisualDataToExcel() {
3214
- try {
3215
- const exportExcelStyles = this.api.exportApi.internalApi.buildExcelStylesForVisualReports();
3216
- // set DANGER_excelStyles without changing the array reference
3217
- this.DANGER_excelStyles.splice(0, this.DANGER_excelStyles.length, ...exportExcelStyles);
3218
- // this.agGridOptionsService.CAREFUL_patchGridOptionsProperty('excelStyles', exportExcelStyles);
3219
- this.agGridAdapter.getAgGridApi().exportDataAsExcel({
3220
- sheetName: 'Sheet 1',
3221
- fileName: this.api.exportApi.internalApi.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
3222
- // delegate the cell value processing to Adaptable
3223
- processCellCallback: ({ node, column, value }) => {
3224
- var _a;
3225
- const columnId = column.getColId();
3226
- if ((node === null || node === void 0 ? void 0 : node.group) &&
3227
- (this.api.columnApi.isAutoRowGroupColumn(columnId) ||
3228
- // we would still need to process the cell if this is a group row with an aggregated value
3229
- ((_a = node === null || node === void 0 ? void 0 : node.aggData) === null || _a === void 0 ? void 0 : _a[columnId]) == undefined)) {
3230
- // skip processing of row groups, this was already handled in processRowGroupCallback()
3231
- return value;
3232
- }
3233
- return this.processCellForExcelExport(node, columnId);
3234
- },
3235
- processRowGroupCallback: (params) => {
3236
- var _a;
3237
- // recreating the standard AG Grid styling for row groups: 'Parent -> Child'
3238
- // additionally the values are formatted
3239
- let rowGroupNode = params.node;
3240
- const isFooterRow = rowGroupNode.footer;
3241
- const rowGroupSummary = [(_a = this.processRowGroupForExcelExport(rowGroupNode)) !== null && _a !== void 0 ? _a : ''];
3242
- while (rowGroupNode.parent) {
3243
- rowGroupNode = rowGroupNode.parent;
3244
- const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode);
3245
- if (formattedParentNode) {
3246
- rowGroupSummary.push(formattedParentNode);
3247
- }
3248
- }
3249
- let summary = rowGroupSummary.reverse().join(' -> ');
3250
- if (isFooterRow) {
3251
- summary = `Total: ${summary}`;
3252
- }
3253
- return summary;
3254
- },
3255
- });
3256
- this.DANGER_excelStyles.splice(0, this.DANGER_excelStyles.length, ...this.originalExcelStyles);
3257
- }
3258
- catch (error) {
3259
- this.logger.consoleError('Error exporting visual data to Excel', error);
3260
- }
3261
- }
3262
- processRowGroupForExcelExport(rowNode) {
3263
- var _a, _b, _c, _d, _e;
3264
- const columnId = (_c = (_a = rowNode.field) !== null && _a !== void 0 ? _a : (_b = rowNode.rowGroupColumn) === null || _b === void 0 ? void 0 : _b.getColId()) !== null && _c !== void 0 ? _c : (_e = (_d = rowNode.rowGroupColumn) === null || _d === void 0 ? void 0 : _d.getColDef()) === null || _e === void 0 ? void 0 : _e.field;
3265
- if (!columnId || !rowNode.key) {
3266
- return;
3267
- }
3268
- let rawValue = rowNode.key;
3269
- if (this.api.columnApi.getColumnDataTypeForColumnId(columnId) === 'Date' &&
3270
- typeof rawValue === 'string' &&
3271
- // rawValue is composed only of digits
3272
- /^\d+$/.test(rawValue)) {
3273
- // AG-Grid converts the value to string, we have to reconvert it back
3274
- const dateRawValue = parseInt(rawValue);
3275
- if (dateRawValue != undefined) {
3276
- // @ts-ignore
3277
- rawValue = dateRawValue;
3278
- }
3279
- }
3280
- return this.api.exportApi.internalApi.getCellExportValueFromRawValue(rowNode, rawValue, columnId, GeneralConstants.VISUAL_DATA_REPORT);
3281
- }
3282
- processCellForExcelExport(rowNode, columnId) {
3283
- if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
3284
- const cellKey = this.agGridColumnAdapter.getExcelClassNameForCell(columnId, this.getPrimaryKeyValueFromRowNode(rowNode));
3285
- const isoFormattedDate = this.api.exportApi.internalApi.getExcelStyleWithFormattedDate(cellKey);
3286
- if (isoFormattedDate) {
3287
- // this is a Date cell which will be formatted by Excel
3288
- return isoFormattedDate;
3289
- }
3290
- }
3291
- return this.api.exportApi.internalApi.getCellExportValueFromRowNode(rowNode, columnId, GeneralConstants.VISUAL_DATA_REPORT);
2959
+ canExportToCsv() {
2960
+ return this.agGridAdapter.isAgGridModuleRegistered('CsvExport');
3292
2961
  }
3293
2962
  isQuickFilterAvailable() {
3294
2963
  if (this.api.layoutApi.isCurrentLayoutPivot() &&
3295
- this.adaptableOptions.columnFilterOptions.useAdaptableColumnFiltering) {
2964
+ this.adaptableOptions.filterOptions.useAdaptableFiltering) {
3296
2965
  // hide completely the quick filter if pivot is enabled
3297
2966
  return false;
3298
2967
  }
@@ -3316,152 +2985,23 @@ export class AdaptableAgGrid {
3316
2985
  return this.agGridAdapter.getAgGridApi().getChartRef(chartId);
3317
2986
  }
3318
2987
  setLayout(layout) {
3319
- var _a, _b, _c, _d, _e, _f;
3320
2988
  if (!layout) {
3321
2989
  layout = this.api.layoutApi.getCurrentLayout();
3322
2990
  }
2991
+ checkForDuplicateColumns(layout);
2992
+ const isLayoutSwitch = this._prevLayout && layout.Name != this._prevLayout.Name;
2993
+ let shouldUpdateExpandState = isLayoutSwitch;
2994
+ if (!isLayoutSwitch &&
2995
+ this._prevLayout &&
2996
+ layout.RowGroupValues?.RowGroupDefaultBehavior &&
2997
+ this._prevLayout?.RowGroupValues?.RowGroupDefaultBehavior !=
2998
+ layout.RowGroupValues?.RowGroupDefaultBehavior) {
2999
+ shouldUpdateExpandState = true;
3000
+ }
3001
+ this._prevLayout = layout;
3323
3002
  const perfSetLayout = this.logger.beginPerf(`setLayout(${layout.Name})`);
3324
- layout.Columns = layout.Columns || [];
3325
- const actionRowColumn = this.api.actionRowApi.internalApi.getColDefsForActionRowColumns()[0];
3326
- if (actionRowColumn) {
3327
- layout.Columns.push(actionRowColumn.colId);
3328
- layout.PinnedColumnsMap = layout.PinnedColumnsMap || {};
3329
- layout.PinnedColumnsMap[actionRowColumn.colId] = actionRowColumn.pinned;
3330
- }
3331
- const columnsState = this.agGridAdapter.getAgGridApi().getColumnState();
3332
- const columnsStateIndexes = {};
3333
- const columnsStateMap = columnsState.reduce((acc, colState, index) => {
3334
- columnsStateIndexes[colState.colId] = index;
3335
- acc[colState.colId] = colState;
3336
- return acc;
3337
- }, {});
3338
- let sortIndex = 0;
3339
- const sortModelMap = ((_a = layout.ColumnSorts) !== null && _a !== void 0 ? _a : []).reduce((acc, customSort) => {
3340
- const colId = customSort.ColumnId;
3341
- acc[colId] = {
3342
- colId,
3343
- sort: customSort.SortOrder === 'Asc' ? 'asc' : 'desc',
3344
- sortIndex,
3345
- };
3346
- sortIndex++;
3347
- return acc;
3348
- }, {});
3349
- const groupedColumnsIndexesMap = (layout.RowGroupedColumns || []).reduce((acc, colId, index) => {
3350
- acc[colId] = index;
3351
- return acc;
3352
- }, {});
3353
- let pivotedColumnsIndexesMap = {};
3354
- const aggregationFunctionsColumnsMap = layout.AggregationColumns || {};
3355
- const columnsToShow = !layout.EnablePivot
3356
- ? layout.Columns
3357
- : ((_b = this.agGridAdapter
3358
- .getAgGridApi()
3359
- .getPivotResultColumns()) === null || _b === void 0 ? void 0 : _b.map((column) => column.getColId())) || [];
3360
- let isChanged = false;
3361
- const colsToAutoSize = {};
3362
- let newColumnsState = this.getSortedColumnStateForVisibleColumns(columnsToShow, columnsState, layout);
3363
- newColumnsState = newColumnsState
3364
- .map((colState) => {
3365
- var _a, _b, _c;
3366
- const { colId } = colState;
3367
- const oldColState = columnsStateMap[colId];
3368
- // it's important to have width here, so it's not inherited from the existing colState
3369
- // which could be from a different layout
3370
- const newColState = Object.assign(Object.assign(Object.assign({}, oldColState), { width: null }), colState);
3371
- if (layout.ColumnWidthMap && layout.ColumnWidthMap[colId] != null) {
3372
- newColState.width = layout.ColumnWidthMap[colId];
3373
- }
3374
- else if (!colState.hide) {
3375
- // autosize only the columns which are part of the selected layout
3376
- colsToAutoSize[colId] = true;
3377
- }
3378
- if (actionRowColumn && actionRowColumn.colId === colId) {
3379
- newColState.width = actionRowColumn.width;
3380
- }
3381
- newColState.rowGroupIndex =
3382
- groupedColumnsIndexesMap[colId] != null ? groupedColumnsIndexesMap[colId] : null;
3383
- newColState.rowGroup = newColState.rowGroupIndex != null;
3384
- const normalizePinned = (pinnedValue) => {
3385
- if (typeof pinnedValue === 'string') {
3386
- return pinnedValue;
3387
- }
3388
- return pinnedValue == true ? 'left' : !!pinnedValue;
3389
- };
3390
- const newValuePinned = normalizePinned(layout.PinnedColumnsMap ? layout.PinnedColumnsMap[colId] : false);
3391
- const stateValuePinned = normalizePinned(newColState.pinned);
3392
- if (newValuePinned !== stateValuePinned) {
3393
- newColState.pinned = newValuePinned;
3394
- }
3395
- newColState.pivotIndex = null;
3396
- if (pivotedColumnsIndexesMap[colId] != null) {
3397
- newColState.pivotIndex = pivotedColumnsIndexesMap[colId];
3398
- }
3399
- newColState.aggFunc = null;
3400
- if (aggregationFunctionsColumnsMap[colId] != null) {
3401
- const colDef = this.agGridAdapter.getAgGridApi().getColumnDef(colId);
3402
- let aggFunc = null;
3403
- const aggFuncFromLayout = aggregationFunctionsColumnsMap[colId];
3404
- const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(colId);
3405
- if (aggFuncFromLayout === true) {
3406
- // if we have true, it means - take the default aggFunc from colDef
3407
- // NOTE: colState gives us the current aggFunc, which can be null,
3408
- // while the colDef gives us the initially configured aggFunc for that column
3409
- aggFunc =
3410
- (_c = (_b = (_a = colState.aggFunc) !== null && _a !== void 0 ? _a : colDef === null || colDef === void 0 ? void 0 : colDef.aggFunc) !== null && _b !== void 0 ? _b :
3411
- // @ts-ignore available only wth ag-Grid v27.3.x
3412
- colDef === null || colDef === void 0 ? void 0 : colDef.defaultAggFunc) !== null && _c !== void 0 ? _c : 'sum';
3413
- }
3414
- else if (adaptableAggFunc && adaptableAggFunc.type === 'weightedAverage') {
3415
- aggFunc = WEIGHTED_AVERAGE_AGG_FN_NAME;
3416
- }
3417
- else if (typeof aggFuncFromLayout === 'string') {
3418
- aggFunc = aggFuncFromLayout;
3419
- }
3420
- newColState.aggFunc = aggFunc;
3421
- }
3422
- if (sortModelMap[colId]) {
3423
- newColState.sort = sortModelMap[colId].sort;
3424
- newColState.sortIndex = sortModelMap[colId].sortIndex;
3425
- }
3426
- else {
3427
- newColState.sort = null;
3428
- newColState.sortIndex = null;
3429
- }
3430
- isChanged = isChanged || !lodashIsEqual(newColState, oldColState);
3431
- return newColState;
3432
- })
3433
- .filter((x) => !!x);
3434
- if (!isChanged) {
3435
- // order changed
3436
- const toString = (c) => `${c.colId}-${c.rowGroupIndex}-${c.pivotIndex}-${c.aggFunc}-${c.pinned}-${c.width}-${c.hide}`;
3437
- const oldColStateString = columnsState.map(toString).join(',');
3438
- const newColStateString = newColumnsState.map(toString).join(',');
3439
- isChanged = newColStateString != oldColStateString;
3440
- }
3441
- const pivoted = !!layout.EnablePivot;
3442
- const shouldUpdatePivoted = this.agGridAdapter.getAgGridApi().isPivotMode() !== pivoted;
3443
- /**
3444
- * Pivot columns are secondary columns that are created on the fly and base
3445
- * their configuration on the main columns by copying that configuration.
3446
- * Because they copy the colDefs they might have an old copy of the colldefs.
3447
- * This is why when the layout is pivoted we need to set columns before pivoting is applied.
3448
- * e.g. {
3449
- * field: 'pivot-1',
3450
- * pivotValueColumn: {
3451
- * colDef: {
3452
- * field: 'price',
3453
- * // this is a copy of the original column
3454
- * }
3455
- * }
3456
- *
3457
- */
3458
- if (shouldUpdatePivoted) {
3459
- this.updateColumnModelAndRefreshGrid();
3460
- }
3461
- isChanged = isChanged || shouldUpdatePivoted;
3462
- let shouldUpdateHeaders = false;
3003
+ const isPivot = isPivotLayout(layout);
3463
3004
  // update the header name for all columns
3464
- // there should be a simpler solution for this, once the Layout Management is refactored
3465
3005
  this.agGridAdapter
3466
3006
  .getAgGridApi()
3467
3007
  .getColumns()
@@ -3475,66 +3015,27 @@ export class AdaptableAgGrid {
3475
3015
  colId,
3476
3016
  abColumn,
3477
3017
  };
3478
- shouldUpdateHeaders =
3479
- this.agGridColumnAdapter.setupColumnHeader(colSetupInfo) || shouldUpdateHeaders;
3018
+ this.agGridColumnAdapter.setupColumnHeader(colSetupInfo);
3480
3019
  });
3481
- isChanged = isChanged || shouldUpdateHeaders;
3482
- if (isChanged) {
3483
- // it's important we set pivot mode
3484
- // before we set column state
3485
- // as otherwise column order is not preserved properly when
3486
- // going from pivoted to unpivoted layout
3487
- if (shouldUpdatePivoted) {
3488
- this.agGridAdapter.setGridOption('pivotMode', pivoted);
3489
- }
3490
- const perfApplyColumnState = this.logger.beginPerf('applyColumnState (layout.isChanged)');
3491
- this.agGridAdapter.getAgGridApi().applyColumnState({
3492
- state: newColumnsState,
3493
- applyOrder: true,
3494
- });
3495
- perfApplyColumnState.end();
3496
- this.api.gridApi.setColumnSorts(layout.ColumnSorts);
3497
- if (shouldUpdatePivoted) {
3498
- // simply setting PivotColumns fires an AG Grid 'modelChanged' event which cascades to a full row reload in SSRM
3499
- // this includes the case when we simply set an empty array of pivot columns
3500
- this.agGridAdapter.getAgGridApi().setPivotColumns(layout.PivotColumns || []);
3501
- }
3502
- // aggrid 25.1.0 introduced a bug such that a layout that has a grouped column, if the column has enableRowGroup: true but not rowGroup: true
3503
- // the group column is not possitioned correctly at the start of the layout
3504
- // see the test in layout/layout-switch/"should be able to switch from grouped to non-grouped and back"
3505
- // so we figured out the following line fixes the issue
3506
- // this.gridOptions.api.setColumnDefs(this.gridOptions.api.getColumnDefs()); //TODO find a solution for weighted averages - column floating filters are not showing
3507
- // these updates need to be at the end, the methods are based on the grid state/col defs
3508
- // the layout needs to be applied for them to work
3509
- this.updateRowGroupsExpandedState(layout);
3510
- }
3511
- const colsToAutoSizeArray = Object.keys(colsToAutoSize);
3512
- if (pivoted && ((_d = (_c = this.adaptableOptions) === null || _c === void 0 ? void 0 : _c.layoutOptions) === null || _d === void 0 ? void 0 : _d.autoSizeColumnsInPivotLayout)) {
3513
- // when a pivoted layout loads, autosize all cols
3514
- requestAnimationFrame(() => {
3515
- if (this.isAvailable) {
3516
- this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3517
- }
3518
- });
3519
- // //but if it's also the first time the grid is loading
3520
- // //it's not timely enough the above call, so we keep trying... I know it's ugly, we need to find a better way
3521
- // setTimeout(() => {
3522
- // this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3523
- // setTimeout(() => {
3524
- // this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3525
- // }, 200);
3526
- // }, 100);
3527
- }
3528
- else {
3529
- if (((_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.layoutOptions) === null || _f === void 0 ? void 0 : _f.autoSizeColumnsInLayout) &&
3530
- colsToAutoSizeArray.length) {
3020
+ const layoutModel = layoutStateToLayoutModel(layout);
3021
+ this.layoutManager?.setLayout(layoutModel, {
3022
+ skipApplyRowGroupsExpandedState: !shouldUpdateExpandState,
3023
+ });
3024
+ if (layout.AutoSizeColumns) {
3025
+ if (isPivot) {
3531
3026
  requestAnimationFrame(() => {
3532
3027
  if (this.isAvailable) {
3533
- this.autoSizeColumns(colsToAutoSizeArray);
3028
+ this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3534
3029
  }
3535
3030
  });
3536
3031
  }
3032
+ else {
3033
+ requestAnimationFrame(() => {
3034
+ this.autoSizeColumns();
3035
+ });
3036
+ }
3537
3037
  }
3038
+ // this.showQuickFilter()
3538
3039
  this.forPlugins((plugin) => {
3539
3040
  if (plugin.afterSetLayout) {
3540
3041
  plugin.afterSetLayout(this, layout);
@@ -3547,7 +3048,12 @@ export class AdaptableAgGrid {
3547
3048
  return null;
3548
3049
  }
3549
3050
  const currentLayout = this.api.layoutApi.getCurrentLayout();
3550
- const aggregationFunctionsColumnsMap = currentLayout.AggregationColumns || {};
3051
+ const aggregationFunctionsColumnsMap = (isPivotLayout(currentLayout)
3052
+ ? currentLayout.PivotAggregationColumns
3053
+ : currentLayout.TableAggregationColumns).reduce((acc, col) => {
3054
+ acc[col.ColumnId] = col.AggFunc;
3055
+ return acc;
3056
+ }, {});
3551
3057
  const adaptableAggFunc = aggregationFunctionsColumnsMap[columnId];
3552
3058
  if (typeof adaptableAggFunc === 'object' &&
3553
3059
  'type' in adaptableAggFunc &&
@@ -3567,14 +3073,13 @@ export class AdaptableAgGrid {
3567
3073
  if (!primaryKeyValue) {
3568
3074
  return;
3569
3075
  }
3570
- // rowNode = this.getRowNodeForPrimaryKey(primaryKeyValue);
3571
3076
  let cellDataChangedInfos = [];
3572
3077
  Object.keys(oldData).forEach((key) => {
3573
3078
  if (this.api.columnApi.isColumnInGrid(key)) {
3574
3079
  const oldValue = oldData[key];
3575
3080
  const newValue = newData[key];
3576
3081
  if (oldValue != newValue) {
3577
- const cellDataChangedInfo = this.api.internalApi.buildDataChangedInfo({
3082
+ const cellDataChangedInfo = this.api.internalApi.buildCellDataChangedInfo({
3578
3083
  oldValue: oldValue,
3579
3084
  newValue: newValue,
3580
3085
  column: this.api.columnApi.getColumnWithColumnId(key),
@@ -3589,7 +3094,7 @@ export class AdaptableAgGrid {
3589
3094
  }
3590
3095
  }
3591
3096
  });
3592
- this.performPostEditChecks(cellDataChangedInfos);
3097
+ this.performPostEditChecks(rowNode, cellDataChangedInfos);
3593
3098
  }
3594
3099
  onCellDataChanged({ rowNode, oldValue, newValue, colId, }) {
3595
3100
  if (oldValue == newValue) {
@@ -3600,7 +3105,7 @@ export class AdaptableAgGrid {
3600
3105
  return;
3601
3106
  }
3602
3107
  if (this.isGroupRowNode(rowNode)) {
3603
- const cellDataChangedInfo = this.api.internalApi.buildDataChangedInfo({
3108
+ const cellDataChangedInfo = this.api.internalApi.buildCellDataChangedInfo({
3604
3109
  oldValue: oldValue,
3605
3110
  newValue: newValue,
3606
3111
  column: abColumn,
@@ -3612,14 +3117,14 @@ export class AdaptableAgGrid {
3612
3117
  rowNode: rowNode,
3613
3118
  trigger: 'aggChange',
3614
3119
  });
3615
- this.DataService.CreateDataChangedEvent(cellDataChangedInfo);
3120
+ this.DataService.CreateCellDataChangedEvent(cellDataChangedInfo);
3616
3121
  return;
3617
3122
  }
3618
3123
  const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(rowNode);
3619
3124
  if (!primaryKeyValue) {
3620
3125
  return;
3621
3126
  }
3622
- const cellDataChangedInfo = this.api.internalApi.buildDataChangedInfo({
3127
+ const cellDataChangedInfo = this.api.internalApi.buildCellDataChangedInfo({
3623
3128
  oldValue: oldValue,
3624
3129
  newValue: newValue,
3625
3130
  column: abColumn,
@@ -3630,7 +3135,7 @@ export class AdaptableAgGrid {
3630
3135
  if (this.isUndoChange(cellDataChangedInfo)) {
3631
3136
  cellDataChangedInfo.trigger = 'undo';
3632
3137
  }
3633
- this.performPostEditChecks([cellDataChangedInfo]);
3138
+ this.performPostEditChecks(rowNode, [cellDataChangedInfo]);
3634
3139
  }
3635
3140
  isUndoChange(dataChange) {
3636
3141
  // check if this is not a reverted change
@@ -3638,70 +3143,67 @@ export class AdaptableAgGrid {
3638
3143
  return !!undoChange;
3639
3144
  }
3640
3145
  /**
3641
- * There are a few things that we need to do AFTER we edit a cell and it makes sense to put them in one place
3146
+ * There are a few things we need to do AFTER we edit a cell and it makes sense to put them in one place
3642
3147
  */
3643
- performPostEditChecks(cellDataChangedInfos) {
3644
- const firstInfo = cellDataChangedInfos[0];
3645
- if (!firstInfo || !firstInfo.rowNode) {
3646
- return;
3647
- }
3148
+ performPostEditChecks(rowNode, cellDataChangedInfos) {
3648
3149
  cellDataChangedInfos.forEach((cellDataChangedInfo) => {
3150
+ // if a Cell Data Change is undone, log to the Console
3649
3151
  if (cellDataChangedInfo.trigger === 'undo') {
3650
3152
  this.logger.info(`Undo data change: PK(${cellDataChangedInfo.primaryKeyValue}) Col(${cellDataChangedInfo.column}) RevertedValue(${cellDataChangedInfo.oldValue}) OriginalValue(${cellDataChangedInfo.newValue})`);
3651
3153
  }
3154
+ // For Changes except Aggregations, reset cell selection if required
3652
3155
  if (cellDataChangedInfo.trigger === 'edit' ||
3653
3156
  cellDataChangedInfo.trigger === 'undo' ||
3654
3157
  cellDataChangedInfo.trigger === 'tick') {
3655
- this.checkChangedCellCurrentlySelected(cellDataChangedInfo);
3656
- this.api.freeTextColumnApi.internalApi.handleFreeTextColumnDataChange(cellDataChangedInfo);
3158
+ this.checkIfChangedCellCurrentlySelected(cellDataChangedInfo);
3657
3159
  }
3658
- this.DataService.CreateDataChangedEvent(cellDataChangedInfo);
3160
+ // Call the Data Service to create an Internal Event so other parts of App can respond
3161
+ this.DataService.CreateCellDataChangedEvent(cellDataChangedInfo);
3162
+ // Reset Min and Max values for the Column
3659
3163
  this.resetMinMaxCachedValueForColumn(cellDataChangedInfo.column);
3660
3164
  });
3661
- this.refreshCellsBasedOnCellDataChange(cellDataChangedInfos);
3662
- firstInfo.trigger == 'tick' ? this.filterOnTickingDataChange() : this.filterOnEditDataChange();
3663
- }
3664
- refreshCellsBasedOnCellDataChange(cellDataChangedInfos) {
3665
- const [firstInfo] = cellDataChangedInfos;
3666
- // if node is visible then check if need to refresh other columns / whole row if the updating column is:
3667
- // 1. referenced in Format Column Styles that have Expressions (refreshing whole row if Scope is All)
3668
- // 2. referenced in Format Column styles that use Column Comparisons (which might also be calculated columns)
3669
- if (this.agGridAdapter.isVisibleNode(firstInfo.rowNode)) {
3165
+ this.refreshCellsBasedOnCellDataChange(rowNode, cellDataChangedInfos);
3166
+ this.refreshColumnsBasedOnCellDataChange(cellDataChangedInfos);
3167
+ this.filterOnDataChange();
3168
+ }
3169
+ refreshCellsBasedOnCellDataChange(rowNode, cellDataChangedInfos) {
3170
+ // Check if node is visible as otherwise AG Grid wont refresh
3171
+ if (this.agGridAdapter.isVisibleNode(rowNode)) {
3670
3172
  let dataChangedScope = {
3671
3173
  wholeRow: false,
3672
3174
  columnIds: new Set(),
3673
3175
  };
3674
- this.getFormatColumnExpressionStylesChanges(dataChangedScope, cellDataChangedInfos);
3675
- if (dataChangedScope.wholeRow === false) {
3676
- this.getFormatColumnPredicateStyleChanges(dataChangedScope, cellDataChangedInfos);
3677
- }
3176
+ // First check Format Column Expressions
3177
+ this.checkFormatColumnExpressionStyleChanges(dataChangedScope, cellDataChangedInfos);
3178
+ // If Scope is whole row then redraw row and return
3678
3179
  if (dataChangedScope.wholeRow) {
3679
- this.redrawRow(firstInfo.rowNode);
3180
+ this.redrawRow(rowNode);
3181
+ return;
3680
3182
  }
3681
- else {
3682
- this.getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos);
3683
- if (dataChangedScope.columnIds.size > 0) {
3684
- this.refreshCells([firstInfo.rowNode], Array.from(dataChangedScope.columnIds.values()), true);
3685
- }
3183
+ // Next check for Format Column Predicates, Styled Columns and FreeText Columns to update the ColumnIds refresh list as required
3184
+ this.checkFormatColumnPredicateStyleChanges(dataChangedScope, cellDataChangedInfos);
3185
+ this.checkFreeTextColumnChanges(dataChangedScope, cellDataChangedInfos);
3186
+ this.checkStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos);
3187
+ if (dataChangedScope.columnIds.size > 0) {
3188
+ this.refreshCells(rowNode, Array.from(dataChangedScope.columnIds.values()), true);
3686
3189
  }
3687
3190
  }
3688
- this.refreshColumnForRelativeRangeStyledColumns(cellDataChangedInfos);
3689
3191
  }
3690
- refreshColumnForRelativeRangeStyledColumns(cellDataChangedInfos) {
3691
- const columnIdMap = new Set();
3192
+ refreshColumnsBasedOnCellDataChange(cellDataChangedInfos) {
3193
+ const columnIdsToUpdate = [];
3194
+ // The only use case is Styled Columns with a Relative Cell Range
3692
3195
  cellDataChangedInfos.forEach((cellDataChangeInfo) => {
3693
3196
  const styledColumn = this.api.styledColumnApi.getActiveStyledColumnForColumn(cellDataChangeInfo.column);
3694
3197
  if (styledColumn &&
3695
3198
  this.api.styledColumnApi.internalApi.hasStyledColumnRelativeCellRange(styledColumn)) {
3696
- columnIdMap.add(styledColumn.ColumnId);
3199
+ columnIdsToUpdate.push(styledColumn.ColumnId);
3697
3200
  }
3698
3201
  });
3699
- const columnIdsToUpdate = [...columnIdMap];
3700
- if (columnIdsToUpdate.length) {
3202
+ if (ArrayExtensions.IsNotNullOrEmpty(columnIdsToUpdate)) {
3701
3203
  this.refreshColumns(columnIdsToUpdate, true);
3702
3204
  }
3703
3205
  }
3704
- getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos) {
3206
+ checkStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos) {
3705
3207
  this.api.styledColumnApi.getStyledColumns().forEach((sc) => {
3706
3208
  let columnComparison = this.api.styledColumnApi.internalApi.getColumnComparisonForStyledColumn(sc);
3707
3209
  if (columnComparison) {
@@ -3716,7 +3218,7 @@ export class AdaptableAgGrid {
3716
3218
  }
3717
3219
  });
3718
3220
  }
3719
- getFormatColumnPredicateStyleChanges(dataChangedScope, cellDataChangedInfos) {
3221
+ checkFormatColumnPredicateStyleChanges(dataChangedScope, cellDataChangedInfos) {
3720
3222
  cellDataChangedInfos.forEach((cellDataChangeInfo) => {
3721
3223
  const dependentColumns = this.api.formatColumnApi.internalApi.getFormatColumnColumnsDependentOnColumnChange(cellDataChangeInfo.column);
3722
3224
  for (let colId of dependentColumns) {
@@ -3724,7 +3226,21 @@ export class AdaptableAgGrid {
3724
3226
  }
3725
3227
  });
3726
3228
  }
3727
- getFormatColumnExpressionStylesChanges(dataChangedScope, cellDataChangedInfos) {
3229
+ checkFreeTextColumnChanges(dataChangedScope, cellDataChangedInfos) {
3230
+ cellDataChangedInfos.forEach((cellDataChangedInfo) => {
3231
+ const freeTextColumn = this.api.freeTextColumnApi
3232
+ .getFreeTextColumns()
3233
+ .find((fc) => fc.ColumnId == cellDataChangedInfo.column.columnId);
3234
+ if (freeTextColumn) {
3235
+ dataChangedScope.columnIds.add(freeTextColumn.ColumnId);
3236
+ const refencedCalcColumns = this.api.calculatedColumnApi.internalApi.getCalculatedColumnsReferencingColumnId(cellDataChangedInfo.column.columnId);
3237
+ refencedCalcColumns.forEach((calculatedColumn) => {
3238
+ dataChangedScope.columnIds.add(calculatedColumn.ColumnId);
3239
+ });
3240
+ }
3241
+ });
3242
+ }
3243
+ checkFormatColumnExpressionStyleChanges(dataChangedScope, cellDataChangedInfos) {
3728
3244
  const formatColumnsWithExpression = [];
3729
3245
  formatColumnsWithExpression.push(...this.api.formatColumnApi.internalApi.getFormatColumnsWithExpression());
3730
3246
  if (ArrayExtensions.IsNullOrEmpty(formatColumnsWithExpression)) {
@@ -3732,17 +3248,17 @@ export class AdaptableAgGrid {
3732
3248
  }
3733
3249
  cellDataChangedInfos.forEach((cellDataChangedInfo) => {
3734
3250
  if (!dataChangedScope.wholeRow) {
3735
- formatColumnsWithExpression.forEach((styleModule) => {
3251
+ formatColumnsWithExpression.forEach((formatColumn) => {
3736
3252
  if (!dataChangedScope.wholeRow) {
3737
- const columnIds = this.api.expressionApi.getColumnsFromExpression(styleModule.Rule.BooleanExpression);
3253
+ const columnIds = this.api.expressionApi.getColumnsFromExpression(formatColumn.Rule.BooleanExpression);
3738
3254
  if (columnIds.includes(cellDataChangedInfo.column.columnId)) {
3739
- if (this.api.columnScopeApi.scopeIsAll(styleModule.Scope)) {
3255
+ if (this.api.columnScopeApi.scopeIsAll(formatColumn.Scope)) {
3740
3256
  dataChangedScope.wholeRow = true;
3741
3257
  return;
3742
3258
  }
3743
3259
  else {
3744
3260
  this.api.columnScopeApi
3745
- .getColumnsForScope(styleModule.Scope)
3261
+ .getColumnsInScope(formatColumn.Scope)
3746
3262
  .map((c) => c.columnId)
3747
3263
  .forEach((colId) => {
3748
3264
  dataChangedScope.columnIds.add(colId);
@@ -3754,7 +3270,7 @@ export class AdaptableAgGrid {
3754
3270
  }
3755
3271
  });
3756
3272
  }
3757
- checkChangedCellCurrentlySelected(cellDataChangedInfo) {
3273
+ checkIfChangedCellCurrentlySelected(cellDataChangedInfo) {
3758
3274
  let selectedCellInfo = this.api.gridApi.getSelectedCellInfo();
3759
3275
  if (selectedCellInfo && ArrayExtensions.IsNotNullOrEmpty(selectedCellInfo.gridCells)) {
3760
3276
  let matchingCell = selectedCellInfo.gridCells.find((gc) => gc.primaryKeyValue == cellDataChangedInfo.primaryKeyValue &&
@@ -3779,298 +3295,60 @@ export class AdaptableAgGrid {
3779
3295
  this.columnMinMaxValuesCache[column.columnId] = undefined;
3780
3296
  }
3781
3297
  }
3782
- filterOnTickingDataChange() {
3783
- var _a;
3784
- if (this.adaptableOptions.columnFilterOptions.filterActionOnExternalDataChange.applyFilter ==
3785
- FilterOnDataChangeOptions.Always) {
3786
- (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.onFilterChanged();
3787
- }
3788
- else if (this.adaptableOptions.columnFilterOptions.filterActionOnExternalDataChange.applyFilter ==
3789
- FilterOnDataChangeOptions.Throttle) {
3790
- this.throttleFilterOnTickingDataChange();
3791
- }
3792
- }
3793
- filterOnEditDataChange() {
3794
- var _a;
3795
- if (this.adaptableOptions.columnFilterOptions.filterActionOnUserDataChange.applyFilter ==
3298
+ filterOnDataChange() {
3299
+ if (this.adaptableOptions.filterOptions.filterActionOnDataChange.applyFilter ==
3796
3300
  FilterOnDataChangeOptions.Always) {
3797
- (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.onFilterChanged();
3301
+ this.agGridAdapter.getAgGridApi()?.onFilterChanged();
3798
3302
  }
3799
- else if (this.adaptableOptions.columnFilterOptions.filterActionOnUserDataChange.applyFilter ==
3303
+ else if (this.adaptableOptions.filterOptions.filterActionOnDataChange.applyFilter ==
3800
3304
  FilterOnDataChangeOptions.Throttle) {
3801
- this.throttleFilterOnEditDataChange();
3802
- }
3803
- }
3804
- shouldCreateDefaultLayout(adaptableState, adaptableOptions) {
3805
- var _a, _b, _c;
3806
- const layoutState = adaptableState.Layout || {};
3807
- if (((_a = adaptableOptions.layoutOptions) === null || _a === void 0 ? void 0 : _a.createDefaultLayout) &&
3808
- !((_b = layoutState.Layouts) === null || _b === void 0 ? void 0 : _b.find((layout) => layout.Name === DEFAULT_LAYOUT))) {
3305
+ this.throttleFilterOnDataChange();
3306
+ }
3307
+ }
3308
+ refreshLayout() {
3309
+ const columnDefs = this.agGridAdapter.getColumnDefinitionsInclSpecialColumns();
3310
+ // this setGridOption call will also trigger layout.onColumnDefsChanged()
3311
+ // which will in turn call updateColumnModelAndRefreshGrid
3312
+ this.agGridAdapter.setGridOption('columnDefs', columnDefs);
3313
+ // this is needed here for when we call setAdaptableStateKey
3314
+ // and pass a new config
3315
+ this.setLayout();
3316
+ this.applyFiltering();
3317
+ }
3318
+ isRowGroupDifferentInLayout(one, other) {
3319
+ const prevRowGroupedColumns = one.RowGroupedColumns || one.PivotGroupedColumns || [];
3320
+ const currentRowGroupedColumns = other.RowGroupedColumns || other.PivotGroupedColumns || [];
3321
+ const prevRowGroupDisplayType = one.RowGroupDisplayType;
3322
+ const currentRowGroupDisplayType = other.RowGroupDisplayType;
3323
+ if (prevRowGroupDisplayType !== currentRowGroupDisplayType) {
3809
3324
  return true;
3810
3325
  }
3811
- return !((_c = layoutState.Layouts) === null || _c === void 0 ? void 0 : _c.length);
3812
- }
3813
- createDefaultLayout(state, agGridOptions) {
3814
- var _a, _b, _c;
3815
- const agGridColDefs = agGridOptions.columnDefs;
3816
- const agGridAutoGroupColDef = agGridOptions.autoGroupColumnDef;
3817
- const allColumnDefs = this.agGridAdapter.getFlattenedColDefs(agGridColDefs);
3818
- const defaultLayout = ObjectFactory.CreateEmptyLayout({
3819
- Name: DEFAULT_LAYOUT,
3820
- Columns: allColumnDefs.map((c) => c.colId),
3821
- AggregationColumns: allColumnDefs.reduce((acc, col) => {
3822
- if (typeof col.aggFunc === 'string') {
3823
- acc[col.colId] = col.aggFunc;
3824
- }
3825
- return acc;
3826
- }, {}),
3827
- PinnedColumnsMap: allColumnDefs.reduce((acc, col) => {
3828
- const pinned = col.pinned;
3829
- if (pinned) {
3830
- acc[col.colId] = pinned === true ? 'left' : pinned;
3831
- }
3832
- return acc;
3833
- }, {}),
3834
- RowGroupedColumns: allColumnDefs.reduce((acc, col) => {
3835
- if (col.rowGroup) {
3836
- acc.push(col.colId);
3837
- }
3838
- return acc;
3839
- }, []),
3840
- });
3841
- // handle optional 'gridOptions.autoGroupColumnDefs' parameter
3842
- if (agGridAutoGroupColDef &&
3843
- (((_a = defaultLayout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length) || agGridOptions.treeData)) {
3844
- defaultLayout.Columns = [AG_GRID_GROUPED_COLUMN, ...defaultLayout.Columns];
3845
- }
3846
- if (agGridAutoGroupColDef === null || agGridAutoGroupColDef === void 0 ? void 0 : agGridAutoGroupColDef.pinned) {
3847
- defaultLayout.PinnedColumnsMap[AG_GRID_GROUPED_COLUMN] =
3848
- agGridAutoGroupColDef.pinned === true ? 'left' : agGridAutoGroupColDef.pinned;
3849
- }
3850
- if (agGridAutoGroupColDef === null || agGridAutoGroupColDef === void 0 ? void 0 : agGridAutoGroupColDef.width) {
3851
- defaultLayout.ColumnWidthMap[AG_GRID_GROUPED_COLUMN] = agGridAutoGroupColDef.width;
3852
- }
3853
- // ADD special columns
3854
- const calculatedColumns = ((_b = state.CalculatedColumn) === null || _b === void 0 ? void 0 : _b.CalculatedColumns) || [];
3855
- if (calculatedColumns.length) {
3856
- defaultLayout.Columns.push(...calculatedColumns.map((c) => c.ColumnId));
3857
- }
3858
- const freeTextColumns = ((_c = state.FreeTextColumn) === null || _c === void 0 ? void 0 : _c.FreeTextColumns) || [];
3859
- if (freeTextColumns.length) {
3860
- defaultLayout.Columns.push(...freeTextColumns.map((c) => c.ColumnId));
3861
- }
3862
- return defaultLayout;
3326
+ return prevRowGroupedColumns.join(',') !== currentRowGroupedColumns.join(',');
3863
3327
  }
3864
- /*
3865
- * This is the opposite of setLayout
3866
- */
3867
- updateLayoutFromGrid() {
3868
- var _a, _b;
3869
- this.logger.info('updateLayoutFromGrid()');
3870
- const agGridApi = this.agGridAdapter.getAgGridApi();
3871
- const columnState = agGridApi.getColumnState();
3872
- const expandedState = agGridApi.getState().rowGroupExpansion || { expandedRowGroupIds: [] };
3873
- const currentLayoutState = { columnState, expandedState };
3874
- try {
3875
- const stringifiedLayoutState = JSON.stringify(currentLayoutState);
3876
- if (stringifiedLayoutState === this.previousAgGridLayoutState) {
3877
- // same grid column state as a previous,
3878
- // so no need to update, as the layout has already been updated
3879
- // for this grid column state
3880
- return;
3881
- }
3882
- this.previousAgGridLayoutState = stringifiedLayoutState;
3883
- }
3884
- catch (ex) {
3885
- this.logger.consoleError('Error stringifying column state', ex);
3886
- }
3887
- const currentLayout = this.api.layoutApi.getCurrentLayout();
3888
- if (currentLayout.IsReadOnly) {
3889
- // reaply the layout so the grid is reverted
3890
- this.setLayout();
3891
- return;
3892
- }
3893
- const layout = Object.assign({}, currentLayout);
3894
- let columnOrder = [];
3895
- const columnFlexes = {};
3896
- const pinnedColumns = {};
3897
- const columnSorts = [];
3898
- let groupedColumns = [...new Array(columnState.length)];
3899
- let pivotedColumns = [...new Array(columnState.length)];
3900
- const pivotColumns = [];
3901
- const aggregatedColumns = {};
3902
- const columnWidths = columnState.reduce((acc, colState) => {
3903
- const { colId } = colState;
3904
- if (colState.sort && colState.sortIndex != null) {
3905
- columnSorts.push({
3906
- ColumnId: colId,
3907
- SortOrder: colState.sort === 'asc' ? 'Asc' : 'Desc',
3908
- SortIndex: colState.sortIndex,
3909
- });
3910
- }
3911
- if (colState.width != null) {
3912
- acc[colId] = colState.width;
3913
- }
3914
- if (colState.flex != null) {
3915
- columnFlexes[colId] = colState.flex;
3916
- }
3917
- if (colState.pinned === 'left') {
3918
- pinnedColumns[colId] = 'left';
3919
- }
3920
- if (colState.pinned === 'right') {
3921
- pinnedColumns[colId] = 'right';
3922
- }
3923
- if (!colState.hide) {
3924
- columnOrder.push(colId);
3925
- }
3926
- if (colState.rowGroupIndex != null) {
3927
- groupedColumns[colState.rowGroupIndex] = colId;
3928
- }
3929
- if (colState.pivotIndex != null) {
3930
- pivotedColumns[colState.pivotIndex] = colId;
3931
- }
3932
- if (colState.aggFunc && typeof colState.aggFunc === 'string') {
3933
- aggregatedColumns[colId] = colState.aggFunc;
3934
- }
3935
- return acc;
3936
- }, {});
3937
- columnSorts.sort((a, b) => a.SortIndex - b.SortIndex);
3938
- this.agGridAdapter
3939
- .getAgGridApi()
3940
- .getPivotColumns()
3941
- .forEach((col) => {
3942
- pivotColumns.push(col.getColId());
3943
- });
3944
- groupedColumns = groupedColumns.filter((x) => !!x);
3945
- pivotedColumns = pivotedColumns.filter((x) => !!x);
3946
- if ((_b = (_a = this.adaptableOptions) === null || _a === void 0 ? void 0 : _a.groupingOptions) === null || _b === void 0 ? void 0 : _b.restoreUngroupedColumns) {
3947
- columnOrder = this.restoreUnGroupColumnOrder({
3948
- columnOrder,
3949
- newGroupColumns: groupedColumns,
3950
- });
3951
- }
3952
- layout.ColumnWidthMap = columnWidths;
3953
- // layout.ColumnFlexMap = columnFlexes;
3954
- layout.PinnedColumnsMap = pinnedColumns;
3955
- layout.Columns = columnOrder;
3956
- layout.ColumnSorts = columnSorts;
3957
- layout.RowGroupedColumns = groupedColumns;
3958
- if (Object.keys(aggregatedColumns).length) {
3959
- // AG Grid aggregations are not 1-1 with adaptable column-aggregations
3960
- layout.AggregationColumns = this.mapAggregationColumnsFromGrid(aggregatedColumns, currentLayout);
3961
- }
3962
- else {
3963
- layout.AggregationColumns = {};
3964
- }
3965
- layout.EnablePivot = this.agGridAdapter.getAgGridApi().isPivotMode();
3966
- layout.PivotColumns = pivotColumns;
3967
- if (
3968
- // check first row node for presence of data without iterating over whole grid
3969
- this.api.layoutApi.internalApi.areExpandedRowGroupsSavedInLayouts() &&
3970
- this.api.gridApi.getFirstDisplayedRowNode()) {
3971
- layout.ExpandedRowGroupValues = this.getExpandRowGroupsKeys();
3972
- }
3973
- const previousVisibleColumns = currentLayout.Columns;
3974
- const newVisibleColumns = layout.Columns;
3975
- // check if all new columns were previously visible
3976
- const someColumnsAreNew = newVisibleColumns.some((colId) => !previousVisibleColumns.includes(colId));
3977
- if (someColumnsAreNew) {
3328
+ onLayoutChange(layout) {
3329
+ this.logger.info('onLayoutChange()');
3330
+ const prevOnChangeLayout = this.__prevLayoutForOnChange || this.api.layoutApi.getCurrentLayout();
3331
+ // see #on-regroup-expect-group-column-to-be-recomputed-and-setup-properly
3332
+ const rowGroupsChanged = this.isRowGroupDifferentInLayout(prevOnChangeLayout, layout);
3333
+ const pivotColsChanged = JSON.stringify(layout.PivotColumns) !== JSON.stringify(prevOnChangeLayout.PivotColumns);
3334
+ if (rowGroupsChanged || pivotColsChanged) {
3978
3335
  this.updateColumnModelAndRefreshGrid();
3979
3336
  }
3980
- this.persistLayout(layout);
3981
- }
3982
- persistLayout(layout) {
3983
- if (this.api.layoutApi.shouldAutoSaveLayouts()) {
3984
- this.api.layoutApi.createOrUpdateLayout(layout);
3985
- }
3986
3337
  else {
3987
- this.api.layoutApi.internalApi.updateCurrentDraftLayout(layout);
3988
- }
3989
- }
3990
- /**
3991
- * When reading the state from the grid, we have to make sure 'avg' is not overriden with the 'avg' string.
3992
- */
3993
- mapAggregationColumnsFromGrid(aggFuncFromGrid, currentLayout) {
3994
- return Object.entries(aggFuncFromGrid).reduce((acc, [colId, agg]) => {
3995
- const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(colId);
3996
- if ((adaptableAggFunc === null || adaptableAggFunc === void 0 ? void 0 : adaptableAggFunc.type) === 'weightedAverage' && agg === WEIGHTED_AVERAGE_AGG_FN_NAME) {
3997
- // do not override the agg func
3998
- acc[colId] = currentLayout.AggregationColumns[colId];
3999
- }
4000
- else {
4001
- acc[colId] = agg;
4002
- }
4003
- return acc;
4004
- }, {});
4005
- }
4006
- persistColumnIndexBeforeGrouping(params) {
4007
- const layout = this.api.layoutApi.getCurrentLayout();
4008
- const columnGroupsInLayout = layout.RowGroupedColumns;
4009
- const columnGroupsInGrid = params.columns.map((col) => col.getColId());
4010
- // what is new
4011
- const newGroups = columnGroupsInGrid.filter((colId) => !columnGroupsInLayout.includes(colId));
4012
- newGroups.forEach((colId) => {
4013
- const columnIndex = layout.Columns.filter((colId) => !(this.api.columnApi.isAutoRowGroupColumn(colId) ||
4014
- this.api.columnApi.isAutoPivotColumn(colId))).findIndex((columnIdInLayout) => columnIdInLayout === colId);
4015
- // user may group after a column not in layout
4016
- if (columnIndex !== -1) {
4017
- this.api.internalApi.persistPreviousGroupedColumnsIndex(layout.Uuid, colId, columnIndex);
4018
- }
4019
- });
4020
- }
4021
- /**
4022
- * Restores the order previous grouping order.
4023
- */
4024
- restoreUnGroupColumnOrder({ newGroupColumns, columnOrder, }) {
4025
- var _a;
4026
- const newColumnOrder = [...columnOrder];
4027
- const currentLayout = this.api.layoutApi.getCurrentLayout();
4028
- const previousGroupedColumnsIndex = this.api.internalApi.getPreviousGroupedColumnsIndex(currentLayout.Uuid);
4029
- const isUnGroup = newGroupColumns.length < ((_a = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length);
4030
- if (!isUnGroup) {
4031
- return columnOrder;
4032
- }
4033
- if (!previousGroupedColumnsIndex) {
4034
- return columnOrder;
4035
- }
4036
- for (let [colId, previousIndex] of Object.entries(previousGroupedColumnsIndex)) {
4037
- const isStillGrouped = newGroupColumns.includes(colId);
4038
- const isAlreadyInGrid = currentLayout.Columns.includes(colId); // was not just added by ungrouping
4039
- if (isStillGrouped) {
4040
- continue;
4041
- }
4042
- if (isAlreadyInGrid) {
4043
- // no longer grouped, but already in grid, this means it was already in grid before ungrouping
4044
- // in this case the state can be cleared
4045
- this.api.internalApi.persistPreviousGroupedColumnsIndex(currentLayout.Uuid, colId, null);
4046
- continue;
4047
- }
4048
- // need to ajust index based if grouped
4049
- const numberOfGroupedColumns = newColumnOrder.filter((colId) => this.api.columnApi.isAutoRowGroupColumn(colId)).length;
4050
- const adjustedPreviousIndex = previousIndex + numberOfGroupedColumns;
4051
- const indexInGrid = newColumnOrder.indexOf(colId);
4052
- const hasDifferentPositionAsPreviousLayout = adjustedPreviousIndex !== null && // if null, the reorder was already applied
4053
- indexInGrid > 0 && // needs to be in grid
4054
- adjustedPreviousIndex !== indexInGrid;
4055
- const isPreviousPositionInRange = adjustedPreviousIndex < newColumnOrder.length;
4056
- if (hasDifferentPositionAsPreviousLayout && isPreviousPositionInRange) {
4057
- newColumnOrder.splice(indexInGrid, 1);
4058
- newColumnOrder.splice(adjustedPreviousIndex, 0, colId);
4059
- }
4060
- this.api.internalApi.persistPreviousGroupedColumnsIndex(currentLayout.Uuid, colId, null);
3338
+ this.deriveAdaptableColumnStateFromAgGrid();
4061
3339
  }
4062
- return newColumnOrder;
4063
- }
4064
- onSortChanged() {
4065
- const columnSorts = this.getColumnSorts();
4066
- this.api.gridApi.setColumnSorts(columnSorts);
4067
- this._emit('SortChanged', columnSorts);
3340
+ this.__prevLayoutForOnChange = layout;
3341
+ this.api.layoutApi.createOrUpdateLayout(layout);
4068
3342
  }
4069
3343
  getColumnSorts() {
4070
3344
  const columnSorts = [];
3345
+ const { columnApi } = this.api;
4071
3346
  const columnState = this.agGridAdapter.getAgGridApi().getColumnState();
4072
3347
  columnState.forEach((colState) => {
4073
3348
  const { colId } = colState;
3349
+ if (columnApi.isAutoRowGroupColumn(colId)) {
3350
+ return;
3351
+ }
4074
3352
  if (colState.sort && colState.sortIndex != null) {
4075
3353
  columnSorts.push({
4076
3354
  ColumnId: colId,
@@ -4087,49 +3365,4 @@ export class AdaptableAgGrid {
4087
3365
  };
4088
3366
  });
4089
3367
  }
4090
- // #gridOpts_monkey_patch
4091
- // we need to intercept some of the GridOptions updates and refresh the Adaptable state
4092
- monkeyPatchingGridOptionsUpdates(agGridApi) {
4093
- var _a;
4094
- const gridOptionsService = (_a = this.DANGER_getPrivateAgGridBeans()) === null || _a === void 0 ? void 0 : _a.gos;
4095
- if (!gridOptionsService) {
4096
- this.logger.consoleError('Could not get hold of GridOptionsService! This is a critical error and will prevent Adaptable from working correctly.');
4097
- }
4098
- const self = this;
4099
- this.DANGER_updateGridOptionsMonkeyPatcher = function ({ options, force, source = 'api', }) {
4100
- // `columnDefs`
4101
- const passedColumnDefs = options.columnDefs;
4102
- if (passedColumnDefs) {
4103
- const colDefsWithSpecialColumns = self.getColumnDefinitionsInclSpecialColumns(passedColumnDefs);
4104
- const allDisplayedColIds = self.agGridAdapter
4105
- .getAgGridApi()
4106
- .getAllDisplayedColumns()
4107
- .map((col) => col.getColId());
4108
- // mark as hidden the colDefs of special columns which are not visible
4109
- self.agGridAdapter.patchColDefs(colDefsWithSpecialColumns, (colDef) => {
4110
- if (self.api.columnApi.isSpecialColumn(colDef.colId)) {
4111
- colDef.hide = !allDisplayedColIds.includes(colDef.colId);
4112
- }
4113
- });
4114
- options['columnDefs'] = colDefsWithSpecialColumns;
4115
- self.logger.info(`Added SpecialColumns on GridOptions.columnDefs update (source=${source})`);
4116
- }
4117
- // `context`
4118
- const passedContext = options.context;
4119
- if (passedContext) {
4120
- passedContext['__adaptable'] = self;
4121
- passedContext['adaptableApi'] = self.api;
4122
- }
4123
- // we mutated the options array, so it's OK to use the 'arguments' object
4124
- GridOptionsService_updateGridOptions.apply(this, arguments);
4125
- };
4126
- gridOptionsService.updateGridOptions = this.DANGER_updateGridOptionsMonkeyPatcher;
4127
- }
4128
- DANGER_getPrivateAgGridBeans() {
4129
- const beans = DANGER_AG_GRID_BEANS_MAP[this._agGridId];
4130
- if (!beans) {
4131
- this.logger.consoleError('Could not get hold of AgGridBeans! This is a critical error and will prevent Adaptable from working correctly.');
4132
- }
4133
- return beans;
4134
- }
4135
3368
  }