@adaptabletools/adaptable 23.0.0-canary.3 → 23.0.0-canary.5

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 (277) hide show
  1. package/index.css +116 -61
  2. package/package.json +9 -4
  3. package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -4
  4. package/src/AdaptableOptions/EditOptions.d.ts +2 -2
  5. package/src/AdaptableOptions/FilterOptions.d.ts +0 -7
  6. package/src/AdaptableState/Common/AdaptableForm.d.ts +18 -1
  7. package/src/AdaptableState/Common/AdaptableForm.js +31 -0
  8. package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
  9. package/src/AdaptableState/Common/AggregationColumns.js +27 -2
  10. package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +3 -2
  11. package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
  12. package/src/AdaptableState/Common/Enums.d.ts +5 -10
  13. package/src/AdaptableState/Common/Enums.js +4 -10
  14. package/src/AdaptableState/PlusMinusState.d.ts +3 -3
  15. package/src/AdaptableState/ShortcutState.d.ts +2 -6
  16. package/src/AdaptableState/StyledColumnState.d.ts +3 -5
  17. package/src/AdaptableState/ThemeState.d.ts +33 -28
  18. package/src/Api/EventApi.d.ts +14 -1
  19. package/src/Api/Events/ThemeChanged.d.ts +6 -0
  20. package/src/Api/Events/ThemeSelected.d.ts +11 -0
  21. package/src/Api/Events/ThemeSelected.js +1 -0
  22. package/src/Api/Implementation/EventApiImpl.js +4 -0
  23. package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -2
  24. package/src/Api/Implementation/LayoutApiImpl.js +0 -14
  25. package/src/Api/Implementation/LayoutHelpers.d.ts +2 -0
  26. package/src/Api/Implementation/LayoutHelpers.js +29 -7
  27. package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
  28. package/src/Api/Implementation/ThemeApiImpl.js +19 -15
  29. package/src/Api/Internal/EventInternalApi.d.ts +2 -0
  30. package/src/Api/Internal/EventInternalApi.js +8 -1
  31. package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
  32. package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
  33. package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
  34. package/src/Api/Internal/ThemeInternalApi.js +0 -10
  35. package/src/Api/LayoutApi.d.ts +1 -8
  36. package/src/Api/ThemeApi.d.ts +6 -2
  37. package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
  38. package/src/Strategy/CalculatedColumnModule.js +3 -1
  39. package/src/Strategy/FormatColumnModule.js +14 -7
  40. package/src/Strategy/LayoutModule.js +13 -8
  41. package/src/Strategy/StyledColumnModule.js +64 -36
  42. package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
  43. package/src/Utilities/Constants/ReduxConstants.js +1 -14
  44. package/src/Utilities/Helpers/FormatHelper.js +20 -1
  45. package/src/Utilities/Helpers/SparklineOptionsHelper.d.ts +7 -0
  46. package/src/Utilities/Helpers/SparklineOptionsHelper.js +65 -0
  47. package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
  48. package/src/Utilities/Helpers/StyledColumnGradientHelper.js +204 -0
  49. package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
  50. package/src/Utilities/Helpers/ThemeHelpers.js +38 -0
  51. package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
  52. package/src/Utilities/Helpers/percentBarPreviewHelper.js +143 -0
  53. package/src/Utilities/ObjectFactory.d.ts +1 -3
  54. package/src/Utilities/ObjectFactory.js +0 -8
  55. package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +1 -0
  56. package/src/Utilities/Services/CalculatedColumnExpressionService.js +7 -0
  57. package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +4 -0
  58. package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +115 -0
  59. package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +1 -0
  60. package/src/Utilities/Services/ThemeService.js +1 -1
  61. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
  62. package/src/View/Alert/Wizard/AlertButtonsEditor.js +114 -103
  63. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +13 -14
  64. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +55 -55
  65. package/src/View/Alert/Wizard/AlertRulesWizardSection.js +3 -2
  66. package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +2 -2
  67. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +31 -39
  68. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +3 -4
  69. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
  70. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +30 -17
  71. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
  72. package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +3 -3
  73. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  74. package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
  75. package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
  76. package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +35 -52
  77. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
  78. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
  79. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +21 -0
  80. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
  81. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +10 -7
  82. package/src/View/Comments/CommentsEditor.js +1 -1
  83. package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +1 -1
  84. package/src/View/Components/ModuleProfile.js +1 -1
  85. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
  86. package/src/View/Components/Popups/WindowPopups/windowFactory.js +0 -1
  87. package/src/View/Components/RangesComponent.d.ts +7 -2
  88. package/src/View/Components/RangesComponent.js +94 -22
  89. package/src/View/Components/Selectors/ColumnSelector.js +5 -0
  90. package/src/View/Components/StyleComponent.d.ts +1 -0
  91. package/src/View/Components/StyleComponent.js +1 -1
  92. package/src/View/Components/ValueSelector/index.js +70 -57
  93. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
  94. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
  95. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  96. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
  97. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +6 -4
  98. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +3 -2
  99. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +5 -15
  100. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -26
  101. package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -13
  102. package/src/View/Export/Wizard/ReportRowsWizardSection.js +20 -22
  103. package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
  104. package/src/View/Export/Wizard/ScheduledReportSettings.js +13 -13
  105. package/src/View/Export/Wizard/ScheduledReportWizard.js +4 -5
  106. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
  107. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +24 -23
  108. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
  109. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +21 -5
  110. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
  111. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
  112. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +117 -12
  113. package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
  114. package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +66 -0
  115. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
  116. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +30 -0
  117. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +13 -8
  118. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
  119. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
  120. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +62 -13
  121. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +5 -3
  122. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
  123. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +15 -0
  124. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
  125. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +53 -0
  126. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
  127. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +33 -68
  128. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +15 -11
  129. package/src/View/Layout/LayoutViewPanel.js +23 -21
  130. package/src/View/Layout/TransposedPopup.js +2 -2
  131. package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
  132. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
  133. package/src/View/Layout/Wizard/sections/AggregationsSection.js +115 -26
  134. package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
  135. package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
  136. package/src/View/Layout/Wizard/sections/GridFilterSection.js +11 -11
  137. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
  138. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -52
  139. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
  140. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
  141. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
  142. package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
  143. package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
  144. package/src/View/Layout/Wizard/sections/SettingsSection.js +4 -5
  145. package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
  146. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  147. package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +9 -14
  148. package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
  149. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
  150. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +43 -13
  151. package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +11 -18
  152. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
  153. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +6 -22
  154. package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
  155. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
  156. package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +11 -18
  157. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +17 -6
  158. package/src/View/Shortcut/Wizard/ShortcutWizard.js +3 -3
  159. package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
  160. package/src/View/Shortcut/shortcutOperations.js +28 -0
  161. package/src/View/SpecialColumnSettingsWizardStep.js +9 -8
  162. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
  163. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +24 -15
  164. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
  165. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +96 -16
  166. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
  167. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +45 -24
  168. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
  169. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +108 -33
  170. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +21 -13
  171. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
  172. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +121 -23
  173. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
  174. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +34 -11
  175. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
  176. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +86 -12
  177. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
  178. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +121 -34
  179. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
  180. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -75
  181. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
  182. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +16 -0
  183. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +7 -13
  184. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
  185. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +4 -3
  186. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
  187. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +12 -14
  188. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
  189. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +16 -0
  190. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
  191. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +31 -3
  192. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
  193. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +58 -0
  194. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
  195. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +30 -0
  196. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
  197. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +91 -0
  198. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
  199. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +52 -0
  200. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
  201. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +53 -0
  202. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
  203. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +58 -0
  204. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
  205. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +126 -0
  206. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
  207. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
  208. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +52 -29
  209. package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
  210. package/src/View/Theme/ThemePopup.d.ts +2 -14
  211. package/src/View/Theme/ThemePopup.js +1 -36
  212. package/src/View/UIHelper.js +1 -1
  213. package/src/View/Wizard/OnePageAdaptableWizard.js +7 -21
  214. package/src/View/renderWithAdaptableContext.js +2 -3
  215. package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
  216. package/src/agGrid/AdaptableAgGrid.js +38 -43
  217. package/src/agGrid/AgGridAdapter.d.ts +1 -1
  218. package/src/agGrid/AgGridAdapter.js +27 -17
  219. package/src/agGrid/AgGridColumnAdapter.js +10 -19
  220. package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
  221. package/src/agGrid/AgGridMenuAdapter.js +20 -37
  222. package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
  223. package/src/agGrid/buildValueAggregationMenuItem.js +111 -0
  224. package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
  225. package/src/agGrid/cellRenderers/IconRenderer.js +43 -15
  226. package/src/agGrid/createAgGridIcon.d.ts +10 -0
  227. package/src/agGrid/createAgGridIcon.js +16 -0
  228. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +11 -6
  229. package/src/components/Combobox/VirtualizedList.js +5 -5
  230. package/src/components/Combobox/comboboxUtils.d.ts +4 -1
  231. package/src/components/Combobox/comboboxUtils.js +2 -0
  232. package/src/components/Combobox/index.d.ts +1 -0
  233. package/src/components/Combobox/index.js +35 -15
  234. package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
  235. package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
  236. package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
  237. package/src/components/Input/NumberInput.js +1 -1
  238. package/src/components/Panel/index.js +1 -1
  239. package/src/components/SimpleButton/index.js +4 -4
  240. package/src/components/Toggle/Toggle.js +1 -1
  241. package/src/components/Toggle/ToggleGroup.js +1 -1
  242. package/src/components/Tree/TreeDropdown/index.js +2 -6
  243. package/src/env.js +2 -2
  244. package/src/layout-manager/src/LayoutManagerModel.d.ts +5 -1
  245. package/src/layout-manager/src/index.js +2 -9
  246. package/src/metamodel/adaptable.metamodel.d.ts +39 -46
  247. package/src/metamodel/adaptable.metamodel.js +1 -1
  248. package/src/types.d.ts +5 -5
  249. package/themes/dark.css +1 -68
  250. package/themes/light.css +1 -5
  251. package/tsconfig.esm.tsbuildinfo +1 -1
  252. package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
  253. package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -4
  254. package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
  255. package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -63
  256. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
  257. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -55
  258. package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
  259. package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -137
  260. package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
  261. package/src/Aggregation/parameterizedAggregationHeader.js +0 -60
  262. package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
  263. package/src/Aggregation/parameterizedAggregationHelpers.js +0 -111
  264. package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
  265. package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -66
  266. package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
  267. package/src/Aggregation/validateParameterizedAggregations.js +0 -20
  268. package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
  269. package/src/View/AdaptableComputedCSSVarsContext.js +0 -29
  270. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
  271. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -43
  272. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
  273. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -28
  274. package/src/View/Theme/VariantSelector.d.ts +0 -8
  275. package/src/View/Theme/VariantSelector.js +0 -20
  276. package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
  277. package/src/components/Select/CSSNumericVariableWatch.js +0 -45
