@adaptabletools/adaptable 18.0.0-canary.3 → 18.0.0-canary.30

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