@adaptabletools/adaptable-cjs 18.0.0-canary.3 → 18.0.0-canary.31

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 (482) hide show
  1. package/agGrid.d.ts +4 -21
  2. package/agGrid.js +5 -21
  3. package/base.css +27 -21
  4. package/base.css.map +1 -1
  5. package/index.css +108 -88
  6. package/index.css.map +1 -1
  7. package/package.json +4 -5
  8. package/src/AdaptableInterfaces/IAdaptable.d.ts +61 -109
  9. package/src/AdaptableOptions/ActionColumnOptions.d.ts +3 -2
  10. package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +3 -0
  11. package/src/AdaptableOptions/AdaptableOptions.d.ts +7 -7
  12. package/src/AdaptableOptions/AdaptablePlugin.d.ts +2 -0
  13. package/src/AdaptableOptions/AdaptablePlugin.js +2 -0
  14. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +11 -4
  15. package/src/AdaptableOptions/ColumnOptions.d.ts +9 -4
  16. package/src/AdaptableOptions/CommentOptions.d.ts +39 -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/MenuOptions.d.ts +11 -71
  22. package/src/AdaptableOptions/MenuOptions.js +0 -101
  23. package/src/AdaptableOptions/NoteOptions.d.ts +25 -0
  24. package/src/AdaptableOptions/PredicateOptions.d.ts +2 -2
  25. package/src/AdaptableOptions/StateOptions.d.ts +6 -0
  26. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +19 -2
  27. package/src/Api/AdaptableApi.d.ts +9 -4
  28. package/src/Api/BulkUpdateApi.d.ts +0 -5
  29. package/src/Api/ColumnApi.d.ts +13 -0
  30. package/src/Api/CommentApi.d.ts +20 -22
  31. package/src/Api/ConfigApi.d.ts +4 -5
  32. package/src/Api/EventApi.d.ts +7 -9
  33. package/src/Api/Events/AdaptableReady.d.ts +3 -3
  34. package/src/Api/Events/CommentChanged.d.ts +11 -0
  35. package/src/Api/Events/GridDataChanged.d.ts +4 -4
  36. package/src/Api/FlashingCellApi.d.ts +2 -2
  37. package/src/Api/GridApi.d.ts +42 -14
  38. package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
  39. package/src/Api/Implementation/ActionColumnApiImpl.js +30 -0
  40. package/src/Api/Implementation/ActionRowApiImpl.js +3 -7
  41. package/src/Api/Implementation/AdaptableApiImpl.d.ts +3 -2
  42. package/src/Api/Implementation/AdaptableApiImpl.js +5 -2
  43. package/src/Api/Implementation/AlertApiImpl.js +5 -10
  44. package/src/Api/Implementation/ApiBase.d.ts +5 -3
  45. package/src/Api/Implementation/ApiBase.js +8 -2
  46. package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
  47. package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
  48. package/src/Api/Implementation/CalendarApiImpl.js +1 -6
  49. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +0 -5
  50. package/src/Api/Implementation/CellSummaryApiImpl.js +2 -23
  51. package/src/Api/Implementation/ChartingApiImpl.js +3 -3
  52. package/src/Api/Implementation/ColumnApiImpl.d.ts +5 -0
  53. package/src/Api/Implementation/ColumnApiImpl.js +48 -16
  54. package/src/Api/Implementation/ColumnFilterApiImpl.js +7 -7
  55. package/src/Api/Implementation/CommentsApiImpl.d.ts +8 -5
  56. package/src/Api/Implementation/CommentsApiImpl.js +12 -6
  57. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -2
  58. package/src/Api/Implementation/ConfigApiImpl.js +34 -30
  59. package/src/Api/Implementation/DashboardApiImpl.js +1 -6
  60. package/src/Api/Implementation/ExportApiImpl.js +5 -10
  61. package/src/Api/Implementation/ExpressionApiImpl.js +14 -19
  62. package/src/Api/Implementation/Fdc3ApiImpl.js +1 -1
  63. package/src/Api/Implementation/FlashingCellApiImpl.d.ts +2 -2
  64. package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
  65. package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
  66. package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
  67. package/src/Api/Implementation/GridApiImpl.d.ts +10 -3
  68. package/src/Api/Implementation/GridApiImpl.js +78 -23
  69. package/src/Api/Implementation/LayoutApiImpl.d.ts +4 -7
  70. package/src/Api/Implementation/LayoutApiImpl.js +19 -13
  71. package/src/Api/Implementation/NoteApiImpl.d.ts +18 -0
  72. package/src/Api/Implementation/NoteApiImpl.js +45 -0
  73. package/src/Api/Implementation/OptionsApiImpl.d.ts +4 -4
  74. package/src/Api/Implementation/OptionsApiImpl.js +4 -4
  75. package/src/Api/Implementation/PredicateApiImpl.js +2 -2
  76. package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
  77. package/src/Api/Implementation/ScopeApiImpl.d.ts +26 -24
  78. package/src/Api/Implementation/ScopeApiImpl.js +64 -18
  79. package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
  80. package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
  81. package/src/Api/Implementation/TeamSharingApiImpl.js +3 -15
  82. package/src/Api/Implementation/ThemeApiImpl.js +2 -7
  83. package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
  84. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +14 -8
  85. package/src/Api/Implementation/UserInterfaceApiImpl.js +30 -25
  86. package/src/Api/Internal/ActionRowInternalApi.d.ts +6 -1
  87. package/src/Api/Internal/ActionRowInternalApi.js +118 -38
  88. package/src/Api/Internal/AdaptableInternalApi.d.ts +6 -8
  89. package/src/Api/Internal/AdaptableInternalApi.js +25 -37
  90. package/src/Api/Internal/AlertInternalApi.d.ts +2 -2
  91. package/src/Api/Internal/AlertInternalApi.js +4 -17
  92. package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
  93. package/src/Api/Internal/CalculatedColumnInternalApi.js +79 -14
  94. package/src/Api/Internal/ChartingInternalApi.js +13 -13
  95. package/src/Api/Internal/ColumnFilterInternalApi.d.ts +2 -0
  96. package/src/Api/Internal/ColumnFilterInternalApi.js +35 -31
  97. package/src/Api/Internal/ColumnInternalApi.d.ts +6 -1
  98. package/src/Api/Internal/ColumnInternalApi.js +20 -1
  99. package/src/Api/Internal/CommentsInternalApi.d.ts +4 -0
  100. package/src/Api/Internal/CommentsInternalApi.js +18 -0
  101. package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
  102. package/src/Api/Internal/CustomSortInternalApi.js +33 -2
  103. package/src/Api/Internal/DashboardInternalApi.js +5 -11
  104. package/src/Api/Internal/DataImportInternalApi.js +3 -9
  105. package/src/Api/Internal/DataSetInternalApi.js +3 -8
  106. package/src/Api/Internal/ExportInternalApi.d.ts +2 -1
  107. package/src/Api/Internal/ExportInternalApi.js +8 -5
  108. package/src/Api/Internal/ExpressionInternalApi.js +2 -12
  109. package/src/Api/Internal/Fdc3InternalApi.js +3 -12
  110. package/src/Api/Internal/FormatColumnInternalApi.d.ts +3 -6
  111. package/src/Api/Internal/FormatColumnInternalApi.js +39 -30
  112. package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
  113. package/src/Api/Internal/FreeTextColumnInternalApi.js +62 -1
  114. package/src/Api/Internal/GridFilterInternalApi.d.ts +5 -0
  115. package/src/Api/Internal/GridFilterInternalApi.js +9 -9
  116. package/src/Api/Internal/GridInternalApi.d.ts +23 -3
  117. package/src/Api/Internal/GridInternalApi.js +151 -44
  118. package/src/Api/Internal/LayoutInternalApi.d.ts +2 -0
  119. package/src/Api/Internal/LayoutInternalApi.js +26 -19
  120. package/src/Api/Internal/NoteInternalApi.d.ts +4 -0
  121. package/src/Api/Internal/NoteInternalApi.js +18 -0
  122. package/src/Api/Internal/PredicateInternalApi.d.ts +6 -6
  123. package/src/Api/Internal/PredicateInternalApi.js +5 -40
  124. package/src/Api/Internal/ScheduleInternalApi.js +1 -6
  125. package/src/Api/Internal/StyledColumnInternalApi.d.ts +2 -2
  126. package/src/Api/Internal/StyledColumnInternalApi.js +8 -9
  127. package/src/Api/Internal/SystemStatusInternalApi.js +1 -7
  128. package/src/Api/Internal/TeamSharingInternalApi.js +3 -8
  129. package/src/Api/Internal/ThemeInternalApi.js +1 -1
  130. package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
  131. package/src/Api/InteropioPluginApi.d.ts +2 -2
  132. package/src/Api/LayoutApi.d.ts +17 -9
  133. package/src/Api/NoteApi.d.ts +48 -0
  134. package/src/Api/OptionsApi.d.ts +8 -8
  135. package/src/Api/ScopeApi.d.ts +34 -24
  136. package/src/Api/UserInterfaceApi.d.ts +15 -13
  137. package/src/EnvVars.d.ts +3 -0
  138. package/src/EnvVars.js +8 -0
  139. package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
  140. package/src/PredefinedConfig/AlertState.d.ts +2 -2
  141. package/src/PredefinedConfig/CommentState.d.ts +27 -23
  142. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
  143. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  144. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +4 -4
  145. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +2 -2
  146. package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
  147. package/src/PredefinedConfig/Common/AggregationColumns.js +5 -1
  148. package/src/PredefinedConfig/Common/CellSummary.d.ts +5 -14
  149. package/src/PredefinedConfig/Common/{AdaptableScope.d.ts → ColumnScope.d.ts} +4 -1
  150. package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +4 -0
  151. package/src/PredefinedConfig/Common/Enums.d.ts +4 -1
  152. package/src/PredefinedConfig/Common/Enums.js +3 -0
  153. package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +2 -2
  154. package/src/PredefinedConfig/Common/Menu.d.ts +15 -1
  155. package/src/PredefinedConfig/Common/Menu.js +117 -0
  156. package/src/PredefinedConfig/Common/RowScope.d.ts +17 -0
  157. package/src/PredefinedConfig/Common/RowSummary.d.ts +21 -0
  158. package/src/PredefinedConfig/Common/RowSummary.js +20 -0
  159. package/src/PredefinedConfig/Common/TransposeConfig.d.ts +30 -0
  160. package/src/PredefinedConfig/Common/Types.d.ts +4 -4
  161. package/src/PredefinedConfig/Common/Types.js +4 -1
  162. package/src/PredefinedConfig/ExportState.d.ts +2 -2
  163. package/src/PredefinedConfig/FlashingCellState.d.ts +2 -2
  164. package/src/PredefinedConfig/FormatColumnState.d.ts +9 -5
  165. package/src/PredefinedConfig/LayoutState.d.ts +5 -0
  166. package/src/PredefinedConfig/{NotesState.d.ts → NoteState.d.ts} +12 -22
  167. package/src/PredefinedConfig/NoteState.js +2 -0
  168. package/src/PredefinedConfig/PlusMinusState.d.ts +2 -2
  169. package/src/PredefinedConfig/PopupState.d.ts +1 -2
  170. package/src/PredefinedConfig/PredefinedConfig.d.ts +3 -3
  171. package/src/PredefinedConfig/Selection/GridCell.d.ts +13 -0
  172. package/src/PredefinedConfig/ShortcutState.d.ts +2 -2
  173. package/src/PredefinedConfig/StyledColumnState.d.ts +5 -5
  174. package/src/PredefinedConfig/SystemState.d.ts +12 -4
  175. package/src/Redux/ActionsReducers/CommentsRedux.d.ts +0 -4
  176. package/src/Redux/ActionsReducers/CommentsRedux.js +1 -39
  177. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
  178. package/src/Redux/ActionsReducers/LayoutRedux.js +34 -11
  179. package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
  180. package/src/Redux/ActionsReducers/NoteRedux.js +89 -0
  181. package/src/Redux/ActionsReducers/PopupRedux.d.ts +5 -13
  182. package/src/Redux/ActionsReducers/PopupRedux.js +1 -22
  183. package/src/Redux/ActionsReducers/SystemRedux.d.ts +15 -4
  184. package/src/Redux/ActionsReducers/SystemRedux.js +27 -11
  185. package/src/Redux/Store/AdaptableStore.d.ts +4 -6
  186. package/src/Redux/Store/AdaptableStore.js +69 -79
  187. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +8 -2
  188. package/src/Strategy/AdaptableModuleBase.d.ts +11 -12
  189. package/src/Strategy/AdaptableModuleBase.js +17 -23
  190. package/src/Strategy/AlertModule.d.ts +2 -3
  191. package/src/Strategy/AlertModule.js +4 -57
  192. package/src/Strategy/BulkUpdateModule.d.ts +1 -1
  193. package/src/Strategy/BulkUpdateModule.js +2 -1
  194. package/src/Strategy/CalculatedColumnModule.d.ts +4 -5
  195. package/src/Strategy/CalculatedColumnModule.js +8 -28
  196. package/src/Strategy/CellSummaryModule.d.ts +10 -8
  197. package/src/Strategy/CellSummaryModule.js +85 -70
  198. package/src/Strategy/ChartingModule.d.ts +0 -1
  199. package/src/Strategy/ChartingModule.js +2 -22
  200. package/src/Strategy/ColumnFilterModule.d.ts +3 -4
  201. package/src/Strategy/ColumnFilterModule.js +37 -121
  202. package/src/Strategy/ColumnInfoModule.d.ts +2 -2
  203. package/src/Strategy/ColumnInfoModule.js +6 -4
  204. package/src/Strategy/CommentModule.d.ts +11 -0
  205. package/src/Strategy/CommentModule.js +75 -0
  206. package/src/Strategy/CustomSortModule.d.ts +1 -1
  207. package/src/Strategy/CustomSortModule.js +4 -3
  208. package/src/Strategy/DashboardModule.d.ts +3 -4
  209. package/src/Strategy/DashboardModule.js +11 -28
  210. package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
  211. package/src/Strategy/DataChangeHistoryModule.js +3 -1
  212. package/src/Strategy/DataImportModule.d.ts +4 -4
  213. package/src/Strategy/DataImportModule.js +8 -8
  214. package/src/Strategy/DataSetModule.d.ts +1 -1
  215. package/src/Strategy/DataSetModule.js +1 -1
  216. package/src/Strategy/ExportModule.d.ts +1 -2
  217. package/src/Strategy/ExportModule.js +37 -40
  218. package/src/Strategy/Fdc3Module.d.ts +1 -1
  219. package/src/Strategy/Fdc3Module.js +3 -13
  220. package/src/Strategy/FlashingCellModule.d.ts +3 -4
  221. package/src/Strategy/FlashingCellModule.js +8 -21
  222. package/src/Strategy/FormatColumnModule.d.ts +1 -3
  223. package/src/Strategy/FormatColumnModule.js +27 -91
  224. package/src/Strategy/FreeTextColumnModule.d.ts +1 -2
  225. package/src/Strategy/FreeTextColumnModule.js +2 -32
  226. package/src/Strategy/GridFilterModule.d.ts +0 -1
  227. package/src/Strategy/GridFilterModule.js +0 -37
  228. package/src/Strategy/GridInfoModule.d.ts +2 -2
  229. package/src/Strategy/GridInfoModule.js +5 -3
  230. package/src/Strategy/Interface/IModule.d.ts +3 -4
  231. package/src/Strategy/LayoutModule.d.ts +5 -6
  232. package/src/Strategy/LayoutModule.js +77 -122
  233. package/src/Strategy/NamedQueryModule.d.ts +0 -1
  234. package/src/Strategy/NamedQueryModule.js +0 -19
  235. package/src/Strategy/{NotesModule.d.ts → NoteModule.d.ts} +3 -3
  236. package/src/Strategy/NoteModule.js +60 -0
  237. package/src/Strategy/PlusMinusModule.d.ts +2 -2
  238. package/src/Strategy/PlusMinusModule.js +3 -3
  239. package/src/Strategy/ScheduleModule.d.ts +1 -1
  240. package/src/Strategy/ScheduleModule.js +1 -1
  241. package/src/Strategy/SettingsPanelModule.d.ts +3 -3
  242. package/src/Strategy/SettingsPanelModule.js +6 -6
  243. package/src/Strategy/ShortcutModule.d.ts +1 -1
  244. package/src/Strategy/ShortcutModule.js +1 -1
  245. package/src/Strategy/SmartEditModule.d.ts +1 -1
  246. package/src/Strategy/SmartEditModule.js +2 -1
  247. package/src/Strategy/StyledColumnModule.d.ts +2 -2
  248. package/src/Strategy/StyledColumnModule.js +47 -40
  249. package/src/Strategy/SystemStatusModule.d.ts +2 -2
  250. package/src/Strategy/SystemStatusModule.js +4 -3
  251. package/src/Strategy/TeamSharingModule.d.ts +1 -0
  252. package/src/Strategy/TeamSharingModule.js +5 -5
  253. package/src/Strategy/ToolPanelModule.d.ts +0 -1
  254. package/src/Strategy/ToolPanelModule.js +0 -23
  255. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +4 -2
  256. package/src/Strategy/Utilities/getScopeViewItems.d.ts +2 -2
  257. package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
  258. package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
  259. package/src/Utilities/Constants/GeneralConstants.d.ts +2 -0
  260. package/src/Utilities/Constants/GeneralConstants.js +4 -2
  261. package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
  262. package/src/Utilities/Constants/ModuleConstants.js +7 -7
  263. package/src/Utilities/Defaults/DefaultSettingsPanel.js +7 -6
  264. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -2
  265. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +434 -3
  266. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
  267. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
  268. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
  269. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
  270. package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
  271. package/src/Utilities/Extensions/ArrayExtensions.js +6 -1
  272. package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
  273. package/src/Utilities/Helpers/AdaptableHelper.js +21 -60
  274. package/src/Utilities/Helpers/Helper.d.ts +2 -0
  275. package/src/Utilities/Helpers/Helper.js +6 -1
  276. package/src/Utilities/Interface/MessagePopups.d.ts +0 -3
  277. package/src/Utilities/MenuItem.d.ts +7 -4
  278. package/src/Utilities/MenuItem.js +6 -3
  279. package/src/Utilities/ObjectFactory.d.ts +3 -3
  280. package/src/Utilities/ObjectFactory.js +7 -25
  281. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +4 -2
  282. package/src/Utilities/Services/AggregatedScalarLiveValue.js +26 -19
  283. package/src/Utilities/Services/CellPopupService.js +2 -3
  284. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
  285. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -4
  286. package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
  287. package/src/Utilities/Services/LicenseService/index.js +1 -186
  288. package/src/Utilities/Services/MetamodelService.d.ts +1 -1
  289. package/src/Utilities/Services/MetamodelService.js +6 -3
  290. package/src/Utilities/Services/ModuleService.js +6 -2
  291. package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
  292. package/src/Utilities/Services/QueryLanguageService.js +4 -3
  293. package/src/Utilities/Services/ReportService.d.ts +7 -5
  294. package/src/Utilities/Services/ReportService.js +243 -24
  295. package/src/Utilities/Services/RowEditService.d.ts +3 -2
  296. package/src/Utilities/Services/RowEditService.js +3 -1
  297. package/src/Utilities/Services/RowSummaryService.d.ts +22 -0
  298. package/src/Utilities/Services/RowSummaryService.js +146 -0
  299. package/src/Utilities/adaptableQlUtils.d.ts +2 -0
  300. package/src/Utilities/adaptableQlUtils.js +18 -0
  301. package/src/Utilities/license/decode.js +1 -70
  302. package/src/Utilities/license/hashing.js +1 -47
  303. package/src/View/AdaptableView.js +1 -3
  304. package/src/View/AdaptableViewFactory.js +2 -2
  305. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
  306. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +1 -1
  307. package/src/View/Alert/Utilities/getAvailablePredicates.d.ts +2 -2
  308. package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +1 -1
  309. package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
  310. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
  311. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +3 -3
  312. package/src/View/CalculatedColumn/utils.d.ts +1 -1
  313. package/src/View/CellSummary/CellSummaryPopup.js +1 -1
  314. package/src/View/Comments/CommentsEditor.js +28 -17
  315. package/src/View/Comments/CommentsPopup.js +25 -13
  316. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  317. package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.d.ts +5 -0
  318. package/src/View/Components/AdaptableInput/AdaptableDateInlineInput.js +46 -0
  319. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +5 -2
  320. package/src/View/Components/CellPopup/index.d.ts +1 -0
  321. package/src/View/Components/CellPopup/index.js +6 -3
  322. package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.d.ts +3 -3
  323. package/src/View/Components/EntityRulesEditor/index.d.ts +3 -3
  324. package/src/View/Components/FilterForm/FilterForm.js +20 -12
  325. package/src/View/Components/FilterForm/QuickFilterForm.js +15 -8
  326. package/src/View/Components/FilterForm/QuickFilterValues.js +39 -23
  327. package/src/View/Components/NewScopeComponent.d.ts +5 -5
  328. package/src/View/Components/NewScopeComponent.js +34 -1
  329. package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
  330. package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
  331. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +9 -1
  332. package/src/View/Components/Popups/AdaptableToaster.js +1 -1
  333. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +7 -7
  334. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
  335. package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
  336. package/src/View/Components/RangesComponent.d.ts +2 -2
  337. package/src/View/Components/Selectors/PermittedValuesSelector.js +2 -2
  338. package/src/View/Components/SharedProps/WizardScopeState.d.ts +2 -2
  339. package/src/View/Components/ValueSelector/index.d.ts +1 -0
  340. package/src/View/Components/ValueSelector/index.js +2 -2
  341. package/src/View/CustomSort/CustomSortSummary.js +1 -1
  342. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +12 -10
  343. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -1
  344. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +2 -2
  345. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +19 -6
  346. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +27 -12
  347. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
  348. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
  349. package/src/View/GridFilter/GridFilterViewPanel.js +9 -5
  350. package/src/View/GridFilter/useGridFilterExpressionEditor.js +1 -1
  351. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
  352. package/src/View/Layout/LayoutViewPanel.js +2 -1
  353. package/src/View/Layout/TransposedPopup.d.ts +3 -0
  354. package/src/View/Layout/TransposedPopup.js +200 -0
  355. package/src/View/Layout/Wizard/LayoutWizard.js +38 -3
  356. package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
  357. package/src/View/Layout/Wizard/sections/FilterSection.js +1 -1
  358. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +17 -1
  359. package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +9 -0
  360. package/src/View/Layout/Wizard/sections/RowSummarySection.js +181 -0
  361. package/src/View/License/LicenseWatermark.js +1 -66
  362. package/src/View/Note/NotePopup.d.ts +2 -0
  363. package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +22 -19
  364. package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
  365. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -1
  366. package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +38 -14
  367. package/src/View/Theme/ThemeSelector.js +2 -2
  368. package/src/agGrid/ActionColumnRenderer.js +48 -10
  369. package/src/agGrid/Adaptable.d.ts +3 -455
  370. package/src/agGrid/Adaptable.js +7 -5291
  371. package/src/agGrid/AdaptableAgGrid.d.ts +346 -0
  372. package/src/agGrid/AdaptableAgGrid.js +3915 -0
  373. package/src/agGrid/AdaptableLogger.js +78 -13
  374. package/src/agGrid/AgGridAdapter.d.ts +64 -0
  375. package/src/agGrid/AgGridAdapter.js +594 -0
  376. package/src/agGrid/AgGridColumnAdapter.d.ts +54 -0
  377. package/src/agGrid/AgGridColumnAdapter.js +800 -0
  378. package/src/agGrid/AgGridMenuAdapter.d.ts +44 -0
  379. package/src/agGrid/AgGridMenuAdapter.js +605 -0
  380. package/src/agGrid/AgGridOptionsService.d.ts +15 -0
  381. package/src/agGrid/AgGridOptionsService.js +80 -0
  382. package/src/agGrid/BadgeRenderer.d.ts +2 -2
  383. package/src/agGrid/BadgeRenderer.js +26 -12
  384. package/src/agGrid/CheckboxRenderer.js +1 -1
  385. package/src/agGrid/FilterWrapper.d.ts +2 -2
  386. package/src/agGrid/FilterWrapper.js +1 -1
  387. package/src/agGrid/PercentBarRenderer.js +2 -1
  388. package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
  389. package/src/agGrid/buildSortedColumnStateForLayout.d.ts +7 -0
  390. package/src/agGrid/buildSortedColumnStateForLayout.js +124 -0
  391. package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
  392. package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +74 -19
  393. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -1
  394. package/src/agGrid/editors/AdaptableDateEditor/index.js +3 -3
  395. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
  396. package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
  397. package/src/agGrid/sortColumnStateForVisibleColumns.d.ts +12 -0
  398. package/src/agGrid/sortColumnStateForVisibleColumns.js +50 -0
  399. package/src/agGrid/weightedAverage.d.ts +0 -2
  400. package/src/agGrid/weightedAverage.js +1 -56
  401. package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
  402. package/src/components/Datepicker/index.d.ts +1 -1
  403. package/src/components/Datepicker/index.js +10 -2
  404. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
  405. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
  406. package/src/components/ExpressionEditor/QueryBuilder/utils.js +3 -17
  407. package/src/components/InfiniteTable/index.js +2 -2
  408. package/src/components/Input/index.d.ts +1 -2
  409. package/src/components/List/ListGroupItem/index.d.ts +1 -1
  410. package/src/components/Modal/index.d.ts +1 -0
  411. package/src/components/Modal/index.js +6 -4
  412. package/src/components/ProgressIndicator/ProgressIndicator.js +15 -6
  413. package/src/components/Select/Select.d.ts +3 -1
  414. package/src/components/Select/Select.js +4 -2
  415. package/src/components/Textarea/index.d.ts +2 -2
  416. package/src/components/icons/copy.d.ts +3 -0
  417. package/src/components/icons/copy.js +7 -0
  418. package/src/components/icons/filter-off.d.ts +3 -0
  419. package/src/components/icons/filter-off.js +7 -0
  420. package/src/components/icons/grid-info.d.ts +3 -0
  421. package/src/components/icons/grid-info.js +7 -0
  422. package/src/components/icons/index.js +14 -0
  423. package/src/components/icons/note.js +2 -2
  424. package/src/components/icons/rows.d.ts +3 -0
  425. package/src/components/icons/rows.js +7 -0
  426. package/src/components/icons/select-all.d.ts +3 -0
  427. package/src/components/icons/select-all.js +7 -0
  428. package/src/components/icons/select-fwd.d.ts +3 -0
  429. package/src/components/icons/select-fwd.js +7 -0
  430. package/src/components/icons/select-off.d.ts +3 -0
  431. package/src/components/icons/select-off.js +7 -0
  432. package/src/env.js +2 -2
  433. package/src/metamodel/adaptable.metamodel.d.ts +222 -73
  434. package/src/metamodel/adaptable.metamodel.js +1 -9316
  435. package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
  436. package/src/migration/AdaptableUpgradeHelper.js +52 -0
  437. package/src/migration/VersionUpgrade.d.ts +8 -0
  438. package/src/migration/VersionUpgrade.js +15 -0
  439. package/src/migration/VersionUpgrade17.d.ts +18 -0
  440. package/src/migration/VersionUpgrade17.js +347 -0
  441. package/src/migration/VersionUpgrade18.d.ts +5 -0
  442. package/src/migration/VersionUpgrade18.js +10 -0
  443. package/src/parser/src/parser.js +576 -553
  444. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
  445. package/src/parser/src/predicate/mapQlPredicateToExpression.js +3 -4
  446. package/src/parser/src/types.d.ts +7 -2
  447. package/src/parser/src/types.js +1 -2
  448. package/src/types.d.ts +29 -21
  449. package/tsconfig.cjs.tsbuildinfo +1 -1
  450. package/src/AdaptableOptions/CommentsOptions.d.ts +0 -28
  451. package/src/AdaptableOptions/NotesOptions.d.ts +0 -16
  452. package/src/Api/Events/CommentsChangedInfo.d.ts +0 -5
  453. package/src/Api/Implementation/NotesApiImpl.d.ts +0 -16
  454. package/src/Api/Implementation/NotesApiImpl.js +0 -44
  455. package/src/Api/NotesApi.d.ts +0 -48
  456. package/src/PredefinedConfig/CellAddress.d.ts +0 -13
  457. package/src/PredefinedConfig/CellAddress.js +0 -5
  458. package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -39
  459. package/src/Redux/ActionsReducers/NotesRedux.js +0 -87
  460. package/src/Strategy/CommentsModule.d.ts +0 -16
  461. package/src/Strategy/CommentsModule.js +0 -82
  462. package/src/Strategy/NotesModule.js +0 -62
  463. package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
  464. package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
  465. package/src/View/Components/ScopeComponent.d.ts +0 -24
  466. package/src/View/Components/ScopeComponent.js +0 -138
  467. package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
  468. package/src/View/Export/Wizard/ReportScopeWizard.js +0 -52
  469. package/src/View/Notes/NotesPopup.d.ts +0 -2
  470. package/src/agGrid/agGridHelper.d.ts +0 -57
  471. package/src/agGrid/agGridHelper.js +0 -691
  472. package/src/agGrid/agGridMenuHelper.d.ts +0 -46
  473. package/src/agGrid/agGridMenuHelper.js +0 -673
  474. /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
  475. /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
  476. /package/src/Api/Events/{CommentsChangedInfo.js → CommentChanged.js} +0 -0
  477. /package/src/Api/{NotesApi.js → NoteApi.js} +0 -0
  478. /package/src/PredefinedConfig/Common/{AdaptableScope.js → ColumnScope.js} +0 -0
  479. /package/src/PredefinedConfig/{NotesState.js → Common/RowScope.js} +0 -0
  480. /package/src/{Utilities/Services/Interface/IRowEditService.js → PredefinedConfig/Common/TransposeConfig.js} +0 -0
  481. /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
  482. /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