@@ -1,4 +1,3 @@
1
- import throttle from '../Utilities/utils/throttle';
2
1
  import debounce from '../Utilities/utils/debounce';
3
2
  import { createGrid, LocalEventService, } from 'ag-grid-enterprise';
4
3
  import { AdaptableLogger } from './AdaptableLogger';
@@ -21,6 +20,7 @@ import { ThemeService } from '../Utilities/Services/ThemeService';
21
20
  import { ValidationService } from '../Utilities/Services/ValidationService';
22
21
  import { ModuleService } from '../Utilities/Services/ModuleService';
23
22
  import { CalculatedColumnExpressionService } from '../Utilities/Services/CalculatedColumnExpressionService';
23
+ import { expandCellDataChangedInfosWithCalculatedColumns } from '../Utilities/Services/CalculatedColumnSyntheticChange';
24
24
  import { QueryLanguageService } from '../Utilities/Services/QueryLanguageService';
25
25
  import { AlertService } from '../Utilities/Services/AlertService';
26
26
  import { TeamSharingService } from '../Utilities/Services/TeamSharingService';
@@ -78,12 +78,8 @@ import { AgGridOptionsService } from './AgGridOptionsService';
78
78
  import { parseDateValue } from '../Utilities/Helpers/DateHelper';
79
79
  import { AgGridColumnAdapter } from './AgGridColumnAdapter';
80
80
  import getScrollbarSize from '../Utilities/getScrollbarSize';
