@adaptabletools/adaptable-cjs 18.0.0-canary.8 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (438) hide show
  1. package/base.css +18 -20
  2. package/base.css.map +1 -1
  3. package/index.css +22 -20
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +10 -4
  7. package/src/AdaptableOptions/ActionColumnOptions.d.ts +3 -2
  8. package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +3 -0
  9. package/src/AdaptableOptions/AdaptableOptions.d.ts +15 -14
  10. package/src/AdaptableOptions/AdaptablePlugin.d.ts +2 -0
  11. package/src/AdaptableOptions/AdaptablePlugin.js +2 -0
  12. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +7 -0
  13. package/src/AdaptableOptions/ColumnMenuOptions.d.ts +94 -0
  14. package/src/AdaptableOptions/ColumnOptions.d.ts +9 -4
  15. package/src/AdaptableOptions/CommentOptions.d.ts +20 -9
  16. package/src/AdaptableOptions/ContextMenuOptions.d.ts +94 -0
  17. package/src/AdaptableOptions/CustomSortOptions.d.ts +2 -2
  18. package/src/AdaptableOptions/DataImportOptions.d.ts +2 -2
  19. package/src/AdaptableOptions/FormatColumnOptions.d.ts +2 -2
  20. package/src/AdaptableOptions/GroupingOptions.d.ts +0 -26
  21. package/src/AdaptableOptions/NoteOptions.d.ts +12 -3
  22. package/src/AdaptableOptions/PredicateOptions.d.ts +2 -2
  23. package/src/AdaptableOptions/QuickSearchOptions.d.ts +1 -1
  24. package/src/AdaptableOptions/StateOptions.d.ts +6 -0
  25. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
  26. package/src/Api/AdaptableApi.d.ts +16 -6
  27. package/src/Api/ColumnApi.d.ts +13 -0
  28. package/src/Api/ColumnMenuApi.d.ts +13 -0
  29. package/src/Api/{ScopeApi.d.ts → ColumnScopeApi.d.ts} +36 -26
  30. package/src/Api/CommentApi.d.ts +20 -22
  31. package/src/Api/ConfigApi.d.ts +4 -5
  32. package/src/Api/ContextMenuApi.d.ts +9 -0
  33. package/src/Api/EventApi.d.ts +7 -9
  34. package/src/Api/Events/CommentChanged.d.ts +11 -0
  35. package/src/Api/Events/CommentChanged.js +2 -0
  36. package/src/Api/Events/GridDataChanged.d.ts +1 -1
  37. package/src/Api/FlashingCellApi.d.ts +2 -2
  38. package/src/Api/GridApi.d.ts +35 -3
  39. package/src/Api/Implementation/ActionColumnApiImpl.js +3 -6
  40. package/src/Api/Implementation/ActionRowApiImpl.js +3 -7
  41. package/src/Api/Implementation/AdaptableApiImpl.d.ts +7 -5
  42. package/src/Api/Implementation/AdaptableApiImpl.js +9 -5
  43. package/src/Api/Implementation/AlertApiImpl.js +8 -13
  44. package/src/Api/Implementation/ApiBase.d.ts +6 -4
  45. package/src/Api/Implementation/ApiBase.js +11 -5
  46. package/src/Api/Implementation/CalendarApiImpl.js +1 -6
  47. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +0 -5
  48. package/src/Api/Implementation/CellSummaryApiImpl.js +2 -23
  49. package/src/Api/Implementation/ChartingApiImpl.js +3 -3
  50. package/src/Api/Implementation/ColumnApiImpl.d.ts +5 -0
  51. package/src/Api/Implementation/ColumnApiImpl.js +48 -16
  52. package/src/Api/Implementation/ColumnFilterApiImpl.js +7 -7
  53. package/src/Api/Implementation/ColumnMenuApiImpl.d.ts +8 -0
  54. package/src/Api/Implementation/ColumnMenuApiImpl.js +16 -0
  55. package/src/Api/Implementation/ColumnScopeApiImpl.d.ts +33 -0
  56. package/src/Api/Implementation/{ScopeApiImpl.js → ColumnScopeApiImpl.js} +67 -21
  57. package/src/Api/Implementation/CommentsApiImpl.d.ts +8 -5
  58. package/src/Api/Implementation/CommentsApiImpl.js +10 -5
  59. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -2
  60. package/src/Api/Implementation/ConfigApiImpl.js +27 -28
  61. package/src/Api/Implementation/ContextMenuApiImpl.d.ts +7 -0
  62. package/src/Api/Implementation/ContextMenuApiImpl.js +13 -0
  63. package/src/Api/Implementation/DashboardApiImpl.js +1 -6
  64. package/src/Api/Implementation/ExportApiImpl.js +5 -10
  65. package/src/Api/Implementation/ExpressionApiImpl.js +14 -19
  66. package/src/Api/Implementation/Fdc3ApiImpl.js +1 -1
  67. package/src/Api/Implementation/FlashingCellApiImpl.d.ts +2 -2
  68. package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
  69. package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
  70. package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
  71. package/src/Api/Implementation/GridApiImpl.d.ts +9 -1
  72. package/src/Api/Implementation/GridApiImpl.js +63 -9
  73. package/src/Api/Implementation/LayoutApiImpl.d.ts +4 -11
  74. package/src/Api/Implementation/LayoutApiImpl.js +19 -27
  75. package/src/Api/Implementation/NoteApiImpl.d.ts +18 -0
  76. package/src/Api/Implementation/NoteApiImpl.js +45 -0
  77. package/src/Api/Implementation/OptionsApiImpl.d.ts +6 -5
  78. package/src/Api/Implementation/OptionsApiImpl.js +7 -4
  79. package/src/Api/Implementation/PredicateApiImpl.js +2 -2
  80. package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
  81. package/src/Api/Implementation/TeamSharingApiImpl.js +3 -15
  82. package/src/Api/Implementation/ThemeApiImpl.js +2 -7
  83. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +14 -8
  84. package/src/Api/Implementation/UserInterfaceApiImpl.js +32 -27
  85. package/src/Api/Internal/ActionRowInternalApi.d.ts +1 -0
  86. package/src/Api/Internal/ActionRowInternalApi.js +19 -46
  87. package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -4
  88. package/src/Api/Internal/AdaptableInternalApi.js +16 -30
  89. package/src/Api/Internal/AlertInternalApi.d.ts +2 -2
  90. package/src/Api/Internal/AlertInternalApi.js +7 -20
  91. package/src/Api/Internal/CalculatedColumnInternalApi.js +11 -17
  92. package/src/Api/Internal/ChartingInternalApi.js +13 -13
  93. package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
  94. package/src/Api/Internal/ColumnFilterInternalApi.js +24 -30
  95. package/src/Api/Internal/ColumnInternalApi.d.ts +2 -0
  96. package/src/Api/Internal/ColumnInternalApi.js +8 -1
  97. package/src/Api/Internal/CommentsInternalApi.d.ts +4 -0
  98. package/src/Api/Internal/CommentsInternalApi.js +18 -0
  99. package/src/Api/Internal/CustomSortInternalApi.js +1 -1
  100. package/src/Api/Internal/DashboardInternalApi.js +5 -11
  101. package/src/Api/Internal/DataImportInternalApi.js +3 -9
  102. package/src/Api/Internal/DataSetInternalApi.js +2 -7
  103. package/src/Api/Internal/ExportInternalApi.d.ts +2 -1
  104. package/src/Api/Internal/ExportInternalApi.js +8 -5
  105. package/src/Api/Internal/ExpressionInternalApi.js +3 -13
  106. package/src/Api/Internal/Fdc3InternalApi.js +3 -12
  107. package/src/Api/Internal/FormatColumnInternalApi.d.ts +3 -6
  108. package/src/Api/Internal/FormatColumnInternalApi.js +38 -30
  109. package/src/Api/Internal/FreeTextColumnInternalApi.js +5 -4
  110. package/src/Api/Internal/GridFilterInternalApi.d.ts +5 -0
  111. package/src/Api/Internal/GridFilterInternalApi.js +8 -8
  112. package/src/Api/Internal/GridInternalApi.d.ts +2 -0
  113. package/src/Api/Internal/GridInternalApi.js +28 -40
  114. package/src/Api/Internal/LayoutInternalApi.d.ts +2 -0
  115. package/src/Api/Internal/LayoutInternalApi.js +26 -19
  116. package/src/Api/Internal/NoteInternalApi.d.ts +4 -0
  117. package/src/Api/Internal/NoteInternalApi.js +18 -0
  118. package/src/Api/Internal/PredicateInternalApi.d.ts +6 -6
  119. package/src/Api/Internal/PredicateInternalApi.js +5 -40
  120. package/src/Api/Internal/ScheduleInternalApi.js +1 -6
  121. package/src/Api/Internal/StyledColumnInternalApi.d.ts +2 -2
  122. package/src/Api/Internal/StyledColumnInternalApi.js +8 -9
  123. package/src/Api/Internal/SystemStatusInternalApi.js +1 -7
  124. package/src/Api/Internal/TeamSharingInternalApi.js +2 -7
  125. package/src/Api/Internal/ThemeInternalApi.js +1 -1
  126. package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
  127. package/src/Api/LayoutApi.d.ts +15 -15
  128. package/src/Api/NoteApi.d.ts +48 -0
  129. package/src/Api/NoteApi.js +2 -0
  130. package/src/Api/OptionsApi.d.ts +14 -10
  131. package/src/Api/UserInterfaceApi.d.ts +15 -13
  132. package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
  133. package/src/PredefinedConfig/AlertState.d.ts +2 -2
  134. package/src/PredefinedConfig/CommentState.d.ts +27 -23
  135. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
  136. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  137. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +4 -4
  138. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +2 -2
  139. package/src/PredefinedConfig/Common/CellSummary.d.ts +5 -14
  140. package/src/PredefinedConfig/Common/{AdaptableScope.d.ts → ColumnScope.d.ts} +4 -1
  141. package/src/PredefinedConfig/Common/ColumnScope.js +2 -0
  142. package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +1 -5
  143. package/src/PredefinedConfig/Common/Enums.d.ts +4 -1
  144. package/src/PredefinedConfig/Common/Enums.js +3 -0
  145. package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +2 -2
  146. package/src/PredefinedConfig/Common/Menu.d.ts +39 -4
  147. package/src/PredefinedConfig/Common/Menu.js +126 -0
  148. package/src/PredefinedConfig/Common/RowScope.d.ts +17 -0
  149. package/src/PredefinedConfig/Common/RowScope.js +2 -0
  150. package/src/PredefinedConfig/Common/RowSummary.d.ts +21 -0
  151. package/src/PredefinedConfig/Common/RowSummary.js +20 -0
  152. package/src/PredefinedConfig/Common/TransposeConfig.d.ts +30 -0
  153. package/src/PredefinedConfig/Common/TransposeConfig.js +2 -0
  154. package/src/PredefinedConfig/Common/Types.d.ts +4 -4
  155. package/src/PredefinedConfig/Common/Types.js +4 -1
  156. package/src/PredefinedConfig/ExportState.d.ts +2 -2
  157. package/src/PredefinedConfig/FlashingCellState.d.ts +2 -2
  158. package/src/PredefinedConfig/FormatColumnState.d.ts +9 -5
  159. package/src/PredefinedConfig/LayoutState.d.ts +6 -1
  160. package/src/PredefinedConfig/{NotesState.d.ts → NoteState.d.ts} +4 -4
  161. package/src/PredefinedConfig/NoteState.js +2 -0
  162. package/src/PredefinedConfig/PlusMinusState.d.ts +2 -2
  163. package/src/PredefinedConfig/PopupState.d.ts +1 -2
  164. package/src/PredefinedConfig/PredefinedConfig.d.ts +2 -2
  165. package/src/PredefinedConfig/Selection/GridCell.d.ts +13 -0
  166. package/src/PredefinedConfig/ShortcutState.d.ts +2 -2
  167. package/src/PredefinedConfig/StyledColumnState.d.ts +5 -5
  168. package/src/PredefinedConfig/SystemState.d.ts +12 -4
  169. package/src/Redux/ActionsReducers/CommentsRedux.d.ts +0 -4
  170. package/src/Redux/ActionsReducers/CommentsRedux.js +1 -39
  171. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
  172. package/src/Redux/ActionsReducers/LayoutRedux.js +34 -11
  173. package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
  174. package/src/Redux/ActionsReducers/{NotesRedux.js → NoteRedux.js} +31 -31
  175. package/src/Redux/ActionsReducers/PopupRedux.d.ts +5 -13
  176. package/src/Redux/ActionsReducers/PopupRedux.js +1 -22
  177. package/src/Redux/ActionsReducers/SystemRedux.d.ts +15 -4
  178. package/src/Redux/ActionsReducers/SystemRedux.js +27 -11
  179. package/src/Redux/Store/AdaptableStore.js +47 -29
  180. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +2 -2
  181. package/src/Strategy/AdaptableModuleBase.d.ts +10 -10
  182. package/src/Strategy/AdaptableModuleBase.js +13 -16
  183. package/src/Strategy/AlertModule.d.ts +3 -2
  184. package/src/Strategy/AlertModule.js +4 -4
  185. package/src/Strategy/BulkUpdateModule.d.ts +3 -2
  186. package/src/Strategy/BulkUpdateModule.js +2 -1
  187. package/src/Strategy/CalculatedColumnModule.d.ts +3 -4
  188. package/src/Strategy/CalculatedColumnModule.js +18 -14
  189. package/src/Strategy/CellSummaryModule.d.ts +10 -9
  190. package/src/Strategy/CellSummaryModule.js +101 -83
  191. package/src/Strategy/ColumnFilterModule.d.ts +3 -3
  192. package/src/Strategy/ColumnFilterModule.js +36 -57
  193. package/src/Strategy/ColumnInfoModule.d.ts +3 -3
  194. package/src/Strategy/ColumnInfoModule.js +6 -4
  195. package/src/Strategy/CommentModule.d.ts +12 -0
  196. package/src/Strategy/CommentModule.js +75 -0
  197. package/src/Strategy/CustomSortModule.d.ts +1 -2
  198. package/src/Strategy/CustomSortModule.js +3 -2
  199. package/src/Strategy/DashboardModule.d.ts +3 -3
  200. package/src/Strategy/DashboardModule.js +10 -20
  201. package/src/Strategy/DataImportModule.d.ts +4 -4
  202. package/src/Strategy/DataImportModule.js +8 -8
  203. package/src/Strategy/ExportModule.d.ts +1 -2
  204. package/src/Strategy/ExportModule.js +56 -42
  205. package/src/Strategy/Fdc3Module.d.ts +1 -1
  206. package/src/Strategy/Fdc3Module.js +3 -13
  207. package/src/Strategy/FlashingCellModule.d.ts +4 -3
  208. package/src/Strategy/FlashingCellModule.js +10 -10
  209. package/src/Strategy/FormatColumnModule.d.ts +1 -1
  210. package/src/Strategy/FormatColumnModule.js +29 -47
  211. package/src/Strategy/FreeTextColumnModule.d.ts +1 -2
  212. package/src/Strategy/FreeTextColumnModule.js +2 -2
  213. package/src/Strategy/GridInfoModule.d.ts +3 -3
  214. package/src/Strategy/GridInfoModule.js +5 -3
  215. package/src/Strategy/Interface/IModule.d.ts +4 -4
  216. package/src/Strategy/LayoutModule.d.ts +4 -3
  217. package/src/Strategy/LayoutModule.js +71 -72
  218. package/src/Strategy/NoteModule.d.ts +10 -0
  219. package/src/Strategy/NoteModule.js +60 -0
  220. package/src/Strategy/PlusMinusModule.d.ts +1 -2
  221. package/src/Strategy/PlusMinusModule.js +5 -5
  222. package/src/Strategy/SettingsPanelModule.d.ts +3 -3
  223. package/src/Strategy/SettingsPanelModule.js +6 -6
  224. package/src/Strategy/ShortcutModule.js +1 -1
  225. package/src/Strategy/SmartEditModule.d.ts +3 -2
  226. package/src/Strategy/SmartEditModule.js +2 -1
  227. package/src/Strategy/StyledColumnModule.d.ts +2 -1
  228. package/src/Strategy/StyledColumnModule.js +42 -22
  229. package/src/Strategy/SystemStatusModule.d.ts +3 -3
  230. package/src/Strategy/SystemStatusModule.js +6 -3
  231. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +4 -2
  232. package/src/Strategy/Utilities/getScopeViewItems.d.ts +2 -2
  233. package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
  234. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  235. package/src/Utilities/Constants/GeneralConstants.js +3 -2
  236. package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
  237. package/src/Utilities/Constants/ModuleConstants.js +7 -7
  238. package/src/Utilities/Defaults/DefaultSettingsPanel.js +2 -2
  239. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -2
  240. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +434 -3
  241. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
  242. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
  243. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
  244. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
  245. package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
  246. package/src/Utilities/Extensions/ArrayExtensions.js +6 -1
  247. package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -1
  248. package/src/Utilities/Helpers/AdaptableHelper.js +21 -1
  249. package/src/Utilities/Interface/MessagePopups.d.ts +0 -3
  250. package/src/Utilities/MenuItem.d.ts +10 -7
  251. package/src/Utilities/MenuItem.js +6 -3
  252. package/src/Utilities/ObjectFactory.d.ts +3 -3
  253. package/src/Utilities/ObjectFactory.js +7 -25
  254. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +4 -2
  255. package/src/Utilities/Services/AggregatedScalarLiveValue.js +23 -18
  256. package/src/Utilities/Services/CellPopupService.js +4 -4
  257. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
  258. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -4
  259. package/src/Utilities/Services/LicenseService/index.js +1 -195
  260. package/src/Utilities/Services/ModuleService.js +6 -2
  261. package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
  262. package/src/Utilities/Services/QueryLanguageService.js +4 -3
  263. package/src/Utilities/Services/ReportService.d.ts +7 -5
  264. package/src/Utilities/Services/ReportService.js +245 -26
  265. package/src/Utilities/Services/RowSummaryService.d.ts +26 -0
  266. package/src/Utilities/Services/RowSummaryService.js +160 -0
  267. package/src/Utilities/Services/ValidationService.js +2 -2
  268. package/src/Utilities/adaptableQlUtils.d.ts +2 -0
  269. package/src/Utilities/adaptableQlUtils.js +18 -0
  270. package/src/Utilities/license/decode.js +1 -70
  271. package/src/Utilities/license/hashing.js +1 -47
  272. package/src/View/AdaptableViewFactory.js +2 -2
  273. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +1 -1
  274. package/src/View/Alert/AlertEntityRow.js +1 -1
  275. package/src/View/Alert/Utilities/getAvailablePredicates.d.ts +2 -2
  276. package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +1 -1
  277. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +2 -2
  278. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
  279. package/src/View/BulkUpdate/BulkUpdatePopup.js +2 -2
  280. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
  281. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +3 -3
  282. package/src/View/ColumnInfo/ColumnInfo.js +1 -1
  283. package/src/View/Comments/CommentsEditor.js +28 -17
  284. package/src/View/Comments/CommentsPopup.js +15 -7
  285. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  286. package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.d.ts +5 -0
  287. package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.js +46 -0
  288. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +5 -2
  289. package/src/View/Components/CellPopup/index.d.ts +1 -0
  290. package/src/View/Components/CellPopup/index.js +6 -3
  291. package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.d.ts +3 -3
  292. package/src/View/Components/EntityRulesEditor/index.d.ts +3 -3
  293. package/src/View/Components/FilterForm/FilterForm.js +20 -12
  294. package/src/View/Components/FilterForm/QuickFilterForm.js +15 -8
  295. package/src/View/Components/FilterForm/QuickFilterValues.js +39 -23
  296. package/src/View/Components/NewScopeComponent.d.ts +5 -5
  297. package/src/View/Components/NewScopeComponent.js +36 -3
  298. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +4 -1
  299. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +10 -1
  300. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +7 -10
  301. package/src/View/Components/RangesComponent.d.ts +2 -2
  302. package/src/View/Components/RangesComponent.js +1 -1
  303. package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
  304. package/src/View/Components/SharedProps/WizardScopeState.d.ts +2 -2
  305. package/src/View/Components/ValueSelector/index.d.ts +1 -0
  306. package/src/View/Components/ValueSelector/index.js +2 -2
  307. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +1 -1
  308. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +4 -2
  309. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -1
  310. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +2 -2
  311. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +20 -7
  312. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -1
  313. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -1
  314. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +27 -12
  315. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +1 -1
  316. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
  317. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
  318. package/src/View/GridFilter/GridFilterViewPanel.js +3 -3
  319. package/src/View/GridFilter/useGridFilterExpressionEditor.js +1 -1
  320. package/src/View/Layout/LayoutViewPanel.js +2 -1
  321. package/src/View/Layout/TransposedPopup.js +27 -25
  322. package/src/View/Layout/Wizard/LayoutWizard.js +38 -3
  323. package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
  324. package/src/View/Layout/Wizard/sections/FilterSection.js +1 -1
  325. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +18 -2
  326. package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +9 -0
  327. package/src/View/Layout/Wizard/sections/RowSummarySection.js +181 -0
  328. package/src/View/License/LicenseWatermark.js +1 -66
  329. package/src/View/Note/NotePopup.d.ts +2 -0
  330. package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +16 -11
  331. package/src/View/PlusMinus/PlusMinusSummary.js +2 -2
  332. package/src/View/SmartEdit/SmartEditPopup.js +1 -1
  333. package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
  334. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +5 -7
  335. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -1
  336. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +1 -1
  337. package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +38 -14
  338. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +1 -1
  339. package/src/agGrid/ActionColumnRenderer.js +40 -4
  340. package/src/agGrid/AdaptableAgGrid.d.ts +21 -12
  341. package/src/agGrid/AdaptableAgGrid.js +313 -225
  342. package/src/agGrid/AgGridAdapter.d.ts +5 -2
  343. package/src/agGrid/AgGridAdapter.js +20 -0
  344. package/src/agGrid/AgGridColumnAdapter.d.ts +1 -3
  345. package/src/agGrid/AgGridColumnAdapter.js +52 -70
  346. package/src/agGrid/AgGridMenuAdapter.d.ts +25 -8
  347. package/src/agGrid/AgGridMenuAdapter.js +405 -74
  348. package/src/agGrid/AgGridOptionsService.d.ts +4 -1
  349. package/src/agGrid/AgGridOptionsService.js +22 -0
  350. package/src/agGrid/BadgeRenderer.d.ts +2 -2
  351. package/src/agGrid/BadgeRenderer.js +24 -11
  352. package/src/agGrid/PercentBarRenderer.js +2 -1
  353. package/src/agGrid/buildSortedColumnStateForLayout.d.ts +7 -0
  354. package/src/agGrid/buildSortedColumnStateForLayout.js +124 -0
  355. package/src/agGrid/defaultAdaptableOptions.js +7 -12
  356. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -1
  357. package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
  358. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
  359. package/src/agGrid/sortColumnStateForVisibleColumns.d.ts +12 -0
  360. package/src/agGrid/sortColumnStateForVisibleColumns.js +50 -0
  361. package/src/agGrid/weightedAverage.d.ts +0 -2
  362. package/src/agGrid/weightedAverage.js +1 -56
  363. package/src/components/Accordion.d.ts +7 -0
  364. package/src/components/Accordion.js +41 -0
  365. package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
  366. package/src/components/Datepicker/index.d.ts +1 -1
  367. package/src/components/Datepicker/index.js +10 -2
  368. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
  369. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
  370. package/src/components/ExpressionEditor/QueryBuilder/utils.js +3 -17
  371. package/src/components/Input/index.d.ts +1 -2
  372. package/src/components/List/ListGroupItem/index.d.ts +1 -1
  373. package/src/components/ProgressIndicator/ProgressIndicator.js +15 -6
  374. package/src/components/Select/Select.d.ts +1 -1
  375. package/src/components/Select/Select.js +3 -1
  376. package/src/components/Textarea/index.d.ts +2 -2
  377. package/src/components/icons/collapse-all.d.ts +3 -0
  378. package/src/components/icons/collapse-all.js +7 -0
  379. package/src/components/icons/copy.d.ts +3 -0
  380. package/src/components/icons/copy.js +7 -0
  381. package/src/components/icons/csv.d.ts +3 -0
  382. package/src/components/icons/csv.js +7 -0
  383. package/src/components/icons/data-object.d.ts +3 -0
  384. package/src/components/icons/data-object.js +7 -0
  385. package/src/components/icons/excel.d.ts +3 -0
  386. package/src/components/icons/excel.js +8 -0
  387. package/src/components/icons/expand-all.d.ts +3 -0
  388. package/src/components/icons/expand-all.js +7 -0
  389. package/src/components/icons/filter-off.d.ts +3 -0
  390. package/src/components/icons/filter-off.js +7 -0
  391. package/src/components/icons/grid-info.d.ts +3 -0
  392. package/src/components/icons/grid-info.js +7 -0
  393. package/src/components/icons/index.js +24 -0
  394. package/src/components/icons/note.js +2 -2
  395. package/src/components/icons/rows.d.ts +3 -0
  396. package/src/components/icons/rows.js +7 -0
  397. package/src/components/icons/select-all.d.ts +3 -0
  398. package/src/components/icons/select-all.js +7 -0
  399. package/src/components/icons/select-fwd.d.ts +3 -0
  400. package/src/components/icons/select-fwd.js +7 -0
  401. package/src/components/icons/select-off.d.ts +3 -0
  402. package/src/components/icons/select-off.js +7 -0
  403. package/src/env.js +2 -2
  404. package/src/metamodel/adaptable.metamodel.d.ts +230 -116
  405. package/src/metamodel/adaptable.metamodel.js +1 -9411
  406. package/src/parser/src/parser.js +576 -553
  407. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
  408. package/src/parser/src/predicate/mapQlPredicateToExpression.js +3 -4
  409. package/src/parser/src/types.d.ts +7 -2
  410. package/src/parser/src/types.js +1 -2
  411. package/src/types.d.ts +32 -25
  412. package/tsconfig.cjs.tsbuildinfo +1 -1
  413. package/src/AdaptableOptions/MenuOptions.d.ts +0 -234
  414. package/src/AdaptableOptions/MenuOptions.js +0 -99
  415. package/src/Api/Events/CommentsChangedInfo.d.ts +0 -5
  416. package/src/Api/Implementation/NotesApiImpl.d.ts +0 -14
  417. package/src/Api/Implementation/NotesApiImpl.js +0 -40
  418. package/src/Api/Implementation/ScopeApiImpl.d.ts +0 -31
  419. package/src/Api/NotesApi.d.ts +0 -48
  420. package/src/PredefinedConfig/CellAddress.d.ts +0 -13
  421. package/src/PredefinedConfig/CellAddress.js +0 -5
  422. package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -38
  423. package/src/Strategy/CommentsModule.d.ts +0 -17
  424. package/src/Strategy/CommentsModule.js +0 -83
  425. package/src/Strategy/NotesModule.d.ts +0 -10
  426. package/src/Strategy/NotesModule.js +0 -62
  427. package/src/View/Components/ScopeComponent.d.ts +0 -24
  428. package/src/View/Components/ScopeComponent.js +0 -138
  429. package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
  430. package/src/View/Export/Wizard/ReportScopeWizard.js +0 -52
  431. package/src/View/Notes/NotesPopup.d.ts +0 -2
  432. /package/src/{Api/Events/CommentsChangedInfo.js → AdaptableOptions/ColumnMenuOptions.js} +0 -0
  433. /package/src/{Api/NotesApi.js → AdaptableOptions/ContextMenuOptions.js} +0 -0
  434. /package/src/Api/{ScopeApi.js → ColumnMenuApi.js} +0 -0
  435. /package/src/{PredefinedConfig/Common/AdaptableScope.js → Api/ColumnScopeApi.js} +0 -0
  436. /package/src/{PredefinedConfig/NotesState.js → Api/ContextMenuApi.js} +0 -0
  437. /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
  438. /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