@@ -0,0 +1,800 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgGridColumnAdapter = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const core_1 = require("ag-grid-community");
6
+ const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
7
+ const FilterWrapper_1 = require("./FilterWrapper");
8
+ const FloatingFilterWrapper_1 = require("./FloatingFilterWrapper");
9
+ const StyleHelper_1 = require("../Utilities/Helpers/StyleHelper");
10
+ const StringExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/StringExtensions"));
11
+ const ObjectFactory_1 = require("../Utilities/ObjectFactory");
12
+ const tinycolor2_1 = tslib_1.__importDefault(require("tinycolor2"));
13
+ const UIHelper_1 = tslib_1.__importDefault(require("../View/UIHelper"));
14
+ const PercentBarRenderer_1 = require("./PercentBarRenderer");
15
+ const BadgeRenderer_1 = require("./BadgeRenderer");
16
+ const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
17
+ const RowSummary_1 = require("../PredefinedConfig/Common/RowSummary");
18
+ class AgGridColumnAdapter {
19
+ constructor(adaptableInstance) {
20
+ this.adaptableInstance = adaptableInstance;
21
+ this.colDefPropertyCache = new Map();
22
+ }
23
+ destroy() {
24
+ this.adaptableInstance = null;
25
+ this.colDefPropertyCache.clear();
26
+ this.colDefPropertyCache = null;
27
+ }
28
+ get adaptableApi() {
29
+ return this.adaptableInstance.api;
30
+ }
31
+ get adaptableOptions() {
32
+ return this.adaptableInstance.adaptableOptions;
33
+ }
34
+ get agGridApi() {
35
+ return this.adaptableInstance.agGridAdapter.getAgGridApi();
36
+ }
37
+ setColDefProperty(col, propertyName, propertyGetter) {
38
+ var _a;
39
+ const colId = col.getColId();
40
+ const colDef = col.getColDef();
41
+ const colSetupInfo = {
42
+ col,
43
+ colDef,
44
+ colId,
45
+ };
46
+ const userKey = `user.${colId}.${propertyName}`;
47
+ const adaptableKey = `adaptable.${colId}.${propertyName}`;
48
+ const value = colDef[propertyName];
49
+ const isUserDefined = value !== this.colDefPropertyCache.get(adaptableKey);
50
+ if (isUserDefined) {
51
+ this.colDefPropertyCache.set(userKey, value);
52
+ }
53
+ const userValue = this.colDefPropertyCache.get(userKey);
54
+ const adaptableValue = propertyGetter(userValue);
55
+ if (adaptableValue != null) {
56
+ this.colDefPropertyCache.set(adaptableKey, adaptableValue);
57
+ }
58
+ let theValue = adaptableValue !== null && adaptableValue !== void 0 ? adaptableValue : userValue;
59
+ this.adaptableInstance.forPlugins((plugin) => {
60
+ if (plugin.interceptSetupColumnProperty) {
61
+ theValue = plugin.interceptSetupColumnProperty(colSetupInfo, propertyName, theValue, this.adaptableApi);
62
+ }
63
+ });
64
+ if (propertyName === 'aggFunc') {
65
+ if (colDef[propertyName] !== (theValue !== null && theValue !== void 0 ? theValue : null)) {
66
+ (_a = this.agGridApi) === null || _a === void 0 ? void 0 : _a.setColumnAggFunc(colId, theValue !== null && theValue !== void 0 ? theValue : null);
67
+ }
68
+ }
69
+ if (theValue === undefined && colDef[propertyName] === undefined) {
70
+ // already undefined, so don't set an own property to the same undefined value
71
+ return;
72
+ }
73
+ colDef[propertyName] = theValue;
74
+ }
75
+ getUserColDefProperty(columnId, propertyName) {
76
+ const userKey = `user.${columnId}.${propertyName}`;
77
+ return this.colDefPropertyCache.get(userKey);
78
+ }
79
+ setupColumns() {
80
+ const cols = this.agGridApi.getColumns();
81
+ // this needs to be here, before the other setup below
82
+ // so the setup methods below reference the correct columns in adaptable store
83
+ cols.forEach((col) => {
84
+ const colDef = col.getColDef();
85
+ const colId = col.getColId();
86
+ const abColumn = this.adaptableApi.columnApi.getColumnWithColumnId(colId);
87
+ const colSetupInfo = {
88
+ col,
89
+ colDef,
90
+ colId,
91
+ abColumn,
92
+ };
93
+ this.setupColumnCellRenderer(colSetupInfo);
94
+ this.setupColumnCellStyle(colSetupInfo);
95
+ this.setupColumnCellClass(colSetupInfo);
96
+ this.setupColumnTooltipValueGetter(colSetupInfo);
97
+ this.setupColumnValueGetter(colSetupInfo);
98
+ this.setupColumnFilter(colSetupInfo);
99
+ this.setupColumnFloatingFilter(colSetupInfo);
100
+ this.setupColumnValueFormatter(colSetupInfo);
101
+ this.setupColumnEditable(colSetupInfo);
102
+ this.setupColumnValueSetter(colSetupInfo);
103
+ this.setupColumnComparator(colSetupInfo);
104
+ this.setupColumnCellEditor(colSetupInfo);
105
+ this.setupColumnHeader(colSetupInfo);
106
+ this.setupColumnQuickFilerText(colSetupInfo);
107
+ this.setupColumnAllowedAggFuncs(colSetupInfo);
108
+ // this is just to make sure that AG Grid does NOT infer the cellDataType
109
+ // https://github.com/AdaptableTools/adaptable/issues/2230 should render it obsolete
110
+ this.setupColumnCellDataType(colSetupInfo);
111
+ });
112
+ }
113
+ setupColumnValueGetter({ col }) {
114
+ // need this here if we want plugins to intercept
115
+ this.setColDefProperty(col, 'valueGetter', (userValue) => {
116
+ return userValue;
117
+ });
118
+ }
119
+ setupColumnCellClass({ col, colId, abColumn }) {
120
+ this.setColDefProperty(col, 'cellClass', (userCellClass) => {
121
+ const formatColumns = this.adaptableApi.formatColumnApi.internalApi.getFormatColumnWithStyleClassNameForColumn(abColumn);
122
+ const quickSearchStyleClassName = this.adaptableApi.quickSearchApi.getQuickSearchStyle().ClassName;
123
+ const hasQuickSearchStyleClassName = StringExtensions_1.default.IsNotNullOrEmpty(quickSearchStyleClassName);
124
+ const cellClass = (params) => {
125
+ const gridCell = this.adaptableInstance.getGridCellFromRowNode(params.node, abColumn.columnId);
126
+ // if a Visual Data export is in progress, we are interested only in the Excel Style Class
127
+ if (this.adaptableApi.exportApi.internalApi.isVisualDataExportInProgress()) {
128
+ const userDefinedCellClass = typeof userCellClass === 'function' ? userCellClass(params) : userCellClass;
129
+ const cellClassKey = this.getExcelClassNameForCell(colId, gridCell.primaryKeyValue, userDefinedCellClass);
130
+ return this.adaptableApi.internalApi
131
+ .getReportService()
132
+ .getExcelStyleIdForCellClassKey(cellClassKey);
133
+ }
134
+ const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(gridCell, params);
135
+ const editableClassName = this.getEditableCellClass(gridCell, params);
136
+ const readonlyClassName = this.getReadonlyCellClass(gridCell, params);
137
+ const highlightAlertClassName = this.getAlertCellClass(gridCell, params);
138
+ const flashingClassName = this.getFlashingCellClass(gridCell, params);
139
+ const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(colId);
140
+ const hasStyledColumn = !!styledColumn && !styledColumn.IsSuspended;
141
+ const noteClassName = this.getNoteCellClassName(gridCell, params);
142
+ const commentsClassName = this.getCommentCellClassName(gridCell, params);
143
+ const returnValue = [
144
+ typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
145
+ !hasStyledColumn && formatColumns.length
146
+ ? this.getFormatColumnCellClass(formatColumns, abColumn, params)
147
+ : null,
148
+ isQuickSearchActive ? quickSearchStyleClassName : null,
149
+ editableClassName,
150
+ readonlyClassName,
151
+ highlightAlertClassName,
152
+ flashingClassName,
153
+ noteClassName,
154
+ commentsClassName,
155
+ ]
156
+ // we flatten the array because some rules ('userCellClass' etc) might return a string[]
157
+ .flat()
158
+ .filter((x) => !!x);
159
+ const result = returnValue.length ? returnValue : undefined;
160
+ return result;
161
+ };
162
+ return cellClass;
163
+ });
164
+ }
165
+ setupColumnCellStyle({ col, colId, abColumn }) {
166
+ this.setColDefProperty(col, 'cellStyle', (userCellStyle) => {
167
+ const quickSearchStyle = this.getQuickSearchCellStyle();
168
+ const hasQuickSearchStyle = quickSearchStyle != undefined;
169
+ const cellStyle = (params) => {
170
+ const gridCell = this.adaptableInstance.getGridCellFromRowNode(params.node, abColumn.columnId);
171
+ const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(gridCell, params);
172
+ const userDefined = typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle;
173
+ const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, userDefined), this.getReadOnlyCellStyle(gridCell, params)), this.getEditableCellStyle(gridCell, params)), this.getFormatColumnAndStyledColumnCellStyle(gridCell, params)), (isQuickSearchActive ? quickSearchStyle : {})), this.getAlertCellStyle(gridCell, params)), this.getFlashingCellStyle(gridCell, params)), this.getCellHighlightStyle(gridCell, params));
174
+ return (0, StyleHelper_1.normalizeStyleForAgGrid)(result);
175
+ };
176
+ return cellStyle;
177
+ });
178
+ }
179
+ setupColumnCellEditor({ colId, col }) {
180
+ const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId(colId);
181
+ const editLookUpItem = this.adaptableApi.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
182
+ const hasRichSelectCellEditor = this.adaptableInstance.agGridAdapter.isModulePresent(core_1.ModuleNames.RichSelectModule);
183
+ this.setColDefProperty(col, 'cellEditor', () => {
184
+ if (editLookUpItem) {
185
+ return hasRichSelectCellEditor ? 'agRichSelectCellEditor' : 'agSelectCellEditor';
186
+ }
187
+ });
188
+ this.setColDefProperty(col, 'cellEditorPopup', () => {
189
+ // as specified in https://www.ag-grid.com/react-data-grid/provided-cell-editors/#rich-select-cell-editor
190
+ // agRichSelectCellEditor should always set cellEditorPopup=true. Otherwise the editor will be clipped to the cell contents
191
+ if (editLookUpItem && hasRichSelectCellEditor) {
192
+ return true;
193
+ }
194
+ });
195
+ this.setColDefProperty(col, 'cellEditorParams', (params) => {
196
+ if (editLookUpItem) {
197
+ return (params) => {
198
+ const gridCell = this.adaptableInstance.getGridCellFromRowNode(params === null || params === void 0 ? void 0 : params.node, colId);
199
+ return {
200
+ values: this.adaptableApi.userInterfaceApi.getEditLookUpValuesForEditLookUpItem(editLookUpItem, gridCell),
201
+ };
202
+ };
203
+ }
204
+ });
205
+ }
206
+ setupColumnCellRenderer({ col, colId, abColumn }) {
207
+ this.setColDefProperty(col, 'cellRenderer', () => {
208
+ const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(abColumn.columnId);
209
+ if (styledColumn && !styledColumn.IsSuspended) {
210
+ if (styledColumn.PercentBarStyle) {
211
+ return (0, PercentBarRenderer_1.getPercentBarRendererForColumn)(styledColumn, abColumn, this.adaptableApi);
212
+ }
213
+ if (styledColumn.BadgeStyle) {
214
+ return (0, BadgeRenderer_1.getBadgeRendererForColumn)(styledColumn.BadgeStyle, abColumn, this.adaptableApi);
215
+ }
216
+ if (styledColumn.SparkLineStyle) {
217
+ return 'agSparklineCellRenderer';
218
+ }
219
+ }
220
+ });
221
+ this.setColDefProperty(col, 'cellRendererParams', (userDefined) => {
222
+ const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(abColumn.columnId);
223
+ if (styledColumn && !styledColumn.IsSuspended) {
224
+ if (styledColumn.SparkLineStyle) {
225
+ const sparklineOptions = (0, merge_1.default)({}, userDefined === null || userDefined === void 0 ? void 0 : userDefined.sparklineOptions, styledColumn.SparkLineStyle.options);
226
+ return Object.assign(Object.assign({}, userDefined), { sparklineOptions });
227
+ }
228
+ }
229
+ });
230
+ }
231
+ setupColumnTooltipValueGetter({ col, colId, abColumn }) {
232
+ let hasTooptip = false;
233
+ this.setColDefProperty(col, 'tooltipValueGetter', () => {
234
+ const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(colId);
235
+ if (styledColumn &&
236
+ !styledColumn.IsSuspended &&
237
+ styledColumn.PercentBarStyle &&
238
+ styledColumn.PercentBarStyle.ToolTipText) {
239
+ hasTooptip = true;
240
+ if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.PercentBarStyle) {
241
+ return (params) => {
242
+ const min = this.adaptableApi.styledColumnApi.internalApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, params.value);
243
+ const max = this.adaptableApi.styledColumnApi.internalApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, params.value);
244
+ const textOptions = styledColumn.PercentBarStyle.ToolTipText;
245
+ let returnValue = '';
246
+ if (textOptions.includes('CellValue')) {
247
+ returnValue = params.value;
248
+ }
249
+ if (textOptions.includes('PercentageValue')) {
250
+ const clampedValue = Helper_1.default.clamp(params.value, min, max);
251
+ const percentageValue = ((clampedValue - min) / (max - min)) * 100;
252
+ returnValue += ' ' + `(${percentageValue.toFixed(0)}%)`;
253
+ }
254
+ return returnValue ? returnValue : params.value;
255
+ };
256
+ }
257
+ }
258
+ });
259
+ }
260
+ setupColumnQuickFilerText({ col, abColumn }) {
261
+ this.setColDefProperty(col, 'getQuickFilterText', (userGetQuickFilterText) => {
262
+ if (userGetQuickFilterText) {
263
+ return userGetQuickFilterText;
264
+ }
265
+ return (params) => {
266
+ const visibleCoulmnsMap = this.adaptableApi.layoutApi.getCurrentVisibleColumnIdsMap();
267
+ const isVisible = visibleCoulmnsMap[abColumn.columnId];
268
+ if (!isVisible) {
269
+ return '';
270
+ }
271
+ return this.adaptableInstance.getDisplayValueFromRowNode(params.node, abColumn.columnId);
272
+ };
273
+ });
274
+ }
275
+ setupColumnAllowedAggFuncs({ col, abColumn }) {
276
+ this.setColDefProperty(col, 'allowedAggFuncs', () => {
277
+ return abColumn.availableAggregationFunctions;
278
+ });
279
+ }
280
+ setupColumnCellDataType(columnSetupInfo) {
281
+ const { col } = columnSetupInfo;
282
+ // AG Grid introduced since v30.x an inferred cellDataType
283
+ // the problem is that it breaks the default value formatter and/or editor (especially for Date columns)
284
+ this.setColDefProperty(col, 'cellDataType', () => {
285
+ return false;
286
+ });
287
+ }
288
+ setupColumnHeader({ col, abColumn }) {
289
+ var _a, _b;
290
+ const previousColumnHeader = (_a = col === null || col === void 0 ? void 0 : col.getColDef()) === null || _a === void 0 ? void 0 : _a.headerName;
291
+ this.setColDefProperty(col, 'headerName', (userHeaderName) => {
292
+ var _a;
293
+ // set the default to the AG Grid provided values
294
+ // from https://github.com/ag-grid/ag-grid/blob/v26.1.0/community-modules/core/src/ts/columns/columnModel.ts#L2515
295
+ let resultHeaderName = userHeaderName !== null && userHeaderName !== void 0 ? userHeaderName : StringExtensions_1.default.CamelCaseToHumanText(col.getColDef().field);
296
+ const layoutCustomHeader = (_a = this.adaptableApi.layoutApi.getCurrentLayout().ColumnHeadersMap) === null || _a === void 0 ? void 0 : _a[col.getColId()];
297
+ if (layoutCustomHeader) {
298
+ resultHeaderName = layoutCustomHeader;
299
+ }
300
+ // required here for the initial layout rendering
301
+ // Removed by JW, 3 october 2023; i don't think we need it and it overrides stuff unnecessarily
302
+ // abColumn.friendlyName = resultHeaderName;
303
+ return resultHeaderName;
304
+ });
305
+ const newColumnHeader = (_b = col === null || col === void 0 ? void 0 : col.getColDef()) === null || _b === void 0 ? void 0 : _b.headerName;
306
+ return previousColumnHeader !== newColumnHeader;
307
+ }
308
+ setupColumnFilter({ col, colDef }) {
309
+ this.setColDefProperty(col, 'filter', () => {
310
+ if (!colDef.filter) {
311
+ return;
312
+ }
313
+ if (!this.adaptableOptions.columnFilterOptions.useAdaptableColumnFiltering) {
314
+ return;
315
+ }
316
+ this.agGridApi.destroyFilter(col);
317
+ return (0, FilterWrapper_1.FilterWrapperFactory)(this.adaptableInstance);
318
+ });
319
+ }
320
+ setupColumnFloatingFilter({ col, colDef }) {
321
+ const isFloatingFilterDisabled = !colDef.floatingFilter ||
322
+ !this.adaptableOptions.columnFilterOptions.useAdaptableColumnFiltering;
323
+ this.adaptableOptions.columnFilterOptions.quickFilterOptions.showQuickFilter;
324
+ this.setColDefProperty(col, 'floatingFilterComponent', () => {
325
+ if (isFloatingFilterDisabled) {
326
+ return;
327
+ }
328
+ return (0, FloatingFilterWrapper_1.FloatingFilterWrapperFactory)(this.adaptableInstance);
329
+ });
330
+ this.setColDefProperty(col, 'floatingFilter', (original_floatingFilter) => {
331
+ if (isFloatingFilterDisabled) {
332
+ return;
333
+ }
334
+ return (0, FloatingFilterWrapper_1.FloatingFilterWrapperFactory)(this.adaptableInstance);
335
+ });
336
+ this.setColDefProperty(col, 'suppressFloatingFilterButton', () => {
337
+ return !isFloatingFilterDisabled;
338
+ });
339
+ }
340
+ setupColumnValueFormatter({ col, abColumn }) {
341
+ this.setColDefProperty(col, 'valueFormatter', (userPropertyValue) => {
342
+ const activeFormatColumnsWithDisplayFormat = this.adaptableApi.formatColumnApi.internalApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
343
+ if (!activeFormatColumnsWithDisplayFormat.length) {
344
+ return;
345
+ }
346
+ return (params) => {
347
+ const { node, value } = params;
348
+ const mostRelevantFormatColumn = this.adaptableApi.formatColumnApi.internalApi.getMostRelevantFormatColumnForColumn(activeFormatColumnsWithDisplayFormat, abColumn, { node, value });
349
+ if (!mostRelevantFormatColumn) {
350
+ // ALL FormatColumns are conditional and NONE of them are relevant for this row
351
+ return value;
352
+ }
353
+ const options = mostRelevantFormatColumn.DisplayFormat.Options;
354
+ if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'NumberFormatter') {
355
+ // change the Number format - if the scope allows it
356
+ if (this.adaptableApi.scopeApi.isColumnInNumericScope(abColumn, mostRelevantFormatColumn.Scope)) {
357
+ return this.adaptableApi.formatColumnApi.internalApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
358
+ }
359
+ }
360
+ if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'DateFormatter') {
361
+ // change the Date format - if the scope allows it
362
+ if (this.adaptableApi.scopeApi.isColumnInDateScope(abColumn, mostRelevantFormatColumn.Scope)) {
363
+ return this.adaptableApi.formatColumnApi.internalApi.getDateFormattedValue(params.value, params.node, abColumn, options);
364
+ }
365
+ }
366
+ if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'StringFormatter') {
367
+ // change the String format - if the scope allows it
368
+ if (this.adaptableApi.scopeApi.isColumnInStringsScope(abColumn, mostRelevantFormatColumn.Scope)) {
369
+ return this.adaptableApi.formatColumnApi.internalApi.getStringFormattedValue(params.value, params.node, abColumn, options);
370
+ }
371
+ }
372
+ // should NEVER arrive at this line, but just to be sure
373
+ return value;
374
+ };
375
+ });
376
+ }
377
+ setupColumnEditable({ col }) {
378
+ this.setColDefProperty(col, 'editable', (userValue) => {
379
+ // if AG Grid defines the column as NOT editable, we don't mess with it
380
+ if (typeof userValue === 'boolean' && userValue === false) {
381
+ return userValue;
382
+ }
383
+ const cellEditableFn = this.adaptableOptions.editOptions.isCellEditable;
384
+ const editableCallback = (params) => {
385
+ // Adaptable Row Summarie rows are not editable
386
+ if (params.node.data[RowSummary_1.ROW_SUMMARY_ROW_ID]) {
387
+ return false;
388
+ }
389
+ if (!cellEditableFn) {
390
+ return typeof userValue === 'function' ? userValue(params) : userValue;
391
+ }
392
+ const gridCell = this.adaptableInstance.getGridCellFromRowNode(params.node, params.column.getColId());
393
+ const cellEditableContext = {
394
+ gridCell,
395
+ adaptableApi: this.adaptableApi,
396
+ userName: this.adaptableOptions.userName,
397
+ adaptableId: this.adaptableOptions.adaptableId,
398
+ };
399
+ return cellEditableFn(cellEditableContext);
400
+ };
401
+ return editableCallback;
402
+ });
403
+ }
404
+ setupColumnValueSetter({ col, colId, abColumn }) {
405
+ this.setColDefProperty(col, 'valueSetter', (userValueSetter) => {
406
+ var _a;
407
+ const preventEditAlertsForColumn = this.adaptableApi.alertApi.internalApi
408
+ .getAlertDefinitionsWithPreventEdit()
409
+ .filter((alertDefinition) => {
410
+ return this.adaptableApi.scopeApi.isColumnInScope(abColumn, alertDefinition.Scope);
411
+ });
412
+ const noValidations = !preventEditAlertsForColumn.length && !((_a = this.adaptableOptions.editOptions) === null || _a === void 0 ? void 0 : _a.validateOnServer);
413
+ if (noValidations) {
414
+ return;
415
+ }
416
+ const valueSetter = (params) => {
417
+ var _a;
418
+ const field = params.column.getColDef().field;
419
+ if (noValidations) {
420
+ //TODO also consider the case when userValueSetter is a string
421
+ if (typeof userValueSetter === 'function') {
422
+ return userValueSetter(params);
423
+ }
424
+ // we allowed it go reach this point
425
+ // just to run isCellEditable
426
+ // and since this has already run and we have no other validations
427
+ // just assign the new value and exit
428
+ if (field) {
429
+ params.data[field] = params.newValue;
430
+ }
431
+ return true;
432
+ }
433
+ const cellDataChangedInfo = this.adaptableApi.internalApi.buildDataChangedInfo({
434
+ oldValue: params.oldValue,
435
+ newValue: params.newValue,
436
+ column: this.adaptableApi.columnApi.getColumnWithColumnId(params.column.getColId()),
437
+ primaryKeyValue: this.adaptableInstance.getPrimaryKeyValueFromRowNode(params.node, params.api),
438
+ rowNode: params.node,
439
+ trigger: 'edit',
440
+ });
441
+ if (cellDataChangedInfo.oldValue === cellDataChangedInfo.newValue) {
442
+ return true;
443
+ }
444
+ /**
445
+ * Validate on the future row, with the new value.
446
+ * structuredClone fails, it contains functions.
447
+ */
448
+ const newRow = Object.assign(Object.assign({}, params.node), { data: Object.assign({}, params.node.data) });
449
+ newRow.data[field] = params.newValue;
450
+ const cellDataChangeInfoForSyncValidation = Object.assign(Object.assign({}, cellDataChangedInfo), { rowNode: newRow });
451
+ if (!this.adaptableInstance.ValidationService.performValidation(cellDataChangeInfoForSyncValidation)) {
452
+ return false;
453
+ }
454
+ const onServerValidationCompleted = () => { };
455
+ if ((_a = this.adaptableOptions.editOptions) === null || _a === void 0 ? void 0 : _a.validateOnServer) {
456
+ this.adaptableInstance.ValidationService.performServerValidation(cellDataChangedInfo, {
457
+ onServerValidationCompleted,
458
+ })();
459
+ }
460
+ //TODO also consider the case when userValueSetter is a string
461
+ if (typeof userValueSetter === 'function') {
462
+ return userValueSetter(params);
463
+ }
464
+ if (field) {
465
+ params.data[field] = params.newValue;
466
+ }
467
+ else {
468
+ throw `Cannot edit a column without a field - column id was ${colId}`;
469
+ }
470
+ return true;
471
+ };
472
+ return valueSetter;
473
+ });
474
+ }
475
+ setupColumnComparator({ col, colId, abColumn }) {
476
+ const customSort = this.adaptableApi.customSortApi.getCustomSortForColumn(colId);
477
+ const columnSortComparer = this.adaptableApi.customSortApi.internalApi.getCustomSortComparer(abColumn.columnId);
478
+ const comparatorGetter = (propName) => {
479
+ return () => {
480
+ return this.adaptableApi.columnApi.internalApi.getActiveColumnComparator(colId, customSort, columnSortComparer);
481
+ };
482
+ };
483
+ this.setColDefProperty(col, 'comparator', comparatorGetter('comparator'));
484
+ this.setColDefProperty(col, 'pivotComparator', comparatorGetter('pivotComparator'));
485
+ }
486
+ getExcelClassNameForCell(colId, primaryKeyValue, userDefinedCellClass) {
487
+ let excelClassName = `--excel-cell-${colId}-${primaryKeyValue}`;
488
+ if (excelClassName.indexOf(' ') > 0) {
489
+ excelClassName = excelClassName.replace(/\s/g, '_');
490
+ }
491
+ return userDefinedCellClass != null
492
+ ? `${excelClassName}-${Array.isArray(userDefinedCellClass)
493
+ ? userDefinedCellClass.join('-')
494
+ : userDefinedCellClass}`
495
+ : excelClassName;
496
+ }
497
+ isQuickSearchActive(gridCell, params) {
498
+ let quickSearchValue = this.adaptableApi.quickSearchApi.getQuickSearchValue();
499
+ if (StringExtensions_1.default.IsNullOrEmpty(quickSearchValue)) {
500
+ return false;
501
+ }
502
+ if (gridCell.column.isExcludedFromQuickSearch) {
503
+ return false;
504
+ }
505
+ if (!params.node) {
506
+ return false;
507
+ }
508
+ if (!gridCell.isPivotCell &&
509
+ !this.adaptableApi.optionsApi.getQuickSearchOptions().runQuickSearchOnRowGroups &&
510
+ params.node.group) {
511
+ return false;
512
+ }
513
+ if (!this.adaptableApi.optionsApi.getQuickSearchOptions().runQuickSearchOnPivotColumns &&
514
+ gridCell.isPivotCell) {
515
+ return false;
516
+ }
517
+ if (this.adaptableApi.optionsApi.getQuickSearchOptions().runQuickSearchOnPivotColumns &&
518
+ gridCell.isPivotCell) {
519
+ gridCell.displayValue = params.value;
520
+ }
521
+ const ignoreCase = !this.adaptableOptions.quickSearchOptions.runQuickSearchWithCaseSensitivity;
522
+ const displayValue = ignoreCase
523
+ ? String(gridCell.displayValue).toLocaleLowerCase()
524
+ : String(gridCell.displayValue);
525
+ const i = ignoreCase ? String(quickSearchValue).toLocaleLowerCase() : String(quickSearchValue);
526
+ const applyQuickSearchFunction = this.adaptableOptions.quickSearchOptions.runBespokeQuickSearch;
527
+ if (applyQuickSearchFunction) {
528
+ const quickSearchContext = Object.assign(Object.assign({}, (0, ObjectFactory_1.createBaseContext)(this.adaptableApi)), { gridCell, quickSearchValue: quickSearchValue });
529
+ return applyQuickSearchFunction(quickSearchContext);
530
+ }
531
+ return displayValue.indexOf(i) !== -1;
532
+ }
533
+ getEditableCellClass(gridCell, params) {
534
+ const editableCellStyle = this.adaptableApi.userInterfaceApi.getEditableCellStyle();
535
+ if (!(editableCellStyle === null || editableCellStyle === void 0 ? void 0 : editableCellStyle.ClassName)) {
536
+ return null;
537
+ }
538
+ const isCellEditable = this.adaptableApi.gridApi.isCellEditable(gridCell);
539
+ return isCellEditable ? editableCellStyle.ClassName : null;
540
+ }
541
+ getReadonlyCellClass(gridCell, params) {
542
+ const readonlyCellStyle = this.adaptableApi.userInterfaceApi.getReadOnlyCellStyle();
543
+ if (!(readonlyCellStyle === null || readonlyCellStyle === void 0 ? void 0 : readonlyCellStyle.ClassName)) {
544
+ return null;
545
+ }
546
+ const isCellReadonly = !this.adaptableApi.gridApi.isCellEditable(gridCell);
547
+ return isCellReadonly ? readonlyCellStyle.ClassName : null;
548
+ }
549
+ getAlertCellClass(gridCell, params) {
550
+ var _a, _b;
551
+ const alert = this.adaptableApi.alertApi.internalApi.getAdaptableAlertWithHighlightCell(gridCell.column.columnId, params.node);
552
+ const highlightCell = (_b = (_a = alert === null || alert === void 0 ? void 0 : alert.alertDefinition) === null || _a === void 0 ? void 0 : _a.AlertProperties) === null || _b === void 0 ? void 0 : _b.HighlightCell;
553
+ return typeof highlightCell === 'object' && (highlightCell === null || highlightCell === void 0 ? void 0 : highlightCell.ClassName)
554
+ ? highlightCell === null || highlightCell === void 0 ? void 0 : highlightCell.ClassName
555
+ : null;
556
+ }
557
+ getFlashingCellClass(gridcell, params) {
558
+ var _a, _b, _c;
559
+ const primaryKey = params.node.aggData ? params.node.id : gridcell.primaryKeyValue;
560
+ const flashingCell = this.adaptableApi.flashingCellApi.internalApi.getAdaptableFlashingCellFor(primaryKey, gridcell.column.columnId);
561
+ if (!flashingCell) {
562
+ return;
563
+ }
564
+ return flashingCell.direction === 'up'
565
+ ? (_a = flashingCell.flashingCellDefinition.UpChangeStyle) === null || _a === void 0 ? void 0 : _a.ClassName
566
+ : flashingCell.direction === 'down'
567
+ ? (_b = flashingCell.flashingCellDefinition.DownChangeStyle) === null || _b === void 0 ? void 0 : _b.ClassName
568
+ : flashingCell.direction === 'neutral'
569
+ ? (_c = flashingCell.flashingCellDefinition.NeutralChangeStyle) === null || _c === void 0 ? void 0 : _c.ClassName
570
+ : undefined;
571
+ }
572
+ getNoteCellClassName(gridCell, params) {
573
+ if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Note')) {
574
+ return;
575
+ }
576
+ if (!this.adaptableApi.noteApi.internalApi.areNotesSupported()) {
577
+ return;
578
+ }
579
+ const cellPosition = {
580
+ PrimaryKeyValue: gridCell.primaryKeyValue,
581
+ ColumnId: gridCell.column.columnId,
582
+ };
583
+ const cellNotes = this.adaptableApi.noteApi.getNotesForCell(cellPosition);
584
+ if (!(cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length)) {
585
+ return undefined;
586
+ }
587
+ return 'ab-Cell-Note';
588
+ }
589
+ getCommentCellClassName(gridCell, params) {
590
+ if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comment')) {
591
+ return;
592
+ }
593
+ if (!this.adaptableApi.commentApi.internalApi.areCommentsSupported()) {
594
+ return;
595
+ }
596
+ const position = {
597
+ PrimaryKeyValue: gridCell.primaryKeyValue,
598
+ ColumnId: gridCell.column.columnId,
599
+ };
600
+ const cellComments = this.adaptableApi.commentApi.getCommentThread(position);
601
+ if (!cellComments) {
602
+ return undefined;
603
+ }
604
+ return 'ab-Cell-Comment';
605
+ }
606
+ getFormatColumnCellClass(formatColumns, abColumn, params) {
607
+ const classNames = formatColumns
608
+ .map((formatColumn) => {
609
+ var _a, _b;
610
+ if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
611
+ this.adaptableApi.formatColumnApi.internalApi.formatColumnShouldRender(formatColumn, abColumn, params.node, params.value)) {
612
+ return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
613
+ }
614
+ })
615
+ .filter((x) => !!x);
616
+ return classNames;
617
+ }
618
+ getQuickSearchCellStyle() {
619
+ const quickSearchStyle = this.adaptableApi.quickSearchApi.getQuickSearchStyle();
620
+ if (!quickSearchStyle || StringExtensions_1.default.IsNotNullOrEmpty(quickSearchStyle.ClassName)) {
621
+ return undefined;
622
+ }
623
+ return (0, StyleHelper_1.convertAdaptableStyleToCSS)(quickSearchStyle);
624
+ }
625
+ getReadOnlyCellStyle(gridCell, params) {
626
+ const editableCellStyle = this.adaptableApi.userInterfaceApi.getReadOnlyCellStyle();
627
+ if (!editableCellStyle) {
628
+ return undefined;
629
+ }
630
+ if (gridCell) {
631
+ if (!this.adaptableApi.gridApi.isCellEditable(gridCell)) {
632
+ return (0, StyleHelper_1.convertAdaptableStyleToCSS)(editableCellStyle);
633
+ }
634
+ }
635
+ return undefined;
636
+ }
637
+ getEditableCellStyle(gridCell, params) {
638
+ const editableCellStyle = this.adaptableApi.userInterfaceApi.getEditableCellStyle();
639
+ if (!editableCellStyle) {
640
+ return undefined;
641
+ }
642
+ if (gridCell) {
643
+ if (this.adaptableApi.gridApi.isCellEditable(gridCell)) {
644
+ return (0, StyleHelper_1.convertAdaptableStyleToCSS)(editableCellStyle);
645
+ }
646
+ }
647
+ return undefined;
648
+ }
649
+ /**
650
+ * The combination of styled column and format cells
651
+ * This functiond decides when the two can be merged.
652
+ */
653
+ getFormatColumnAndStyledColumnCellStyle(gridCell, params) {
654
+ let styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(gridCell.column.columnId);
655
+ let styledColumnStyle = {};
656
+ if (styledColumn && !(styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended)) {
657
+ const styledCellStyle = this.getStyledColumnStyle(styledColumn, gridCell.column, params);
658
+ // for percentbar we want to merge
659
+ if (styledColumn.PercentBarStyle || styledColumn.BadgeStyle) {
660
+ styledColumnStyle = styledCellStyle;
661
+ }
662
+ else {
663
+ // For other ones wo do not want to merge
664
+ return styledCellStyle;
665
+ }
666
+ }
667
+ const activeFormatColumnsWithStyle = this.adaptableApi.formatColumnApi.internalApi.getFormatColumnsWithStyleForColumn(gridCell.column);
668
+ return Object.assign(Object.assign({}, this.getFormatColumnCellStyle(gridCell.column, activeFormatColumnsWithStyle, params)), styledColumnStyle);
669
+ }
670
+ getStyledColumnStyle(styledColumn, abColumn, params) {
671
+ var _a, _b, _c;
672
+ let style = {};
673
+ const gradientStyle = styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.GradientStyle;
674
+ if (params.value === undefined) {
675
+ return;
676
+ }
677
+ let colValue = params.value;
678
+ if (this.adaptableApi.gridApi.isGroupRowNode(params.node)) {
679
+ return style;
680
+ // if (styledColumn.IncludeGroupedRows) {
681
+ // const minColumnValue =
682
+ // this.adaptableApi.styledColumnApi.internalApi.getMinValueForNumericColumn(abColumn);
683
+ // const maxColumnValue =
684
+ // this.adaptableApi.styledColumnApi.internalApi.getMaxValueForNumericColumn(abColumn);
685
+ // /**
686
+ // * Color should always be in bounds, it should not overflow.
687
+ // * If the value is out of range, it shoul set the maximum/minimum color.
688
+ // */
689
+ // colValue = clamp(params.value, minColumnValue, maxColumnValue);
690
+ // } else {
691
+ // return style;
692
+ // }
693
+ }
694
+ if (styledColumn.BadgeStyle &&
695
+ !((_a = styledColumn.BadgeStyle.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeSummaryRows) &&
696
+ ((_c = (_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c[RowSummary_1.ROW_SUMMARY_ROW_ID])) {
697
+ return style;
698
+ }
699
+ if (gradientStyle) {
700
+ const min = this.adaptableApi.styledColumnApi.internalApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, colValue);
701
+ const max = this.adaptableApi.styledColumnApi.internalApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, colValue);
702
+ let cellBackColor;
703
+ let reverseGradient = false;
704
+ if (gradientStyle.ColumnComparison) {
705
+ cellBackColor = gradientStyle.ColumnComparison.Color;
706
+ }
707
+ else {
708
+ const matchingRange = this.adaptableApi.styledColumnApi.internalApi.findRangeForColumn(gradientStyle.CellRanges, abColumn, gradientStyle.RangeValueType, colValue);
709
+ if (matchingRange) {
710
+ cellBackColor = matchingRange.Color;
711
+ reverseGradient = matchingRange.ReverseGradient;
712
+ }
713
+ }
714
+ const increase = Math.abs(max - min);
715
+ const percentage = ((colValue - min) / increase) * 100;
716
+ let alpha = Number((percentage / 100).toPrecision(2));
717
+ if (reverseGradient) {
718
+ alpha = 1 - alpha;
719
+ }
720
+ const preparedColor = (0, StyleHelper_1.getVariableColor)(cellBackColor);
721
+ // if no range match, do not apply color (black in this case)
722
+ if (cellBackColor) {
723
+ style.backgroundColor = (0, tinycolor2_1.default)(preparedColor).setAlpha(alpha).toRgbString();
724
+ }
725
+ }
726
+ if (styledColumn.PercentBarStyle && styledColumn.PercentBarStyle.CellText) {
727
+ style.paddingTop = 0;
728
+ style.paddingBottom = 0;
729
+ }
730
+ return style;
731
+ }
732
+ getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params) {
733
+ if (!activeFormatColumnsWithStyle.length) {
734
+ return {};
735
+ }
736
+ const relevantFormatColumnsWithStyle = activeFormatColumnsWithStyle.filter((formatColumn) => {
737
+ return this.adaptableApi.formatColumnApi.internalApi.formatColumnShouldRender(formatColumn, abColumn, params.node, params.value);
738
+ });
739
+ return this.getFormatColumnAdaptableStyle(relevantFormatColumnsWithStyle);
740
+ }
741
+ getFormatColumnAdaptableStyle(formatColumns) {
742
+ // first has more precedence, then they need to be applied in reverse order
743
+ return formatColumns.reduceRight((style, formatColumn) => {
744
+ const formatColumnStyle = formatColumn.Style
745
+ ? (0, StyleHelper_1.convertAdaptableStyleToCSS)(formatColumn.Style)
746
+ : {};
747
+ if (formatColumn.CellAlignment) {
748
+ switch (formatColumn.CellAlignment) {
749
+ case 'Left':
750
+ style.textAlign = 'left';
751
+ break;
752
+ case 'Right':
753
+ style.textAlign = 'right';
754
+ break;
755
+ case 'Center':
756
+ style.textAlign = 'center';
757
+ break;
758
+ }
759
+ }
760
+ return Object.assign(Object.assign({}, style), formatColumnStyle);
761
+ }, {});
762
+ }
763
+ getAlertCellStyle(gridCell, params) {
764
+ const alert = this.adaptableApi.alertApi.internalApi.getAdaptableAlertWithHighlightCell(gridCell.column.columnId, params.node);
765
+ if (alert) {
766
+ const highlightCell = alert.alertDefinition.AlertProperties.HighlightCell;
767
+ if (typeof highlightCell === 'object') {
768
+ return (0, StyleHelper_1.convertAdaptableStyleToCSS)(highlightCell);
769
+ }
770
+ return {
771
+ backgroundColor: UIHelper_1.default.getColorByMessageType(alert.alertDefinition.MessageType),
772
+ };
773
+ }
774
+ }
775
+ getFlashingCellStyle(gridCell, params) {
776
+ var _a;
777
+ const primaryKey = params.node.aggData ? params.node.id : gridCell.primaryKeyValue;
778
+ const flashingCell = this.adaptableApi.flashingCellApi.internalApi.getAdaptableFlashingCellFor(primaryKey, gridCell.column.columnId);
779
+ if (!flashingCell) {
780
+ return {};
781
+ }
782
+ return (0, StyleHelper_1.convertAdaptableStyleToCSS)((_a = (flashingCell.direction === 'up'
783
+ ? flashingCell.flashingCellDefinition.UpChangeStyle
784
+ : flashingCell.direction === 'down'
785
+ ? flashingCell.flashingCellDefinition.DownChangeStyle
786
+ : flashingCell.flashingCellDefinition.NeutralChangeStyle)) !== null && _a !== void 0 ? _a : {});
787
+ }
788
+ getCellHighlightStyle(gridCell, params) {
789
+ const cellHightlight = this.adaptableApi.internalApi
790
+ .getSystemState()
791
+ .HighlightedCells.find((cellHighlightInfo) => {
792
+ return (gridCell.column.columnId === cellHighlightInfo.columnId &&
793
+ cellHighlightInfo.primaryKeyValue === gridCell.primaryKeyValue);
794
+ });
795
+ if (cellHightlight) {
796
+ return (0, StyleHelper_1.convertAdaptableStyleToCSS)(cellHightlight.highlightStyle);
797
+ }
798
+ }
799
+ }
800
+ exports.AgGridColumnAdapter = AgGridColumnAdapter;