81
- import { ONLY_AGG_FN_NAME } from '../AdaptableState/Common/AggregationColumns';
82
- import { computeParameterizedAggregation, getParameterizedAggregationDefinitions, } from '../Aggregation/ParameterizedAggregationRegistry';
83
- import { getParameterizedAggForColumn } from '../Aggregation/parameterizedAggregationHelpers';
84
- import { getParameterizedAggregationHeaderParenthesisValue } from '../Aggregation/parameterizedAggregationHeader';
81
+ import { ONLY_AGG_FN_NAME, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../AdaptableState/Common/AggregationColumns';
85
82
  import { RowFormService } from '../Utilities/Services/RowFormService';
86
- import { FilterOnDataChangeOptions } from '../AdaptableState/Common/Enums';
87
83
  import { ADAPTABLE_PUBLISH_TIMESTAMP } from '../EnvVars';
88
84
  import { AdaptableUpgradeHelper } from '../migration/AdaptableUpgradeHelper';
89
85
  import { ensureLoadingScreenPortalElement } from '../components/Modal';
@@ -91,10 +87,11 @@ import { AdaptableLoadingScreen } from '../View/Components/Popups/AdaptableLoadi
91
87
  import { createElement } from 'react';
92
88
  import { createAgStatusPanelComponent } from '../Utilities/createAgStatusPanelComponent';
93
89
  import { only } from '../Utilities/only';
90
+ import { weightedAverage } from '../Utilities/weightedAverage';
94
91
  import { ROW_SUMMARY_ROW_ID } from '../AdaptableState/Common/RowSummary';
95
92
  import { FlashingCellService } from '../Utilities/Services/FlashingCellService';
96
93
  import { AgGridExportAdapter } from './AgGridExportAdapter';
97
- import { checkForDuplicateColumns, getLayoutRowGroupValuesExceptionGroupKeys, isPivotLayout, layoutModelToLayoutState, layoutStateToLayoutModel, normalizeLayout, } from '../Api/Implementation/LayoutHelpers';
94
+ import { checkForDuplicateColumns, resetLayoutHelperErrorOnceMessages, getLayoutRowGroupValuesExceptionGroupKeys, isPivotLayout, layoutModelToLayoutState, layoutStateToLayoutModel, normalizeLayout, } from '../Api/Implementation/LayoutHelpers';
98
95
  import { LayoutManager } from '../layout-manager/src';
99
96
  import { rowGroupDisplayTypeToGridOption } from '../layout-manager/src/rowGroupDisplayType';
100
97
  import { isPivotLayoutModel } from '../layout-manager/src/isPivotLayoutModel';
@@ -204,7 +201,6 @@ export class AdaptableAgGrid {
204
201
  LicenseService;
205
202
  ChartingService;
206
203
  rowListeners;
207
- throttleFilterOnDataChange;
208
204
  debouncedSetSelectedRows;
209
205
  debouncedSetSelectedCells;
210
206
  agGridListenerKeydown;
@@ -356,6 +352,7 @@ export class AdaptableAgGrid {
356
352
  this._rawAdaptableOptions.adaptableId = `adaptable_id_${Date.now()}`;
357
353
  }
358
354
  this.logger = this.logger ?? new AdaptableLogger(this._rawAdaptableOptions.adaptableId);
355
+ resetLayoutHelperErrorOnceMessages();
359
356
  const adaptableId = this._rawAdaptableOptions.adaptableId;
360
357
  const initMarker = getMarker(adaptableId).track.Init.label.Init.start();
361
358
  const perfInitAdaptableAgGrid = this.logger.beginPerf(`Adaptable._initAdaptableAgGrid()`);
@@ -901,16 +898,7 @@ export class AdaptableAgGrid {
901
898
  // #customize_header
902
899
  const defaultColDef = { ...original_defaultColDef };
903
900
  defaultColDef.headerValueGetter = tagProvidedByAdaptable((params) => {
904
- let columnHeaderName = this.api.columnApi.internalApi.getColumnHeaderName(params);
905
- const currentLayout = this.api.layoutApi.getCurrentLayout();
906
- if (params.column &&
907
- !currentLayout.SuppressAggFuncInHeader &&
908
- params.location === 'header') {
909
- const parameterizedParenthesisValue = getParameterizedAggregationHeaderParenthesisValue(this.api, params.column.getColId(), currentLayout);
910
- if (parameterizedParenthesisValue) {
911
- columnHeaderName = parameterizedParenthesisValue;
912
- }
913
- }
901
+ const columnHeaderName = this.api.columnApi.internalApi.getColumnHeaderName(params);
914
902
  const formattedHeaderName = this.api.formatColumnApi.internalApi.formatColumnHeaderName(columnHeaderName, params);
915
903
  return formattedHeaderName;
916
904
  });
@@ -1124,16 +1112,17 @@ export class AdaptableAgGrid {
1124
1112
  aggregationFunctions[ONLY_AGG_FN_NAME] = (params) => {
1125
1113
  return only(params);
1126
1114
  };
1127
- getParameterizedAggregationDefinitions().forEach((definition) => {
1128
- aggregationFunctions[definition.agGridAggFuncName] = (params) => {
1129
- const columnId = params.column.getColId();
1130
- const parameterizedAggFunc = getParameterizedAggForColumn(columnId, this.api.layoutApi.getCurrentLayout());
1131
- if (!parameterizedAggFunc || parameterizedAggFunc.type !== definition.type) {
1132
- return undefined;
1133
- }
1134
- return computeParameterizedAggregation(params, params.colDef.colId, parameterizedAggFunc);
1135
- };
1136
- });
1115
+ aggregationFunctions[WEIGHTED_AVERAGE_AGG_FN_NAME] = (params) => {
1116
+ const columnId = params.column.getColId();
1117
+ const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(columnId);
1118
+ if (!adaptableAggFunc) {
1119
+ return undefined;
1120
+ }
1121
+ if (adaptableAggFunc.type === 'weightedAverage') {
1122
+ return weightedAverage(params, params.colDef.colId, adaptableAggFunc.weightedColumnId);
1123
+ }
1124
+ return undefined;
1125
+ };
1137
1126
  return aggregationFunctions;
1138
1127
  });
1139
1128
  /**
@@ -1699,12 +1688,6 @@ export class AdaptableAgGrid {
1699
1688
  }), true);
1700
1689
  gridContainerElement.addEventListener('mouseleave', (this.agGridListenerMouseLeave = (event) => this._emit('MouseLeave', event)));
1701
1690
  }
1702
- this.throttleFilterOnDataChange = throttle(
1703
- // the extra function is to make sure we have a reference to ag-grid-api
1704
- () => this.agGridAdapter.getAgGridApi()?.onFilterChanged(), this.adaptableOptions.filterOptions.filterActionOnDataChange.throttleDelay, {
1705
- trailing: true,
1706
- leading: false,
1707
- });
1708
1691
  /**
1709
1692
  * Use Case: User has started inline editing but its disabled in Row Form Options
1710
1693
  * Action: Stop editing
@@ -3813,7 +3796,6 @@ export class AdaptableAgGrid {
3813
3796
  this.listenerCellSelectionChanged = null;
3814
3797
  this.listenerGlobalSetRowSelection = null;
3815
3798
  this.listenerSortChanged = null;
3816
- this.throttleFilterOnDataChange = null;
3817
3799
  const liveGridOptions = this.agGridAdapter.DANGER_getLiveGridOptions();
3818
3800
  if (liveGridOptions) {
3819
3801
  this.agGridOptionsService.revertGridOptionsPropertiesToUserValue(liveGridOptions, [
@@ -4049,6 +4031,25 @@ export class AdaptableAgGrid {
4049
4031
  ],
4050
4032
  });
4051
4033
  }
4034
+ getActiveAdaptableAggFuncForCol(columnId) {
4035
+ if (!columnId) {
4036
+ return null;
4037
+ }
4038
+ const currentLayout = this.api.layoutApi.getCurrentLayout();
4039
+ const aggregationFunctionsColumnsMap = (isPivotLayout(currentLayout)
4040
+ ? currentLayout.PivotAggregationColumns
4041
+ : currentLayout.TableAggregationColumns).reduce((acc, col) => {
4042
+ acc[col.ColumnId] = col.AggFunc;
4043
+ return acc;
4044
+ }, {});
4045
+ const adaptableAggFunc = aggregationFunctionsColumnsMap[columnId];
4046
+ if (typeof adaptableAggFunc === 'object' &&
4047
+ 'type' in adaptableAggFunc &&
4048
+ adaptableAggFunc.type === 'weightedAverage') {
4049
+ return adaptableAggFunc;
4050
+ }
4051
+ return null;
4052
+ }
4052
4053
  onRowDataChanged({ rowNode, oldData, newData, }) {
4053
4054
  if (oldData == null || oldData == undefined) {
4054
4055
  return;
@@ -4133,6 +4134,7 @@ export class AdaptableAgGrid {
4133
4134
  * There are a few things we need to do AFTER we edit a cell and it makes sense to put them in one place
4134
4135
  */
4135
4136
  performPostEditChecks(rowNode, cellDataChangedInfos) {
4137
+ cellDataChangedInfos = expandCellDataChangedInfosWithCalculatedColumns(this.api, cellDataChangedInfos);
4136
4138
  cellDataChangedInfos.forEach((cellDataChangedInfo) => {
4137
4139
  // if a Cell Data Change is undone, log to the Console
4138
4140
  if (cellDataChangedInfo.trigger === 'undo') {
@@ -4290,14 +4292,7 @@ export class AdaptableAgGrid {
4290
4292
  }
4291
4293
  }
4292
4294
  filterOnDataChange() {
4293
- if (this.adaptableOptions.filterOptions.filterActionOnDataChange.applyFilter ==
4294
- FilterOnDataChangeOptions.Always) {
4295
- this.agGridAdapter.getAgGridApi()?.onFilterChanged();
4296
- }
4297
- else if (this.adaptableOptions.filterOptions.filterActionOnDataChange.applyFilter ==
4298
- FilterOnDataChangeOptions.Throttle) {
4299
- this.throttleFilterOnDataChange();
4300
- }
4295
+ this.agGridAdapter.getAgGridApi()?.onFilterChanged();
4301
4296
  }
4302
4297
  refreshLayout() {
4303
4298
  const columnDefs = this.agGridAdapter.getColumnDefinitionsInclSpecialColumns();
@@ -50,6 +50,7 @@ export declare class AgGridAdapter {
50
50
  deriveSelectedRowInfoFromAgGrid(): SelectedRowInfo;
51
51
  isPinnedRowNode(rowNode: IRowNode): boolean;
52
52
  createAdaptableColumnFromAgGridColumn(agGridColumn: Column, colsToGroups: Record<string, AdaptableColumnGroup>): AdaptableColumn;
53
+ private getUserAllowedAggFuncs;
53
54
  private deriveAdaptableColumnDataType;
54
55
  private isColumnReadonly;
55
56
  private isColumnFieldonly;
@@ -57,7 +58,6 @@ export declare class AgGridAdapter {
57
58
  private isColumnRowGroupable;
58
59
  private isColumnPivotable;
59
60
  private isColumnAggregetable;
60
- private getUserAllowedAggFuncs;
61
61
  private getColumnAggregationFunctions;
62
62
  private isTreeColumn;
63
63
  private isColumnMoveable;
@@ -8,8 +8,7 @@ import { agGridDataTypeDefinitions, ALL_ADAPTABLE_DATA_TYPES } from './agGridDat
8
8
  import { isPivotGrandTotal } from '../Api/Implementation/ColumnApiImpl';
9
9
  import { isPivotColumnTotal } from '../layout-manager/src/isPivotColumnTotal';
10
10
  import { isPivotAggTotalColumn } from '../layout-manager/src/isPivotAggTotalColumn';
11
- import { getParameterizedAggregationDefinitionByAgGridName } from '../Aggregation/ParameterizedAggregationRegistry';
12
- import { isParameterizedAggFuncName } from '../Aggregation/ParameterizedAggregationRegistry';
11
+ import { ONLY_AGG_FN_NAME, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../AdaptableState/Common/AggregationColumns';
13
12
  // AG GRID obfuscates its internals, this is (currently) the best way to get hold of its internal services
14
13
  const DANGER_AG_GRID_BEANS_MAP = {};
15
14
  const getColumnApiModule = () => ColumnApiModule;
@@ -226,9 +225,8 @@ export class AgGridAdapter {
226
225
  if (fctName === 'only') {
227
226
  return 'Only';
228
227
  }
229
- const parameterizedDefinition = getParameterizedAggregationDefinitionByAgGridName(fctName);
230
- if (parameterizedDefinition) {
231
- return parameterizedDefinition.agGridAggFuncName;
228
+ if (fctName === 'weightedAvg') {
229
+ return 'Weighted Average';
232
230
  }
233
231
  return original_getDefaultFuncLabel.call(this, fctName);
234
232
  };
@@ -542,16 +540,23 @@ export class AgGridAdapter {
542
540
  abColumn.exportable = this.isColumnExportable(abColumn);
543
541
  if (abColumn.aggregatable) {
544
542
  abColumn.availableAggregationFunctions = this.getColumnAggregationFunctions(colDef);
545
- const userAllowedAggFuncs = this.getUserAllowedAggFuncs(ColumnId);
546
- if (userAllowedAggFuncs) {
547
- abColumn.userAllowedAggFuncs = userAllowedAggFuncs;
548
- }
543
+ Object.defineProperty(abColumn, 'userAllowedAggFuncs', {
544
+ get: () => this.getUserAllowedAggFuncs(ColumnId),
545
+ enumerable: true,
546
+ configurable: true,
547
+ });
549
548
  if (typeof colDef.aggFunc === 'string') {
550
549
  abColumn.aggregationFunction = colDef.aggFunc;
551
550
  }
552
551
  }
553
552
  return abColumn;
554
553
  }
554
+ getUserAllowedAggFuncs(columnId) {
555
+ const userColumnAllowed = this._adaptableInstance?.agGridColumnAdapter?.getUserColDefProperty(columnId, 'allowedAggFuncs');
556
+ const userDefaultColDef = this.getUserGridOptionsProperty('defaultColDef');
557
+ const userAllowed = userColumnAllowed ?? userDefaultColDef?.allowedAggFuncs;
558
+ return Array.isArray(userAllowed) ? [...userAllowed] : undefined;
559
+ }
555
560
  deriveAdaptableColumnDataType(agColumn, logWarning = true) {
556
561
  // Some columns can have no ID or Title. we return string as a consequence but it needs testing
557
562
  if (!agColumn) {
@@ -684,12 +689,6 @@ export class AgGridAdapter {
684
689
  }
685
690
  return false;
686
691
  }
687
- getUserAllowedAggFuncs(columnId) {
688
- const userColumnAllowed = this._adaptableInstance?.agGridColumnAdapter?.getUserColDefProperty(columnId, 'allowedAggFuncs');
689
- const userDefaultColDef = this.getUserGridOptionsProperty('defaultColDef');
690
- const userAllowed = userColumnAllowed ?? userDefaultColDef?.allowedAggFuncs;
691
- return Array.isArray(userAllowed) ? [...userAllowed] : undefined;
692
- }
693
692
  getColumnAggregationFunctions(colDef) {
694
693
  const defaultAggFuncs = ['sum', 'min', 'max', 'count', 'avg', 'first', 'last'];
695
694
  const hasAllowedAggFuncs = Array.isArray(colDef.allowedAggFuncs);
@@ -697,9 +696,20 @@ export class AgGridAdapter {
697
696
  const gridOptionsAggFuncs = this.adaptableApi.agGridApi.getGridOption('aggFuncs') || {};
698
697
  const gridOptionsAggFuncNames = Object.keys(gridOptionsAggFuncs);
699
698
  if (!hasAllowedAggFuncs) {
700
- result.push(...gridOptionsAggFuncNames);
699
+ // we assume gridOptionsAggFuncNames includes 'weightedAvg' and 'only'
700
+ const customAggFuncNames = gridOptionsAggFuncNames.filter((name) => name !== WEIGHTED_AVERAGE_AGG_FN_NAME && name !== ONLY_AGG_FN_NAME);
701
+ // 'weightedAvg' is displayed right after 'avg'
702
+ const avgIndex = result.indexOf('avg');
703
+ if (avgIndex >= 0) {
704
+ result.splice(avgIndex + 1, 0, WEIGHTED_AVERAGE_AGG_FN_NAME);
705
+ }
706
+ else {
707
+ result.push(WEIGHTED_AVERAGE_AGG_FN_NAME);
708
+ }
709
+ result.push(...customAggFuncNames);
710
+ // 'only' is always the last element
711
+ result.push(ONLY_AGG_FN_NAME);
701
712
  }
702
- result = result.filter((func) => !isParameterizedAggFuncName(func));
703
713
  return [...new Set(result)];
704
714
  }
705
715
  isTreeColumn(isGeneratedRowGroupColumn) {
@@ -1,6 +1,7 @@
1
1
  import kebabCase from '../Utilities/utils/kebabCase';
2
2
  import { resolveDisplayFormat } from '../AdaptableState/Common/AdaptableFormatPresets';
3
3
  import merge from '../Utilities/utils/merge';
4
+ import { resolveSparklineOptionsForRender } from '../Utilities/Helpers/SparklineOptionsHelper';
4
5
  import { convertAdaptableStyleToCSS, getVariableColor, hasCellBoxStyle, hasCellFontStyle, normalizeStyleForAgGrid, } from '../Utilities/Helpers/StyleHelper';
5
6
  import StringExtensions from '../Utilities/Extensions/StringExtensions';
6
7
  import { ACTION_COLUMN_TYPE, CALCULATED_COLUMN_TYPE, FDC3_COLUMN_TYPE, FREE_TEXT_COLUMN_TYPE, } from '../AdaptableState/Common/AdaptableColumn';
@@ -26,7 +27,7 @@ import { AgGridFilterAdapterFactory } from './AgGridFilterAdapter';
26
27
  import { AgGridFloatingFilterAdapterFactory } from './AgGridFloatingFilterAdapter';
27
28
  import { errorOnce } from './AdaptableLogger';
28
29
  import { isUnsupportedColumnDataTypeForIconStyle } from '../Utilities/Helpers/iconStyledColumnColumnSupport';
29
- import { isParameterizedAggFuncName } from '../Aggregation/ParameterizedAggregationRegistry';
30
+ import { isWeightedAverageAggFuncName, } from '../AdaptableState/Common/AggregationColumns';
30
31
  /**
31
32
  * CSS property keys produced by `convertAdaptableStyleToCSS` from a
32
33
  * `CellFontStyle` slice. Used to strip Format-Column-derived font CSS
@@ -552,7 +553,7 @@ export class AgGridColumnAdapter {
552
553
  if (styledColumn && !styledColumn.IsSuspended) {
553
554
  if (styledColumn.SparklineStyle) {
554
555
  const sanitizedSparklineOptions = AdaptableHelper.removeAdaptableObjectPrimitives(styledColumn.SparklineStyle.options);
555
- const sparklineOptions = merge({}, userDefined?.sparklineOptions, sanitizedSparklineOptions);
556
+ const sparklineOptions = resolveSparklineOptionsForRender(merge({}, userDefined?.sparklineOptions, sanitizedSparklineOptions));
556
557
  return {
557
558
  ...userDefined,
558
559
  sparklineOptions,
@@ -571,8 +572,7 @@ export class AgGridColumnAdapter {
571
572
  // Icon Style has its own tooltip vocabulary (`'CellValue'` /
572
573
  // `'IconDescription'`) so we handle it before falling through to the
573
574
  // numeric tooltip branch.
574
- if (styledColumn.IconStyle &&
575
- !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType)) {
575
+ if (styledColumn.IconStyle && !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType)) {
576
576
  const iconTokens = styledColumn.IconStyle.ToolTipText ?? [];
577
577
  if (iconTokens.length === 0) {
578
578
  return undefined;
@@ -650,9 +650,7 @@ export class AgGridColumnAdapter {
650
650
  if (textOptions.includes('CellValue')) {
651
651
  returnValue = String(params.value ?? '');
652
652
  }
653
- if (textOptions.includes('PercentageValue') &&
654
- min != undefined &&
655
- max != undefined) {
653
+ if (textOptions.includes('PercentageValue') && min != undefined && max != undefined) {
656
654
  let percentageValue;
657
655
  if (styledColumn.PercentBarStyle?.ColumnComparison) {
658
656
  const absMax = Math.abs(max);
@@ -661,8 +659,7 @@ export class AgGridColumnAdapter {
661
659
  else {
662
660
  const scaleSpan = max - min;
663
661
  const clamped = Helper.clamp(Number(params.value), min, max);
664
- percentageValue =
665
- scaleSpan === 0 ? 0 : ((clamped - min) / scaleSpan) * 100;
662
+ percentageValue = scaleSpan === 0 ? 0 : ((clamped - min) / scaleSpan) * 100;
666
663
  }
667
664
  returnValue += ` (${percentageValue.toFixed(0)}%)`;
668
665
  }
@@ -728,8 +725,7 @@ export class AgGridColumnAdapter {
728
725
  if (!abColumn.availableAggregationFunctions) {
729
726
  return undefined;
730
727
  }
731
- return abColumn.availableAggregationFunctions.filter((func) => !isParameterizedAggFuncName(func));
732
- // .filter((func) => func !== ONLY_AGG_FN_NAME);
728
+ return abColumn.availableAggregationFunctions.filter((func) => !isWeightedAverageAggFuncName(func));
733
729
  });
734
730
  }
735
731
  setupColumnType(columnSetupInfo) {
@@ -951,10 +947,7 @@ export class AgGridColumnAdapter {
951
947
  // 1. evaluate EditOptions.isCellEditable if provided
952
948
  if (this.adaptableApi.gridApi.internalApi.hasCellEditableAccordingToEditOptions()) {
953
949
  const gridCell = this.adaptableApi.gridApi.getGridCellFromRowNode(params.node, params.column.getColId());
954
- const editOptionsEditability = this.adaptableApi.gridApi.internalApi.isCellEditableAccordingToEditOptions(gridCell, getOriginalColDefEditable());
955
- if (editOptionsEditability) {
956
- return editOptionsEditability;
957
- }
950
+ return this.adaptableApi.gridApi.internalApi.isCellEditableAccordingToEditOptions(gridCell, getOriginalColDefEditable());
958
951
  }
959
952
  // 2. otherwise, fallback to colDef.editable
960
953
  return getOriginalColDefEditable();
@@ -1466,8 +1459,7 @@ export class AgGridColumnAdapter {
1466
1459
  // basis when a Gradient cell has a tinted background, even if the user
1467
1460
  // also set `Font.ForeColor` as a baseline.
1468
1461
  const autoContrastColor = gradientStyle?.AutoContrastText && style.color ? style.color : undefined;
1469
- const iconStyleFontApplies = styledColumn.IconStyle &&
1470
- !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
1462
+ const iconStyleFontApplies = styledColumn.IconStyle && !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
1471
1463
  const fontSlot = styledColumn.GradientStyle?.Font ??
1472
1464
  styledColumn.PercentBarStyle?.Font ??
1473
1465
  styledColumn.BulletChartStyle?.Font ??
@@ -1479,8 +1471,7 @@ export class AgGridColumnAdapter {
1479
1471
  if (fontSlot) {
1480
1472
  style = { ...style, ...convertAdaptableStyleToCSS(fontSlot) };
1481
1473
  }
1482
- const iconStyleCellApplies = styledColumn.IconStyle &&
1483
- !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
1474
+ const iconStyleCellApplies = styledColumn.IconStyle && !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
1484
1475
  const cellSlot = styledColumn.RatingStyle?.Cell ??
1485
1476
  styledColumn.SparklineStyle?.Cell ??
1486
1477
  styledColumn.BadgeStyle?.Cell ??
@@ -9,7 +9,6 @@ export declare class AgGridMenuAdapter {
9
9
  private get adaptableApi();
10
10
  destroy(): void;
11
11
  buildColumnMenu(params: GetMainMenuItemsParams, originalGetMainMenuItems: GetMainMenuItems): (DefaultMenuItem | MenuItemDef)[];
12
- private injectParameterizedAggregationColumnMenuItems;
13
12
  buildContextMenu(params: GetContextMenuItemsParams, originalGetContextMenuItems: GetContextMenuItems): (DefaultMenuItem | MenuItemDef)[];
14
13
  private mapAgGridItemTypeToAgGridMenuItem;
15
14
  private removeConsecutiveSeparators;
@@ -2,8 +2,8 @@ import { isAdaptableElementIcon } from '../components/Icon';
2
2
  import { iconToString } from '../components/icons';
3
3
  import ArrayExtensions from '../Utilities/Extensions/ArrayExtensions';
4
4
  import { MENU_SEPARATOR } from '../Utilities/Constants/GeneralConstants';
5
- import { buildConsolidatedAggregationColumnMenuItem, findParameterizedAggMenuInsertIndex, isValueAggregationMenuItem, } from '../Aggregation/parameterizedAggregationColumnMenu';
6
- import { removeColumnAggregationFromLayout, upsertColumnAggregationInLayout, } from '../Aggregation/parameterizedAggregationHelpers';
5
+ import { buildValueAggregationMenuItem } from './buildValueAggregationMenuItem';
6
+ import { createAgGridIcon } from './createAgGridIcon';
7
7
  export class AgGridMenuAdapter {
8
8
  _adaptableInstance;
9
9
  constructor(_adaptableInstance) {
@@ -55,42 +55,25 @@ export class AgGridMenuAdapter {
55
55
  .filter(Boolean);
56
56
  }
57
57
  // 2. if not, return the default context menu
58
- let defaultContextMenu = [
59
- ...agGridMenuItems,
58
+ // AG Grid does not allow customizing the built-in `valueAggSubMenu`, so we
59
+ // replace it with an Adaptable-built equivalent that also offers a Weighted
60
+ // Average aggregation (with a submenu to pick the weight column).
61
+ // Weighted Average is never used in Pivot Layouts, so we leave the AG Grid
62
+ // default item untouched there.
63
+ const isPivotLayout = this.adaptableApi.layoutApi.isCurrentLayoutPivot();
64
+ const mappedAgGridMenuItems = agGridMenuItems.map((itemName) => itemName === 'valueAggSubMenu' && !isPivotLayout
65
+ ? {
66
+ ...buildValueAggregationMenuItem(this.adaptableApi, menuContext),
67
+ icon: createAgGridIcon('aggregation'),
68
+ }
69
+ : itemName);
70
+ const defaultContextMenu = [
71
+ ...mappedAgGridMenuItems,
60
72
  'separator',
61
73
  ...defaultColumnMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
62
74
  ];
63
- defaultContextMenu = this.injectParameterizedAggregationColumnMenuItems(defaultContextMenu, adaptableColumn);
64
75
  return this.removeConsecutiveSeparators(defaultContextMenu);
65
76
  }
66
- injectParameterizedAggregationColumnMenuItems(menuItems, column) {
67
- const consolidatedAggregationMenuItem = buildConsolidatedAggregationColumnMenuItem(this.adaptableApi, column, (columnId, parameterizedAgg) => {
68
- this.adaptableApi.layoutApi.setColumnParameterizedAggregation(columnId, parameterizedAgg);
69
- }, (columnId, aggFunc) => {
70
- this.adaptableApi.layoutApi.updateCurrentLayout((layout) => {
71
- if (aggFunc == null) {
72
- removeColumnAggregationFromLayout(layout, columnId);
73
- }
74
- else {
75
- upsertColumnAggregationInLayout(layout, columnId, aggFunc);
76
- }
77
- return layout;
78
- });
79
- this.adaptableApi.agGridApi.setColumnAggFunc(columnId, aggFunc);
80
- });
81
- if (!consolidatedAggregationMenuItem) {
82
- return menuItems;
83
- }
84
- consolidatedAggregationMenuItem.icon = this.mapAdaptableIconToAgGridIcon({ name: 'equation' });
85
- const originalValueAggMenuIndex = menuItems.findIndex((item) => isValueAggregationMenuItem(item));
86
- const menuItemsWithoutValueAgg = menuItems.filter((item) => !isValueAggregationMenuItem(item));
87
- const result = [...menuItemsWithoutValueAgg];
88
- const insertIndex = originalValueAggMenuIndex !== -1
89
- ? Math.min(originalValueAggMenuIndex, result.length)
90
- : findParameterizedAggMenuInsertIndex(menuItemsWithoutValueAgg);
91
- result.splice(insertIndex, 0, consolidatedAggregationMenuItem);
92
- return result;
93
- }
94
77
  buildContextMenu(params, originalGetContextMenuItems) {
95
78
  if (!params.column) {
96
79
  return [];
@@ -269,7 +252,7 @@ export class AgGridMenuAdapter {
269
252
  ? () => this.adaptableApi.internalApi.dispatchReduxAction(fullMenuItem.reduxAction)
270
253
  : undefined,
271
254
  icon: this.mapAdaptableIconToAgGridIcon(fullMenuItem.icon, {
272
- fill: 'var(--ab-color-text-on-primary)',
255
+ fill: 'var(--ab-color-primary-foreground)',
273
256
  }),
274
257
  subMenu: fullMenuItem.subItems?.map((subMenuItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(subMenuItem)),
275
258
  };
@@ -282,7 +265,7 @@ export class AgGridMenuAdapter {
282
265
  return {
283
266
  name: customMenuItem.label,
284
267
  icon: this.mapAdaptableIconToAgGridIcon(customMenuItem.icon, {
285
- fill: 'var(--ab-color-text-on-primary)',
268
+ fill: 'var(--ab-color-primary-foreground)',
286
269
  }),
287
270
  disabled: customMenuItem.disabled,
288
271
  subMenu: !customMenuItem.disabled
@@ -310,7 +293,7 @@ export class AgGridMenuAdapter {
310
293
  name: userMenuItem.label,
311
294
  action: () => (userMenuItem.onClick ? userMenuItem.onClick(menuContext) : null),
312
295
  icon: this.mapAdaptableIconToAgGridIcon(userMenuItem.icon, {
313
- fill: 'var(--ab-color-text-on-primary)',
296
+ fill: 'var(--ab-color-primary-foreground)',
314
297
  }),
315
298
  disabled: userMenuItem.disabled,
316
299
  subMenu: userMenuItem.subMenuItems
@@ -735,7 +718,7 @@ export class AgGridMenuAdapter {
735
718
  }
736
719
  else {
737
720
  return iconToString(icon, {
738
- fill: 'var(--ab-color-text-on-primary)',
721
+ fill: 'var(--ab-color-primary-foreground)',
739
722
  });
740
723
  }
741
724
  }
@@ -0,0 +1,19 @@
1
+ import { MenuItemDef } from 'ag-grid-enterprise';
2
+ import { AdaptableApi } from '../types';
3
+ import { ColumnMenuContext } from '../AdaptableState/Common/Menu';
4
+ /**
5
+ * Builds the replacement for AG Grid's built-in `valueAggSubMenu` column menu item.
6
+ *
7
+ * AG Grid does not allow customizing the built-in submenu, so we rebuild an
8
+ * equivalent one: the column's existing aggregation functions plus a
9
+ * `Weighted Average` item whose submenu lists the numeric columns that can be
10
+ * used as the weight parameter.
11
+ *
12
+ * Both standard and weighted selections persist through the current Layout
13
+ * (`updateCurrentLayout`), so the existing `weightedAvg` aggFunc can read the
14
+ * chosen `weightedColumnId` back from the Layout.
15
+ *
16
+ * Weighted Average is never used in Pivot Layouts, so this only deals with the
17
+ * Table Layout aggregations and the caller skips it entirely in Pivot mode.
18
+ */
19
+ export declare function buildValueAggregationMenuItem(adaptableApi: AdaptableApi, menuContext: ColumnMenuContext): MenuItemDef;
@@ -0,0 +1,111 @@
1
+ import { getAggFuncName, getDisplayAggFuncNames, isWeightedAverageAggregation, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../AdaptableState/Common/AggregationColumns';
2
+ const toFuncLabel = (funcName) => {
3
+ if (funcName === 'avg') {
4
+ return 'Average';
5
+ }
6
+ if (funcName === 'weightedAvg') {
7
+ return 'Weighted Average';
8
+ }
9
+ return funcName ? funcName.charAt(0).toUpperCase() + funcName.slice(1) : funcName;
10
+ };
11
+ /**
12
+ * Builds the replacement for AG Grid's built-in `valueAggSubMenu` column menu item.
13
+ *
14
+ * AG Grid does not allow customizing the built-in submenu, so we rebuild an
15
+ * equivalent one: the column's existing aggregation functions plus a
16
+ * `Weighted Average` item whose submenu lists the numeric columns that can be
17
+ * used as the weight parameter.
18
+ *
19
+ * Both standard and weighted selections persist through the current Layout
20
+ * (`updateCurrentLayout`), so the existing `weightedAvg` aggFunc can read the
21
+ * chosen `weightedColumnId` back from the Layout.
22
+ *
23
+ * Weighted Average is never used in Pivot Layouts, so this only deals with the
24
+ * Table Layout aggregations and the caller skips it entirely in Pivot mode.
25
+ */
26
+ export function buildValueAggregationMenuItem(adaptableApi, menuContext) {
27
+ const column = menuContext.adaptableColumn;
28
+ const columnId = column.columnId;
29
+ const currentLayout = adaptableApi.layoutApi.getCurrentLayout();
30
+ const aggregationColumns = currentLayout.TableAggregationColumns || [];
31
+ const currentAggFunc = aggregationColumns.find((agg) => agg.ColumnId === columnId)?.AggFunc;
32
+ let activeAggFuncName;
33
+ if (currentAggFunc != null) {
34
+ const aggFuncName = getAggFuncName(currentAggFunc);
35
+ activeAggFuncName = aggFuncName === true ? column.aggregationFunction : aggFuncName;
36
+ }
37
+ const activeWeightColumnId = isWeightedAverageAggregation(currentAggFunc)
38
+ ? currentAggFunc.weightedColumnId
39
+ : undefined;
40
+ const applyAggregation = (aggFuncValue) => {
41
+ const upsert = (cols) => {
42
+ const list = cols ? [...cols] : [];
43
+ const index = list.findIndex((col) => col.ColumnId === columnId);
44
+ if (index >= 0) {
45
+ list[index] = { ...list[index], AggFunc: aggFuncValue };
46
+ }
47
+ else {
48
+ list.push({ ColumnId: columnId, AggFunc: aggFuncValue });
49
+ }
50
+ return list;
51
+ };
52
+ adaptableApi.layoutApi.updateCurrentLayout((layout) => {
53
+ const tableLayout = layout;
54
+ return {
55
+ ...tableLayout,
56
+ TableAggregationColumns: upsert(tableLayout.TableAggregationColumns),
57
+ };
58
+ });
59
+ };
60
+ const removeAggregation = () => {
61
+ adaptableApi.layoutApi.updateCurrentLayout((layout) => {
62
+ const tableLayout = layout;
63
+ return {
64
+ ...tableLayout,
65
+ TableAggregationColumns: (tableLayout.TableAggregationColumns || []).filter((col) => col.ColumnId !== columnId),
66
+ };
67
+ });
68
+ };
69
+ // 'None' clears any aggregation for the column and is checked when none is set
70
+ const subMenu = [
71
+ {
72
+ name: 'None',
73
+ checked: activeAggFuncName == null,
74
+ action: () => removeAggregation(),
75
+ },
76
+ ];
77
+ // getDisplayAggFuncNames already positions weightedAvg right after 'avg'
78
+ // (and only includes it when the column is eligible)
79
+ const aggFuncItems = getDisplayAggFuncNames(column).map((funcName) => {
80
+ // Weighted Average needs a weight column parameter, so instead of a plain
81
+ // action it gets a submenu listing the numeric columns usable as the weight.
82
+ if (funcName === WEIGHTED_AVERAGE_AGG_FN_NAME) {
83
+ const weightColumnItems = adaptableApi.columnApi
84
+ .getNumericColumns()
85
+ .filter((numericColumn) => numericColumn.columnId !== columnId)
86
+ .map((numericColumn) => ({
87
+ name: numericColumn.friendlyName ?? numericColumn.columnId,
88
+ checked: activeWeightColumnId === numericColumn.columnId,
89
+ action: () => applyAggregation({
90
+ type: 'weightedAverage',
91
+ weightedColumnId: numericColumn.columnId,
92
+ }),
93
+ }));
94
+ return {
95
+ name: 'Weighted Average',
96
+ checked: activeAggFuncName === WEIGHTED_AVERAGE_AGG_FN_NAME,
97
+ subMenu: weightColumnItems,
98
+ };
99
+ }
100
+ return {
101
+ name: toFuncLabel(funcName),
102
+ checked: activeAggFuncName === funcName,
103
+ action: () => applyAggregation(funcName),
104
+ };
105
+ });
106
+ subMenu.push(...aggFuncItems);
107
+ return {
108
+ name: 'Value Aggregation',
109
+ subMenu,
110
+ };
111
+ }
@@ -18,6 +18,12 @@ import { AdaptableColumn } from '../../AdaptableState/Common/AdaptableColumn';
18
18
  * is configured for case-insensitive matching.
19
19
  */
20
20
  export declare const resolveEffectiveIconStyleMappings: (iconStyle: IconStyle | undefined) => IconStyleMapping[];
21
+ /**
22
+ * Mapping list for wizard / settings summaries: custom mappings first so
23
+ * user-authored entries are always visible, then any remaining preset
24
+ * entries (after override filtering).
25
+ */
26
+ export declare const resolveIconStyleMappingsForSummaryPreview: (iconStyle: IconStyle | undefined) => IconStyleMapping[];
21
27
  export declare const getIconRendererForColumn: (styledColumn: StyledColumn, abColumn: AdaptableColumn, api: AdaptableApi) => any;
22
28
  /** Helper exposed for the tooltip getter in `AgGridColumnAdapter`. */
23
29
  export declare const findIconStyleMappingForValue: (iconStyle: IconStyle | undefined, cellValue: any) => IconStyleMapping | undefined;