@@ -63,12 +63,12 @@ const ColumnInfoModule_1 = require("../Strategy/ColumnInfoModule");
63
63
  const SettingsPanelModule_1 = require("../Strategy/SettingsPanelModule");
64
64
  const StatusBarModule_1 = require("../Strategy/StatusBarModule");
65
65
  const ChartingModule_1 = require("../Strategy/ChartingModule");
66
- const NotesModule_1 = require("../Strategy/NotesModule");
66
+ const NoteModule_1 = require("../Strategy/NoteModule");
67
67
  const StyledColumnModule_1 = require("../Strategy/StyledColumnModule");
68
68
  const Fdc3Module_1 = require("../Strategy/Fdc3Module");
69
69
  const GridFilterModule_1 = require("../Strategy/GridFilterModule");
70
70
  const NamedQueryModule_1 = require("../Strategy/NamedQueryModule");
71
- const CommentsModule_1 = require("../Strategy/CommentsModule");
71
+ const CommentModule_1 = require("../Strategy/CommentModule");
72
72
  const AdaptableNumberEditor_1 = require("./editors/AdaptableNumberEditor");
73
73
  const AdaptableDateEditor_1 = require("./editors/AdaptableDateEditor");
74
74
  const Helper_1 = require("../Utilities/Helpers/Helper");
@@ -99,6 +99,8 @@ const AdaptableUpgradeHelper_1 = require("../migration/AdaptableUpgradeHelper");
99
99
  const Modal_1 = require("../components/Modal");
100
100
  const AdaptableLoadingScreen_1 = require("../View/Components/Popups/AdaptableLoadingScreen");
101
101
  const react_1 = require("react");
102
+ const AdaptableHelper_1 = require("../Utilities/Helpers/AdaptableHelper");
103
+ const buildSortedColumnStateForLayout_1 = require("./buildSortedColumnStateForLayout");
102
104
  const RowNodeProto = core_1.RowNode.prototype;
103
105
  const RowNode_dispatchLocalEvent = RowNodeProto.dispatchLocalEvent;
104
106
  /**
@@ -142,6 +144,11 @@ const adaptableInstances = {};
142
144
  const publishTimestamp = Number(EnvVars_1.ADAPTABLE_PUBLISH_TIMESTAMP);
143
145
  class AdaptableAgGrid {
144
146
  constructor() {
147
+ /**
148
+ * once layouts are properly handled with the new aggrid methods & events
149
+ * we can remove this hack
150
+ */
151
+ this.previousAgGridLayoutState = '';
145
152
  this.columnMinMaxValuesCache = {};
146
153
  this.renderReactRoot = (node, container) => (0, renderReactRoot_1.renderReactRoot)(node, container);
147
154
  /**
@@ -252,11 +259,11 @@ class AdaptableAgGrid {
252
259
  async _initAdaptableAgGrid(config) {
253
260
  var _a, _b;
254
261
  // Phase 1: Preprocess Adaptable Options
262
+ this._isDetailGrid = config.isDetailGrid === true;
255
263
  this.lifecycleState = 'preprocessOptions';
256
264
  this._rawAdaptableOptions = config.adaptableOptions;
257
265
  if (StringExtensions_1.default.IsNullOrEmptyOrWhiteSpace(this._rawAdaptableOptions.adaptableId)) {
258
- AdaptableLogger_1.AdaptableLogger.consoleErrorBase(`'AdaptableOptions.adaptableId' is a required property and cannot be empty or null`);
259
- this._rawAdaptableOptions.adaptableId = `AdapTable_${Date.now()}`;
266
+ this._rawAdaptableOptions.adaptableId = `adaptable_id_${Date.now()}`;
260
267
  }
261
268
  this.logger = (_a = this.logger) !== null && _a !== void 0 ? _a : new AdaptableLogger_1.AdaptableLogger(this._rawAdaptableOptions.adaptableId);
262
269
  const perfInitAdaptableAgGrid = this.logger.beginPerf(`Adaptable._initAdaptableAgGrid()`);
@@ -294,6 +301,7 @@ class AdaptableAgGrid {
294
301
  this.forPlugins((plugin) => plugin.afterInitModules(this, this.adaptableModules));
295
302
  const perfLoadStore = this.logger.beginPerf(`loadStore()`);
296
303
  this.adaptableStore = this.initAdaptableStore();
304
+ this.forPlugins((plugin) => plugin.afterInitStore(this));
297
305
  await this.adaptableStore.loadStore({
298
306
  adaptable: this,
299
307
  adaptableStateKey: this.adaptableOptions.adaptableStateKey,
@@ -303,15 +311,14 @@ class AdaptableAgGrid {
303
311
  * e.g. adding default Layout, migrating deprecated state, etc.
304
312
  */
305
313
  postLoadHook: (state) => {
306
- if (this.adaptableOptions.autoMigrateState) {
314
+ if (this.adaptableOptions.stateOptions.autoMigrateState) {
307
315
  state = AdaptableUpgradeHelper_1.AdaptableUpgradeHelper.migrateAdaptableState(state, {
308
316
  // version 16 actually includes all versions up until 16
309
317
  fromVersion: 16,
310
318
  logger: this.logger,
311
319
  });
312
320
  }
313
- state = this.normaliseLayoutState(state, config);
314
- state = this.normaliseToolPanelState(state);
321
+ state = this.normalizeAdaptableState(state, config.gridOptions);
315
322
  return state;
316
323
  },
317
324
  });
@@ -321,8 +328,7 @@ class AdaptableAgGrid {
321
328
  return Promise.reject('Adaptable was destroyed while loading the store.');
322
329
  // FIXME AFL MIG: is this enough?! talk with the team
323
330
  }
324
- this.forPlugins((plugin) => plugin.afterInitServices(this));
325
- this.forPlugins((plugin) => plugin.afterInitModules(this, this.adaptableModules));
331
+ this.forPlugins((plugin) => plugin.afterInitialStateLoaded(this));
326
332
  // do this now so it sets module entitlements
327
333
  this.EntitlementService.setModulesEntitlements();
328
334
  /**
@@ -358,7 +364,7 @@ class AdaptableAgGrid {
358
364
  this.api.themeApi.applyCurrentTheme();
359
365
  this.validatePrimaryKey();
360
366
  this.embedColumnMenu = this.agGridAdapter.isModulePresent(core_1.ModuleNames.MenuModule);
361
- this.api.internalApi.setTreeMode(this.agGridAdapter.initialGridOptions.treeData);
367
+ this.api.internalApi.setTreeMode(!!this.agGridAdapter.getAgGridApi().getGridOption('treeData'));
362
368
  // TODO AFL MIG: we could just patch the defautl Layout on init? instead
363
369
  this.checkShouldClearExistingFiltersOrSearches();
364
370
  this.applyColumnFiltering();
@@ -366,6 +372,16 @@ class AdaptableAgGrid {
366
372
  this.temporaryAdaptableStateUpdates();
367
373
  this.redrawBody();
368
374
  this.refreshHeader();
375
+ const currentLayout = this.api.layoutApi.getCurrentLayout();
376
+ if (currentLayout.EnablePivot) {
377
+ // this is very very strange!
378
+ // for some projects, if the initial layout is pivot, the columnDefs of the pivot resutl columns are NOT derived correctly from the main colDefs
379
+ // doing the following line fixes the issue because it foces the pivot columns to be created again
380
+ // this proj works without the hack: /tests/pages/format-column/initial-pivot-layout.page.tsx
381
+ // but this proj needs the hack: /tests/pages/format-column/initial-pivot-layout-docs.page.tsx
382
+ this.agGridAdapter.setGridOption('pivotMode', false);
383
+ this.agGridAdapter.setGridOption('pivotMode', true);
384
+ }
369
385
  // create the module menu (for use in the dashboard and the toolpanel)
370
386
  // TODO see #create-create-module-menu - make sure it's the same here and there
371
387
  this.ModuleService.createModuleMenus();
@@ -382,14 +398,18 @@ class AdaptableAgGrid {
382
398
  adaptableApi: this.api,
383
399
  agGridApi: this.agGridAdapter.getAgGridApi(),
384
400
  });
385
- this.api.userInterfaceApi.hideLoadingScreen();
386
401
  perfInitAdaptableAgGrid.end();
387
402
  return Promise.resolve(this.api);
388
403
  }
389
- normaliseLayoutState(state, config) {
404
+ normalizeAdaptableState(state, gridOptions) {
405
+ state = this.normaliseLayoutState(state, gridOptions);
406
+ state = this.normaliseToolPanelState(state);
407
+ return state;
408
+ }
409
+ normaliseLayoutState(state, gridOptions) {
390
410
  var _a, _b, _c, _d, _e, _f;
391
411
  if (this.shouldCreateDefaultLayout(state, this.adaptableOptions)) {
392
- const defaultLayout = this.createDefaultLayout(state, config.gridOptions.columnDefs);
412
+ const defaultLayout = this.createDefaultLayout(state, gridOptions.columnDefs);
393
413
  const layoutState = state.Layout || {};
394
414
  const availableLayouts = layoutState.Layouts || [];
395
415
  availableLayouts.push(defaultLayout);
@@ -425,7 +445,7 @@ class AdaptableAgGrid {
425
445
  * logic where layout is applied, it is easier and
426
446
  * less error prone to just remove it.
427
447
  */
428
- if (config.gridOptions.rowModelType === 'viewport') {
448
+ if (gridOptions.rowModelType === 'viewport') {
429
449
  (_f = state.Layout.Layouts) === null || _f === void 0 ? void 0 : _f.forEach((layout) => {
430
450
  if (layout.RowGroupedColumns) {
431
451
  delete layout.RowGroupedColumns;
@@ -455,15 +475,19 @@ class AdaptableAgGrid {
455
475
  state.ToolPanel = toolPanelState;
456
476
  return state;
457
477
  }
458
- applyColumnFiltering() {
459
- if (this.api.columnFilterApi.isQuickFilterAvailable()) {
460
- if (this.api.columnFilterApi.isQuickFilterVisible()) {
461
- this.showQuickFilter();
478
+ refreshQuickFilter() {
479
+ const isQuickFilterVisible = this.api.internalApi.getSystemState().IsQuickFilterVisible;
480
+ if (this.isQuickFilterAvailable()) {
481
+ if (isQuickFilterVisible) {
482
+ this.api.columnFilterApi.showQuickFilterBar();
462
483
  }
463
484
  else {
464
- this.hideQuickFilter();
485
+ this.api.columnFilterApi.hideQuickFilterBar();
465
486
  }
466
487
  }
488
+ }
489
+ applyColumnFiltering() {
490
+ this.refreshQuickFilter();
467
491
  this.applyGridFiltering();
468
492
  this.agGridAdapter.updateColumnFilterActiveState();
469
493
  }
@@ -706,6 +730,20 @@ class AdaptableAgGrid {
706
730
  return nodeA.key < nodeB.key ? -1 : 1;
707
731
  };
708
732
  });
733
+ /**
734
+ * `autoSizeStrategy`
735
+ *
736
+ * This is needed here, even if we do auto sizing on FIRST_DATA_RENDERED.
737
+ * Sometimes FIRST_DATA_RENDERED is triggered too early and autoSizing doesn't work initially
738
+ * so we need this block
739
+ */
740
+ this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'autoSizeStrategy', (original_autoSizeStrategy) => {
741
+ return this.shouldAutoSizeLayout()
742
+ ? {
743
+ type: 'fitCellContents',
744
+ }
745
+ : original_autoSizeStrategy;
746
+ });
709
747
  }
710
748
  /**
711
749
  * `components`
@@ -854,12 +892,40 @@ class AdaptableAgGrid {
854
892
  return (returnValue === null || returnValue === void 0 ? void 0 : returnValue.length) ? returnValue : undefined;
855
893
  };
856
894
  });
895
+ /**
896
+ * `floatingFiltersHeight`
897
+ */
898
+ this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'floatingFiltersHeight', (original_floatingFiltersHeight) => {
899
+ if (this.api.layoutApi.getCurrentLayout().EnablePivot) {
900
+ // if the default layout is a pivot on, hide the floating filters from the beginning, otherwise we get an annoying flicker
901
+ return 0;
902
+ }
903
+ return original_floatingFiltersHeight;
904
+ });
905
+ /**
906
+ * `excelStyles`
907
+ */
908
+ this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'excelStyles', (original_excelStyles) => {
909
+ // we need this here just to register the original excelStyles in the service
910
+ return original_excelStyles;
911
+ });
912
+ /**
913
+ * `processPivotResultColDef`
914
+ */
915
+ this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'processPivotResultColDef', () => {
916
+ return (colDef) => {
917
+ if (this.adaptableOptions.columnFilterOptions.useAdaptableColumnFiltering) {
918
+ colDef.floatingFilter = false;
919
+ colDef.filter = false;
920
+ }
921
+ };
922
+ });
857
923
  /**
858
924
  * `columnTypes`
859
925
  */
860
926
  // this will have to go/be heavily extended with https://github.com/AdaptableTools/adaptable/issues/2230
861
927
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'columnTypes', (original_columnTypes) => {
862
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
928
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
863
929
  const providedColumnTypes = original_columnTypes || {};
864
930
  const gridOptionsColumnTypes = gridOptions.columnTypes || {};
865
931
  const patchedColumnTypes = Object.assign(providedColumnTypes, {
@@ -876,6 +942,12 @@ class AdaptableAgGrid {
876
942
  abColDefTupleNumberArray: (_j = gridOptionsColumnTypes.abColDefTupleNumberArray) !== null && _j !== void 0 ? _j : {},
877
943
  abColDefObjectNumberArray: (_k = gridOptionsColumnTypes.abColDefObjectNumberArray) !== null && _k !== void 0 ? _k : {},
878
944
  });
945
+ const customColumnTypes = (_l = this.api.columnApi.getColumnTypes()) !== null && _l !== void 0 ? _l : [];
946
+ for (const customColumnType of customColumnTypes) {
947
+ if (!patchedColumnTypes[customColumnType]) {
948
+ patchedColumnTypes[customColumnType] = {};
949
+ }
950
+ }
879
951
  if (patchedColumnTypes.abColDefNumber.cellEditor == undefined) {
880
952
  patchedColumnTypes.abColDefNumber.cellEditor =
881
953
  this.variant === 'react' ? AdaptableNumberEditor_1.ReactAdaptableNumberEditor : AdaptableNumberEditor_1.AdaptableNumberEditor;
@@ -910,6 +982,9 @@ class AdaptableAgGrid {
910
982
  return revertedDateTypeDefinitions;
911
983
  });
912
984
  }
985
+ isDetailGrid() {
986
+ return this._isDetailGrid;
987
+ }
913
988
  /**
914
989
  * Either initializes the AG Grid instance or delegates it to the framework wrappers (React/Anglar)
915
990
  */
@@ -923,7 +998,9 @@ class AdaptableAgGrid {
923
998
  // framework wrapper may pass the rowData as a prop
924
999
  const rowData = agGridApi.getGridOption('rowData');
925
1000
  this.initWithLazyData = rowData == undefined || rowData.length === 0;
926
- this.logger.info('initWithLazyData = TRUE');
1001
+ if (this.initWithLazyData) {
1002
+ this.logger.info('initWithLazyData = TRUE');
1003
+ }
927
1004
  if (!this.getAgGridContainerElement()) {
928
1005
  // initialize the agGridContainerElement from the AgGrid instance
929
1006
  // @ts-ignore
@@ -951,19 +1028,21 @@ class AdaptableAgGrid {
951
1028
  }
952
1029
  getAllColumnDefinitions(agGridColDefs) {
953
1030
  const allColDefs = this.enhanceColDefsWithSpecialColumns(agGridColDefs !== null && agGridColDefs !== void 0 ? agGridColDefs : this.agGridAdapter.getAgGridApi().getColumnDefs());
954
- this.agGridAdapter.assignColumnIdsToColDefs(allColDefs);
955
1031
  return allColDefs;
956
1032
  }
957
1033
  getSpecialColDefs() {
958
- return [
1034
+ const specialColDefs = [
959
1035
  ...this.api.calculatedColumnApi.internalApi.getColDefsForCalculatedColumns(),
960
1036
  ...this.api.actionColumnApi.getColDefsForActionColumns(),
961
1037
  ...this.api.freeTextColumnApi.internalApi.getColDefsForFreeTextColumns(),
962
1038
  ...this.api.actionRowApi.internalApi.getColDefsForActionRowColumns(),
963
1039
  ...this.api.fdc3Api.internalApi.getFdc3ActionColDefs(),
964
1040
  ];
1041
+ this.agGridAdapter.assignColumnIdsToColDefs(specialColDefs);
1042
+ return specialColDefs;
965
1043
  }
966
1044
  enhanceColDefsWithSpecialColumns(agGridColDefs) {
1045
+ this.agGridAdapter.assignColumnIdsToColDefs(agGridColDefs);
967
1046
  const specialColDefs = this.getSpecialColDefs();
968
1047
  const isSpecialColDef = (colDef) => {
969
1048
  const { type } = colDef;
@@ -987,7 +1066,9 @@ class AdaptableAgGrid {
987
1066
  else {
988
1067
  if (!isSpecialColDef(colDef)) {
989
1068
  // if it's not a special column, return it as is
990
- return colDef;
1069
+ // without a minWidth, columns in details grid are VERY wide
1070
+ // so the line below fixes https://github.com/AdaptableTools/adaptable/issues/2559
1071
+ return Object.assign({ minWidth: 10 }, colDef);
991
1072
  }
992
1073
  const newlyCreatedSpecialColDef = specialColDefs.find((specialColDef) => specialColDef.colId === colDef.colId);
993
1074
  if (newlyCreatedSpecialColDef) {
@@ -995,7 +1076,9 @@ class AdaptableAgGrid {
995
1076
  processedSpecialColDefIds.push(colDef.colId);
996
1077
  // merge the user defined colDef with the special col def
997
1078
  // this way the user may provide some custom settings for the special col def (tooltip, etc)
998
- const mergedColDef = Object.assign(Object.assign({}, colDef), newlyCreatedSpecialColDef);
1079
+ const mergedColDef = Object.assign(Object.assign({
1080
+ // see above comment for minWidth
1081
+ minWidth: 10 }, colDef), newlyCreatedSpecialColDef);
999
1082
  return mergedColDef;
1000
1083
  }
1001
1084
  else {
@@ -1024,7 +1107,7 @@ class AdaptableAgGrid {
1024
1107
  return resultColDefs;
1025
1108
  }
1026
1109
  useRowNodeLookUp() {
1027
- return this.agGridAdapter.initialGridOptions.getRowId != undefined;
1110
+ return this.agGridAdapter.getAgGridApi().getGridOption('getRowId') != undefined;
1028
1111
  }
1029
1112
  getAgGridContainerElement() {
1030
1113
  if (!this.DANGER_USE_GETTER_agGridContainerElement) {
@@ -1047,10 +1130,7 @@ class AdaptableAgGrid {
1047
1130
  // This method returns selected cells ONLY (if selection mode is cells or multiple cells).
1048
1131
  // If the selection mode is row it will returns nothing - use the setSelectedRows() method
1049
1132
  refreshSelectedCellsState() {
1050
- var _a;
1051
- const isRangeSelectionModuleRegistered = this.agGridAdapter.isModulePresent(core_1.ModuleNames.RangeSelectionModule);
1052
- if (!isRangeSelectionModuleRegistered ||
1053
- !((_a = this.agGridAdapter.getLiveGridOptions()) === null || _a === void 0 ? void 0 : _a.enableRangeSelection) === true) {
1133
+ if (!this.isGridRangeSelectable()) {
1054
1134
  return;
1055
1135
  }
1056
1136
  const selectedCellInfo = this.agGridAdapter.deriveSelectedCellInfoFromAgGrid();
@@ -1061,8 +1141,8 @@ class AdaptableAgGrid {
1061
1141
  return selectedCellInfo;
1062
1142
  }
1063
1143
  refreshSelectedRowsState() {
1064
- if (!this.isGridSelectable()) {
1065
- return undefined;
1144
+ if (!this.isGridRowSelectable()) {
1145
+ return;
1066
1146
  }
1067
1147
  const selectedRowInfo = this.agGridAdapter.deriveSelectedRowInfoFromAgGrid();
1068
1148
  this.api.gridApi.internalApi.setSelectedRows(selectedRowInfo);
@@ -1070,9 +1150,13 @@ class AdaptableAgGrid {
1070
1150
  this.api.eventApi.emit('RowSelectionChanged', rowSelectionChangedInfo);
1071
1151
  return selectedRowInfo;
1072
1152
  }
1073
- isGridSelectable() {
1074
- return (this.agGridAdapter.initialGridOptions.rowSelection === 'single' ||
1075
- this.agGridAdapter.initialGridOptions.rowSelection === 'multiple');
1153
+ isGridRowSelectable() {
1154
+ const rowSelection = this.agGridAdapter.getAgGridApi().getGridOption('rowSelection');
1155
+ return rowSelection === 'single' || rowSelection === 'multiple';
1156
+ }
1157
+ isGridRangeSelectable() {
1158
+ return (this.agGridAdapter.isModulePresent(core_1.ModuleNames.RangeSelectionModule) &&
1159
+ this.agGridAdapter.getGridOption('enableRangeSelection'));
1076
1160
  }
1077
1161
  initAdaptableStore() {
1078
1162
  const perfNewAdaptableStore = this.logger.beginPerf(`initAdaptableStore()`);
@@ -1088,15 +1172,26 @@ class AdaptableAgGrid {
1088
1172
  var _a, _b, _c;
1089
1173
  const agGridState = {};
1090
1174
  const currentLayoutName = (_a = adaptableState.Layout) === null || _a === void 0 ? void 0 : _a.CurrentLayout;
1091
- const currentLayout = currentLayoutName &&
1175
+ const _currentLayout = currentLayoutName &&
1092
1176
  ((_c = (_b = adaptableState.Layout) === null || _b === void 0 ? void 0 : _b.Layouts) === null || _c === void 0 ? void 0 : _c.find((l) => l.Name === currentLayoutName));
1093
- if (!currentLayout) {
1177
+ if (!_currentLayout) {
1094
1178
  return agGridState;
1095
1179
  }
1096
- const allAgGridColDefIds = agGridColDefs.map((colDef) => colDef.colId);
1097
- const getColDef = (colId) => agGridColDefs.find((colDef) => colDef.colId == colId);
1180
+ const currentLayout = (0, AdaptableHelper_1.removeUuidAndSource)(_currentLayout);
1181
+ const allAgGridFlattenedColDefs = this.agGridAdapter.getFlattenedColDefs(agGridColDefs);
1182
+ const allAgGridColDefIds = allAgGridFlattenedColDefs.map((colDef) => colDef.colId);
1183
+ const { columnApi } = this.api;
1184
+ // also add the row group columns, if they are specified in the layout
1185
+ currentLayout.Columns.forEach((colId) => {
1186
+ if (columnApi.isAutoRowGroupColumn(colId)) {
1187
+ allAgGridColDefIds.push(colId);
1188
+ }
1189
+ });
1190
+ const getColDef = (colId) => allAgGridFlattenedColDefs.find((colDef) => colDef.colId === colId);
1098
1191
  agGridState.columnVisibility = {
1099
- hiddenColIds: allAgGridColDefIds.filter((colDefId) => { var _a; return !((_a = currentLayout.Columns) === null || _a === void 0 ? void 0 : _a.includes(colDefId)); }),
1192
+ hiddenColIds: allAgGridFlattenedColDefs
1193
+ .filter((colDef) => { var _a; return !((_a = currentLayout.Columns) === null || _a === void 0 ? void 0 : _a.includes(colDef.colId)) || colDef.hide || colDef.initialHide; })
1194
+ .map((colDef) => colDef.colId),
1100
1195
  };
1101
1196
  agGridState.columnOrder = {
1102
1197
  orderedColIds: (0, sortWithOrder_1.sortWithOrderArray)(allAgGridColDefIds, currentLayout.Columns || [], {
@@ -1239,7 +1334,9 @@ class AdaptableAgGrid {
1239
1334
  if (this.initWithLazyData) {
1240
1335
  this.updateColumnModelAndRefreshGrid();
1241
1336
  this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
1337
+ this._emit('FirstDataRendered');
1242
1338
  }
1339
+ this.autoSizeLayoutIfNeeded();
1243
1340
  }));
1244
1341
  /**
1245
1342
  * Use Case: Entered or Left Pivot Mode
@@ -1290,16 +1387,17 @@ class AdaptableAgGrid {
1290
1387
  // ADD filter event
1291
1388
  this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalColumnEventsThatTriggerAutoLayoutSave = (type) => {
1292
1389
  if (columnEventsThatTriggersAutoLayoutSave.indexOf(type) > -1) {
1293
- this.debouncedSaveGridLayout();
1390
+ this.debouncedSaveGridLayout(type);
1294
1391
  }
1295
1392
  }));
1296
1393
  /**
1297
1394
  * Save Layout if Display Row Groups is "dynamic
1298
1395
  */
1299
- this.debouncedSaveGridLayout = (0, debounce_1.default)(() => {
1396
+ this.debouncedSaveGridLayout = (0, debounce_1.default)((type) => {
1300
1397
  if (!this.isReady) {
1301
1398
  return;
1302
1399
  }
1400
+ this.logger.info('Event Triggering Auto Layout Save', type || '');
1303
1401
  this.updateLayoutFromGrid();
1304
1402
  }, GeneralConstants_1.HALF_SECOND);
1305
1403
  const rowGroupEventsThatTriggersAutoLayoutSave = [
@@ -1309,7 +1407,7 @@ class AdaptableAgGrid {
1309
1407
  this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = (type) => {
1310
1408
  if (rowGroupEventsThatTriggersAutoLayoutSave.indexOf(type) > -1) {
1311
1409
  if (this.adaptableOptions.layoutOptions.displayRowGroups == 'dynamic') {
1312
- this.debouncedSaveGridLayout();
1410
+ this.debouncedSaveGridLayout(type);
1313
1411
  }
1314
1412
  }
1315
1413
  }));
@@ -1333,7 +1431,7 @@ class AdaptableAgGrid {
1333
1431
  */
1334
1432
  this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_COLUMN_RESIZED, (this.listenerColumnResized = (params) => {
1335
1433
  if (params.finished == true && params.type == 'columnResized' && params.column) {
1336
- this.debouncedSaveGridLayout();
1434
+ this.debouncedSaveGridLayout(params.type);
1337
1435
  }
1338
1436
  }));
1339
1437
  /**
@@ -1380,26 +1478,6 @@ class AdaptableAgGrid {
1380
1478
  this.onSortChanged();
1381
1479
  this.debouncedSetSelectedCells();
1382
1480
  }));
1383
- const showGroupingTotalsAsHeader = this.adaptableOptions.groupingOptions.showGroupingTotalsAsHeader;
1384
- /**
1385
- * Use Case: Model has updated
1386
- * Action: If user has set to see grouping totals as header create a pinned row (bit of a hack)
1387
- */
1388
- this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_MODEL_UPDATED, (this.listenerModelUpdated = (params) => {
1389
- if (showGroupingTotalsAsHeader) {
1390
- if (params && params.api) {
1391
- const pinnedData = params.api.getPinnedTopRow(0);
1392
- const model = params.api.getModel();
1393
- const rootNode = model.getRootNode();
1394
- if (!pinnedData) {
1395
- params.api.setPinnedTopRowData([rootNode.aggData]);
1396
- }
1397
- else {
1398
- pinnedData.updateData(rootNode.aggData);
1399
- }
1400
- }
1401
- }
1402
- }));
1403
1481
  const eventsThatTriggerChartingChanges = [
1404
1482
  core_1.Events.EVENT_CHART_CREATED,
1405
1483
  /** Chart Range selection has changed */
@@ -1441,6 +1519,25 @@ class AdaptableAgGrid {
1441
1519
  },
1442
1520
  };
1443
1521
  }
1522
+ shouldAutoSizeLayout() {
1523
+ const { layoutApi } = this.api;
1524
+ const { layoutOptions } = this.adaptableOptions;
1525
+ const currentLayout = layoutApi.getCurrentLayout();
1526
+ if (currentLayout.ColumnWidthMap && Object.keys(currentLayout.ColumnWidthMap).length > 0) {
1527
+ return;
1528
+ }
1529
+ const autoSize = currentLayout.EnablePivot
1530
+ ? layoutOptions.autoSizeColumnsInPivotLayout
1531
+ : layoutOptions.autoSizeColumnsInLayout;
1532
+ return autoSize;
1533
+ }
1534
+ autoSizeLayoutIfNeeded() {
1535
+ if (this.shouldAutoSizeLayout()) {
1536
+ requestAnimationFrame(() => {
1537
+ this.autoSizeAllColumns();
1538
+ });
1539
+ }
1540
+ }
1444
1541
  performAudit(action, oldState, newState) {
1445
1542
  if (this.isReady) {
1446
1543
  const adaptableStateChangedInfo = {
@@ -1516,7 +1613,7 @@ class AdaptableAgGrid {
1516
1613
  modules.set(ModuleConstants.ChartingModuleId, new ChartingModule_1.ChartingModule(this.api));
1517
1614
  modules.set(ModuleConstants.ColumnFilterModuleId, new ColumnFilterModule_1.ColumnFilterModule(this.api));
1518
1615
  modules.set(ModuleConstants.ColumnInfoModuleId, new ColumnInfoModule_1.ColumnInfoModule(this.api));
1519
- modules.set(ModuleConstants.CommentsModuleId, new CommentsModule_1.CommentsModule(this.api));
1616
+ modules.set(ModuleConstants.CommentModuleId, new CommentModule_1.CommentModule(this.api));
1520
1617
  modules.set(ModuleConstants.CustomSortModuleId, new CustomSortModule_1.CustomSortModule(this.api));
1521
1618
  modules.set(ModuleConstants.DashboardModuleId, new DashboardModule_1.DashboardModule(this.api));
1522
1619
  modules.set(ModuleConstants.DataChangeHistoryModuleId, new DataChangeHistoryModule_1.DataChangeHistoryModule(this.api));
@@ -1531,7 +1628,7 @@ class AdaptableAgGrid {
1531
1628
  modules.set(ModuleConstants.GridInfoModuleId, new GridInfoModule_1.GridInfoModule(this.api));
1532
1629
  modules.set(ModuleConstants.LayoutModuleId, new LayoutModule_1.LayoutModule(this.api));
1533
1630
  modules.set(ModuleConstants.NamedQueryModuleId, new NamedQueryModule_1.NamedQueryModule(this.api));
1534
- modules.set(ModuleConstants.NotesModuleId, new NotesModule_1.NotesModule(this.api));
1631
+ modules.set(ModuleConstants.NoteModuleId, new NoteModule_1.NoteModule(this.api));
1535
1632
  modules.set(ModuleConstants.PlusMinusModuleId, new PlusMinusModule_1.PlusMinusModule(this.api));
1536
1633
  modules.set(ModuleConstants.QuickSearchModuleId, new QuickSearchModule_1.QuickSearchModule(this.api));
1537
1634
  modules.set(ModuleConstants.ScheduleModuleId, new ScheduleModule_1.ScheduleModule(this.api));
@@ -1556,7 +1653,9 @@ class AdaptableAgGrid {
1556
1653
  this.api.eventApi.on('AdaptableReady', () => {
1557
1654
  var _a, _b;
1558
1655
  // update status bar state
1559
- const adaptableStatusPanels = (_b = (_a = this.agGridAdapter.initialGridOptions.statusBar) === null || _a === void 0 ? void 0 : _a.statusPanels) === null || _b === void 0 ? void 0 : _b.filter((statusPanel) => this.adaptableStatusPanelKeys.includes(statusPanel.key));
1656
+ const adaptableStatusPanels = (_b = (_a = this.agGridAdapter
1657
+ .getAgGridApi()
1658
+ .getGridOption('statusBar')) === null || _a === void 0 ? void 0 : _a.statusPanels) === null || _b === void 0 ? void 0 : _b.filter((statusPanel) => this.adaptableStatusPanelKeys.includes(statusPanel.key));
1560
1659
  const statusBarModule = this.ModuleService.getModuleById(ModuleConstants.StatusBarModuleId);
1561
1660
  // need to add only the adaptable panels
1562
1661
  statusBarModule.syncStateWithOptions(adaptableStatusPanels);
@@ -1589,13 +1688,14 @@ class AdaptableAgGrid {
1589
1688
  // TODO AFL MIG: check why this assertion is here
1590
1689
  .getAllDisplayedColumnGroups();
1591
1690
  const groupsCount = {};
1592
- const colsToGroups = columnGroupChildren.reduce((acc, columnGroup) => {
1691
+ const colsToGroups = (columnGroupChildren !== null && columnGroupChildren !== void 0 ? columnGroupChildren : []).reduce((acc, columnGroup) => {
1593
1692
  var _a, _b, _c;
1594
1693
  if (!((_b = (_a = columnGroup.getProvidedColumnGroup) === null || _a === void 0 ? void 0 : _a.call(columnGroup)) === null || _b === void 0 ? void 0 : _b.getColGroupDef())) {
1595
1694
  return acc;
1596
1695
  }
1597
1696
  const ColumnGroupId = columnGroup.getGroupId();
1598
- const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef().marryChildren;
1697
+ const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef()
1698
+ .marryChildren;
1599
1699
  const FriendlyName = (_c = columnGroup.getProvidedColumnGroup().getColGroupDef().headerName) !== null && _c !== void 0 ? _c : ColumnGroupId;
1600
1700
  const columnsInGroup = columnGroup.getLeafColumns();
1601
1701
  columnsInGroup.forEach((col) => {
@@ -1756,7 +1856,10 @@ class AdaptableAgGrid {
1756
1856
  }
1757
1857
  return rawValue;
1758
1858
  }
1759
- updateColumnModelAndRefreshGrid() {
1859
+ updateColumnModelAndRefreshGrid(config) {
1860
+ if (!(config === null || config === void 0 ? void 0 : config.skipColDefsRefresh)) {
1861
+ this.refreshColDefs();
1862
+ }
1760
1863
  this.deriveAdaptableColumnStateFromAgGrid();
1761
1864
  this.agGridColumnAdapter.setupColumns();
1762
1865
  this.redrawBody();
@@ -2118,50 +2221,20 @@ class AdaptableAgGrid {
2118
2221
  });
2119
2222
  this.deriveAdaptableColumnStateFromAgGrid();
2120
2223
  }
2121
- getSortedColumnStateForVisibleColumns(visibleColumnList, columnState) {
2224
+ getSortedColumnStateForVisibleColumns(visibleColumnList, columnState, layout) {
2225
+ layout = layout || this.api.layoutApi.getCurrentLayout();
2226
+ visibleColumnList = visibleColumnList || layout.Columns;
2122
2227
  columnState = columnState || this.agGridAdapter.getAgGridApi().getColumnState();
2123
- const NewVisibleColumnIdsMap = visibleColumnList.reduce((acc, colId, index) => {
2124
- acc[colId] = index;
2125
- return acc;
2126
- }, {});
2127
- const columnsStateIndexes = columnState.reduce((acc, colState, index) => {
2128
- acc[colState.colId] = index;
2129
- return acc;
2130
- }, {});
2131
- const newVisibleColumnsMap = visibleColumnList.reduce((acc, colId, index) => {
2132
- acc[colId] = index;
2133
- return acc;
2134
- }, {});
2135
- const result = [...columnState]
2136
- .sort((colState1, colState2) => {
2137
- const colId1 = colState1.colId;
2138
- const colId2 = colState2.colId;
2139
- const originalIndex1 = columnsStateIndexes[colId1];
2140
- const originalIndex2 = columnsStateIndexes[colId2];
2141
- const isRowGroup1 = this.api.columnApi.isAutoRowGroupColumn(colId1);
2142
- const isRowGroup2 = this.api.columnApi.isAutoRowGroupColumn(colId2);
2143
- if (isRowGroup1 && isRowGroup2) {
2144
- return 1;
2145
- }
2146
- if (isRowGroup1) {
2147
- return -1;
2148
- }
2149
- if (isRowGroup2) {
2150
- return 1;
2151
- }
2152
- if (newVisibleColumnsMap[colId1] != null && newVisibleColumnsMap[colId2] == null) {
2153
- return -1;
2154
- }
2155
- if (newVisibleColumnsMap[colId1] == null && newVisibleColumnsMap[colId2] != null) {
2156
- return 1;
2157
- }
2158
- if (newVisibleColumnsMap[colId1] == null && newVisibleColumnsMap[colId2] == null) {
2159
- return originalIndex1 - originalIndex2;
2160
- }
2161
- return newVisibleColumnsMap[colState1.colId] - newVisibleColumnsMap[colState2.colId];
2162
- })
2163
- .map((colState) => (Object.assign(Object.assign({}, colState), { hide: NewVisibleColumnIdsMap[colState.colId] == null })));
2164
- return result;
2228
+ return (0, buildSortedColumnStateForLayout_1.buildSortedColumnStateForLayout)({
2229
+ columnState: columnState.map((colState) => {
2230
+ return {
2231
+ colId: colState.colId,
2232
+ hide: colState.hide,
2233
+ };
2234
+ }),
2235
+ layout: Object.assign(Object.assign({}, layout), { Columns: visibleColumnList }),
2236
+ gridOptions: this.agGridAdapter.getLiveGridOptions(),
2237
+ });
2165
2238
  }
2166
2239
  getDistinctValuesForColumn(column, distinctValuesParams) {
2167
2240
  let gridCells = this.getGridCellsForPermittedValues(column, distinctValuesParams);
@@ -2346,10 +2419,10 @@ class AdaptableAgGrid {
2346
2419
  });
2347
2420
  }
2348
2421
  getAgGridRowModelType() {
2349
- var _a, _b;
2422
+ var _a;
2350
2423
  // it seems that this can be null so we need explicitly to return "clientSide" in this case
2351
2424
  // need to check that for ServerSideRowModel it is ALWAYS returned...
2352
- return (_b = (_a = this.agGridAdapter.initialGridOptions) === null || _a === void 0 ? void 0 : _a.rowModelType) !== null && _b !== void 0 ? _b : 'clientSide';
2425
+ return (_a = this.agGridAdapter.getAgGridApi().getGridOption('rowModelType')) !== null && _a !== void 0 ? _a : 'clientSide';
2353
2426
  }
2354
2427
  getAllRowNodes(config) {
2355
2428
  let rowNodes = [];
@@ -2472,7 +2545,7 @@ class AdaptableAgGrid {
2472
2545
  }
2473
2546
  canGenerateCharts() {
2474
2547
  return (this.agGridAdapter.isModulePresent(core_1.ModuleNames.GridChartsModule) &&
2475
- this.agGridAdapter.initialGridOptions.enableCharts);
2548
+ this.agGridAdapter.getAgGridApi().getGridOption('enableCharts'));
2476
2549
  }
2477
2550
  canDisplaySparklines() {
2478
2551
  return this.agGridAdapter.isModulePresent(core_1.ModuleNames.SparklinesModule);
@@ -2688,7 +2761,7 @@ class AdaptableAgGrid {
2688
2761
  setRowGroupColumns(columnIds) {
2689
2762
  this.agGridAdapter.getAgGridApi().setRowGroupColumns(columnIds);
2690
2763
  }
2691
- getAgGridAllGridColumns() {
2764
+ getAllGridColumns() {
2692
2765
  return this.agGridAdapter.getAgGridApi().getAllGridColumns();
2693
2766
  }
2694
2767
  clearRowGroupColumns() {
@@ -2869,6 +2942,7 @@ class AdaptableAgGrid {
2869
2942
  else {
2870
2943
  (_b = this.agGridAdapter.getAgGridApi()) === null || _b === void 0 ? void 0 : _b.destroy();
2871
2944
  }
2945
+ this.previousAgGridLayoutState = '';
2872
2946
  const gridContainerElement = this.getAgGridContainerElement();
2873
2947
  if (gridContainerElement) {
2874
2948
  gridContainerElement.removeEventListener('keydown', this.agGridListenerKeydown);
@@ -2986,54 +3060,89 @@ class AdaptableAgGrid {
2986
3060
  ephemeralGridApi.destroy();
2987
3061
  }
2988
3062
  exportVisualDataToExcel() {
2989
- // // add adaptable style props to user defined props
2990
- // this.setExcelStylesForExport();
2991
- //
2992
- // this.gridOptions.api.exportDataAsExcel({
2993
- // sheetName: 'Sheet 1',
2994
- // fileName: this.ReportService.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
2995
- // // delegate the cell value processing to Adaptable
2996
- // processCellCallback: ({ node, column, value }: ProcessCellForExportParams): string => {
2997
- // const columnId = column.getColId();
2998
- // if (
2999
- // node?.group &&
3000
- // (this.api.columnApi.isAutoRowGroupColumn(columnId) ||
3001
- // // we would still need to process the cell if this is a group row with an aggregated value
3002
- // node?.aggData?.[columnId] == undefined)
3003
- // ) {
3004
- // // skip processing of row groups, this was already handled in processRowGroupCallback()
3005
- // return value;
3006
- // }
3007
- // return this.processCellForExcelExport(node, columnId);
3008
- // },
3009
- // processRowGroupCallback: (params: ProcessRowGroupForExportParams): string => {
3010
- // // recreating the standard AG Grid styling for row groups: 'Parent -> Child'
3011
- // // additionally the values are formatted
3012
- // let rowGroupNode = params.node;
3013
- // const isFooterRow = rowGroupNode.footer;
3014
- // const rowGroupSummary = [this.processRowGroupForExcelExport(rowGroupNode) ?? ''];
3015
- // while (rowGroupNode.parent) {
3016
- // rowGroupNode = rowGroupNode.parent;
3017
- // const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode);
3018
- // if (formattedParentNode) {
3019
- // rowGroupSummary.push(formattedParentNode);
3020
- // }
3021
- // }
3022
- //
3023
- // let summary = rowGroupSummary.reverse().join(' -> ');
3024
- // if (isFooterRow) {
3025
- // summary = `Total: ${summary}`;
3026
- // }
3027
- // return summary;
3028
- // },
3029
- // });
3030
- //
3031
- // // keep only the user defined props
3032
- // this.setGridOptionsProperty('excelStyles', (userExcelStyles) => {
3033
- // return userExcelStyles;
3034
- // });
3063
+ try {
3064
+ const exportExcelStyles = this.ReportService.buildExcelStylesForVisualReports();
3065
+ this.agGridOptionsService.CAREFUL_patchGridOptionsProperty('excelStyles', exportExcelStyles);
3066
+ this.agGridAdapter.getAgGridApi().exportDataAsExcel({
3067
+ sheetName: 'Sheet 1',
3068
+ fileName: this.ReportService.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
3069
+ // delegate the cell value processing to Adaptable
3070
+ processCellCallback: ({ node, column, value }) => {
3071
+ var _a;
3072
+ const columnId = column.getColId();
3073
+ if ((node === null || node === void 0 ? void 0 : node.group) &&
3074
+ (this.api.columnApi.isAutoRowGroupColumn(columnId) ||
3075
+ // we would still need to process the cell if this is a group row with an aggregated value
3076
+ ((_a = node === null || node === void 0 ? void 0 : node.aggData) === null || _a === void 0 ? void 0 : _a[columnId]) == undefined)) {
3077
+ // skip processing of row groups, this was already handled in processRowGroupCallback()
3078
+ return value;
3079
+ }
3080
+ return this.processCellForExcelExport(node, columnId);
3081
+ },
3082
+ processRowGroupCallback: (params) => {
3083
+ var _a;
3084
+ // recreating the standard AG Grid styling for row groups: 'Parent -> Child'
3085
+ // additionally the values are formatted
3086
+ let rowGroupNode = params.node;
3087
+ const isFooterRow = rowGroupNode.footer;
3088
+ const rowGroupSummary = [(_a = this.processRowGroupForExcelExport(rowGroupNode)) !== null && _a !== void 0 ? _a : ''];
3089
+ while (rowGroupNode.parent) {
3090
+ rowGroupNode = rowGroupNode.parent;
3091
+ const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode);
3092
+ if (formattedParentNode) {
3093
+ rowGroupSummary.push(formattedParentNode);
3094
+ }
3095
+ }
3096
+ let summary = rowGroupSummary.reverse().join(' -> ');
3097
+ if (isFooterRow) {
3098
+ summary = `Total: ${summary}`;
3099
+ }
3100
+ return summary;
3101
+ },
3102
+ });
3103
+ this.agGridOptionsService.revertGridOptionsPropertyToUserValue('excelStyles');
3104
+ }
3105
+ catch (error) {
3106
+ this.logger.consoleError('Error exporting visual data to Excel', error);
3107
+ }
3108
+ }
3109
+ processRowGroupForExcelExport(rowNode) {
3110
+ var _a, _b, _c, _d, _e;
3111
+ 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;
3112
+ if (!columnId || !rowNode.key) {
3113
+ return;
3114
+ }
3115
+ let rawValue = rowNode.key;
3116
+ if (this.api.columnApi.getColumnDataTypeForColumnId(columnId) === 'Date' &&
3117
+ typeof rawValue === 'string' &&
3118
+ // rawValue is composed only of digits
3119
+ /^\d+$/.test(rawValue)) {
3120
+ // AG-Grid converts the value to string, we have to reconvert it back
3121
+ const dateRawValue = parseInt(rawValue);
3122
+ if (dateRawValue != undefined) {
3123
+ // @ts-ignore
3124
+ rawValue = dateRawValue;
3125
+ }
3126
+ }
3127
+ return this.ReportService.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
3128
+ }
3129
+ processCellForExcelExport(rowNode, columnId) {
3130
+ if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
3131
+ const cellKey = this.agGridColumnAdapter.getExcelClassNameForCell(columnId, this.getPrimaryKeyValueFromRowNode(rowNode));
3132
+ const isoFormattedDate = this.ReportService.getExcelStyleWithFormattedDate(cellKey);
3133
+ if (isoFormattedDate) {
3134
+ // this is a Date cell which will be formatted by Excel
3135
+ return isoFormattedDate;
3136
+ }
3137
+ }
3138
+ return this.ReportService.getCellExportValueFromRowNode(rowNode, columnId);
3035
3139
  }
3036
3140
  isQuickFilterAvailable() {
3141
+ if (this.api.layoutApi.isCurrentLayoutPivot() &&
3142
+ this.adaptableOptions.columnFilterOptions.useAdaptableColumnFiltering) {
3143
+ // hide completely the quick filter if pivot is enabled
3144
+ return false;
3145
+ }
3037
3146
  return this.hasFloatingFilterOnAtLeastOneColumn(this.agGridAdapter.getAgGridApi().getColumnDefs());
3038
3147
  }
3039
3148
  hasFloatingFilterOnAtLeastOneColumn(columnDefs) {
@@ -3066,10 +3175,6 @@ class AdaptableAgGrid {
3066
3175
  layout.PinnedColumnsMap = layout.PinnedColumnsMap || {};
3067
3176
  layout.PinnedColumnsMap[actionRowColumn.colId] = actionRowColumn.pinned;
3068
3177
  }
3069
- const layoutColumnsMap = layout.Columns.reduce((acc, colId) => {
3070
- acc[colId] = true;
3071
- return acc;
3072
- }, {});
3073
3178
  const columnsState = this.agGridAdapter.getAgGridApi().getColumnState();
3074
3179
  const columnsStateIndexes = {};
3075
3180
  const columnsStateMap = columnsState.reduce((acc, colState, index) => {
@@ -3101,20 +3206,19 @@ class AdaptableAgGrid {
3101
3206
  .getPivotResultColumns()) === null || _b === void 0 ? void 0 : _b.map((column) => column.getColId())) || [];
3102
3207
  let isChanged = false;
3103
3208
  const colsToAutoSize = {};
3104
- let newColumnsState = this.getSortedColumnStateForVisibleColumns(columnsToShow, columnsState);
3209
+ let newColumnsState = this.getSortedColumnStateForVisibleColumns(columnsToShow, columnsState, layout);
3105
3210
  newColumnsState = newColumnsState
3106
3211
  .map((colState) => {
3107
3212
  var _a, _b, _c;
3108
3213
  const { colId } = colState;
3109
3214
  const oldColState = columnsStateMap[colId];
3110
- const hide = this.api.columnApi.isAutoPivotColumn(colId)
3111
- ? colState.hide
3112
- : !layoutColumnsMap[colId];
3113
- const newColState = Object.assign(Object.assign({}, oldColState), { hide });
3215
+ // it's important to have width here, so it's not inherited from the existing colState
3216
+ // which could be from a different layout
3217
+ const newColState = Object.assign(Object.assign(Object.assign({}, oldColState), { width: null }), colState);
3114
3218
  if (layout.ColumnWidthMap && layout.ColumnWidthMap[colId] != null) {
3115
3219
  newColState.width = layout.ColumnWidthMap[colId];
3116
3220
  }
3117
- else if (!hide) {
3221
+ else if (!colState.hide) {
3118
3222
  // autosize only the columns which are part of the selected layout
3119
3223
  colsToAutoSize[colId] = true;
3120
3224
  }
@@ -3123,11 +3227,7 @@ class AdaptableAgGrid {
3123
3227
  }
3124
3228
  newColState.rowGroupIndex =
3125
3229
  groupedColumnsIndexesMap[colId] != null ? groupedColumnsIndexesMap[colId] : null;
3126
- const previousRowGroup = newColState.rowGroup;
3127
3230
  newColState.rowGroup = newColState.rowGroupIndex != null;
3128
- if (!previousRowGroup && newColState.rowGroup) {
3129
- this.agGridColumnAdapter.triggerSetupColumnKeyCreator(colId);
3130
- }
3131
3231
  const normalizePinned = (pinnedValue) => {
3132
3232
  if (typeof pinnedValue === 'string') {
3133
3233
  return pinnedValue;
@@ -3232,14 +3332,13 @@ class AdaptableAgGrid {
3232
3332
  // as otherwise column order is not preserved properly when
3233
3333
  // going from pivoted to unpivoted layout
3234
3334
  if (shouldUpdatePivoted) {
3235
- this.agGridAdapter.getAgGridApi().setPivotMode(pivoted);
3335
+ this.agGridAdapter.setGridOption('pivotMode', pivoted);
3236
3336
  }
3237
3337
  const perfApplyColumnState = this.logger.beginPerf('applyColumnState (layout.isChanged)');
3238
3338
  this.agGridAdapter.getAgGridApi().applyColumnState({
3239
3339
  state: newColumnsState,
3240
3340
  applyOrder: true,
3241
3341
  });
3242
- this.applyGroupColumnWidth(layout);
3243
3342
  perfApplyColumnState.end();
3244
3343
  this.api.gridApi.setColumnSorts(layout.ColumnSorts);
3245
3344
  this.agGridAdapter.getAgGridApi().setPivotColumns(layout.PivotColumns || []);
@@ -3258,18 +3357,22 @@ class AdaptableAgGrid {
3258
3357
  requestAnimationFrame(() => {
3259
3358
  this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3260
3359
  });
3261
- //but if it's also the first time the grid is loading
3262
- //it's not timely enough the above call, so we keep trying... I know it's ugly, we need to find a better way
3263
- setTimeout(() => {
3264
- this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3265
- setTimeout(() => {
3266
- this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3267
- }, 200);
3268
- }, 100);
3360
+ // //but if it's also the first time the grid is loading
3361
+ // //it's not timely enough the above call, so we keep trying... I know it's ugly, we need to find a better way
3362
+ // setTimeout(() => {
3363
+ // this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3364
+ // setTimeout(() => {
3365
+ // this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3366
+ // }, 200);
3367
+ // }, 100);
3269
3368
  }
3270
- else if (((_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.layoutOptions) === null || _f === void 0 ? void 0 : _f.autoSizeColumnsInLayout) &&
3271
- colsToAutoSizeArray.length) {
3272
- this.agGridAdapter.getAgGridApi().autoSizeColumns(colsToAutoSizeArray);
3369
+ else {
3370
+ if (((_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.layoutOptions) === null || _f === void 0 ? void 0 : _f.autoSizeColumnsInLayout) &&
3371
+ colsToAutoSizeArray.length) {
3372
+ requestAnimationFrame(() => {
3373
+ this.autoSizeColumns(colsToAutoSizeArray);
3374
+ });
3375
+ }
3273
3376
  }
3274
3377
  this.forPlugins((plugin) => {
3275
3378
  if (plugin.afterSetLayout) {
@@ -3292,38 +3395,6 @@ class AdaptableAgGrid {
3292
3395
  }
3293
3396
  return null;
3294
3397
  }
3295
- /**
3296
- * Setting layout works by modifing the column state.
3297
- * The column state is based on the current existing columns.
3298
- * At this point the column groups do not exist, and the widths from layout are not applied.
3299
- *
3300
- * After the col sate is applied and the column groups are created we need
3301
- * to apply the state again to update the widths of the group columns.
3302
- */
3303
- applyGroupColumnWidth(layout) {
3304
- if (!layout.RowGroupedColumns || !layout.RowGroupedColumns.length) {
3305
- return;
3306
- }
3307
- const groupColumnWithDifferentWidths = this.agGridAdapter
3308
- .getAgGridApi()
3309
- .getColumnState()
3310
- .reduce((acc, col) => {
3311
- var _a;
3312
- if (this.api.columnApi.isAutoRowGroupColumn(col.colId)) {
3313
- const widthInLayout = (_a = layout.ColumnWidthMap) === null || _a === void 0 ? void 0 : _a[col.colId];
3314
- if (widthInLayout && widthInLayout !== col.width) {
3315
- acc.push(Object.assign(Object.assign({}, col), { width: widthInLayout }));
3316
- }
3317
- }
3318
- return acc;
3319
- }, []);
3320
- if (groupColumnWithDifferentWidths.length === 0) {
3321
- return;
3322
- }
3323
- this.agGridAdapter.getAgGridApi().applyColumnState({
3324
- state: groupColumnWithDifferentWidths,
3325
- });
3326
- }
3327
3398
  onRowDataChanged({ rowNode, oldData, newData, }) {
3328
3399
  if (oldData == null || oldData == undefined) {
3329
3400
  return;
@@ -3502,12 +3573,12 @@ class AdaptableAgGrid {
3502
3573
  if (!dataChangedScope.wholeRow) {
3503
3574
  const columnIds = this.api.expressionApi.getColumnsFromExpression(styleModule.Rule.BooleanExpression);
3504
3575
  if (columnIds.includes(cellDataChangedInfo.column.columnId)) {
3505
- if (this.api.scopeApi.scopeIsAll(styleModule.Scope)) {
3576
+ if (this.api.columnScopeApi.scopeIsAll(styleModule.Scope)) {
3506
3577
  dataChangedScope.wholeRow = true;
3507
3578
  return;
3508
3579
  }
3509
3580
  else {
3510
- this.api.scopeApi
3581
+ this.api.columnScopeApi
3511
3582
  .getColumnsForScope(styleModule.Scope)
3512
3583
  .map((c) => c.columnId)
3513
3584
  .forEach((colId) => {
@@ -3618,6 +3689,24 @@ class AdaptableAgGrid {
3618
3689
  */
3619
3690
  updateLayoutFromGrid() {
3620
3691
  var _a, _b;
3692
+ const agGridApi = this.agGridAdapter.getAgGridApi();
3693
+ const columnState = agGridApi.getColumnState();
3694
+ const expandedState = agGridApi.getState().rowGroupExpansion || { expandedRowGroupIds: [] };
3695
+ const currentLayoutState = { columnState, expandedState };
3696
+ try {
3697
+ // TODO
3698
+ const stringifiedLayoutState = JSON.stringify(currentLayoutState);
3699
+ if (stringifiedLayoutState === this.previousAgGridLayoutState) {
3700
+ // same grid column state as a previous,
3701
+ // so no need to update, as the layout has already been updated
3702
+ // for this grid column state
3703
+ return;
3704
+ }
3705
+ this.previousAgGridLayoutState = stringifiedLayoutState;
3706
+ }
3707
+ catch (ex) {
3708
+ this.logger.consoleError('Error stringifying column state', ex);
3709
+ }
3621
3710
  const currentLayout = this.api.layoutApi.getCurrentLayout();
3622
3711
  if (currentLayout.IsReadOnly) {
3623
3712
  // reaply the layout so the grid is reverted
@@ -3629,7 +3718,6 @@ class AdaptableAgGrid {
3629
3718
  const columnFlexes = {};
3630
3719
  const pinnedColumns = {};
3631
3720
  const columnSorts = [];
3632
- const columnState = this.agGridAdapter.getAgGridApi().getColumnState();
3633
3721
  let groupedColumns = [...new Array(columnState.length)];
3634
3722
  let pivotedColumns = [...new Array(columnState.length)];
3635
3723
  const pivotColumns = [];