@adaptabletools/adaptable-cjs 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 +34 -0
  8. package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
  9. package/src/AdaptableState/Common/AggregationColumns.js +30 -3
  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 +5 -11
  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 +2 -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 +31 -8
  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 +12 -5
  40. package/src/Strategy/LayoutModule.js +13 -8
  41. package/src/Strategy/StyledColumnModule.js +58 -30
  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 +68 -0
  47. package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
  48. package/src/Utilities/Helpers/StyledColumnGradientHelper.js +212 -1
  49. package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
  50. package/src/Utilities/Helpers/ThemeHelpers.js +43 -0
  51. package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
  52. package/src/Utilities/Helpers/percentBarPreviewHelper.js +155 -0
  53. package/src/Utilities/ObjectFactory.d.ts +1 -3
  54. package/src/Utilities/ObjectFactory.js +0 -9
  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 +120 -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 +113 -102
  63. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +12 -13
  64. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +54 -54
  65. package/src/View/Alert/Wizard/AlertRulesWizardSection.js +4 -3
  66. package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -1
  67. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +29 -37
  68. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +2 -3
  69. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
  70. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +28 -15
  71. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
  72. package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +2 -2
  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 +26 -0
  80. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
  81. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +9 -6
  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 +1 -2
  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 +5 -4
  98. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +2 -1
  99. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +4 -15
  100. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -27
  101. package/src/View/Export/Wizard/ReportNameWizardSection.js +8 -11
  102. package/src/View/Export/Wizard/ReportRowsWizardSection.js +19 -22
  103. package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
  104. package/src/View/Export/Wizard/ScheduledReportSettings.js +12 -12
  105. package/src/View/Export/Wizard/ScheduledReportWizard.js +2 -3
  106. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
  107. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +22 -21
  108. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
  109. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +19 -3
  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 +120 -13
  113. package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
  114. package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +78 -0
  115. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
  116. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +34 -0
  117. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +11 -6
  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 +64 -13
  121. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -1
  122. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
  123. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +19 -0
  124. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
  125. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +60 -0
  126. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
  127. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +35 -70
  128. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +14 -10
  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 +116 -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 +10 -10
  137. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
  138. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -51
  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 +3 -4
  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 +7 -12
  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 +45 -12
  151. package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +10 -17
  152. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
  153. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +5 -21
  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 +10 -17
  157. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +16 -5
  158. package/src/View/Shortcut/Wizard/ShortcutWizard.js +2 -2
  159. package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
  160. package/src/View/Shortcut/shortcutOperations.js +32 -1
  161. package/src/View/SpecialColumnSettingsWizardStep.js +7 -6
  162. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
  163. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +26 -16
  164. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
  165. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +100 -15
  166. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
  167. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +48 -25
  168. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
  169. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +109 -33
  170. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +20 -12
  171. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
  172. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +124 -23
  173. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
  174. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +35 -11
  175. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
  176. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +88 -11
  177. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
  178. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +125 -35
  179. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
  180. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -74
  181. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
  182. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +20 -0
  183. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +6 -12
  184. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
  185. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +2 -1
  186. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
  187. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +11 -13
  188. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
  189. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +20 -0
  190. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
  191. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +32 -3
  192. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
  193. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +64 -0
  194. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
  195. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +35 -0
  196. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
  197. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +96 -0
  198. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
  199. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +57 -0
  200. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
  201. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +58 -0
  202. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
  203. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +66 -0
  204. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
  205. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +133 -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 +53 -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 +6 -20
  214. package/src/View/renderWithAdaptableContext.js +1 -2
  215. package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
  216. package/src/agGrid/AdaptableAgGrid.js +36 -41
  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 +114 -0
  224. package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
  225. package/src/agGrid/cellRenderers/IconRenderer.js +46 -17
  226. package/src/agGrid/createAgGridIcon.d.ts +10 -0
  227. package/src/agGrid/createAgGridIcon.js +19 -0
  228. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +10 -5
  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 +36 -16
  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 +1 -5
  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.cjs.tsbuildinfo +1 -1
  252. package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
  253. package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -5
  254. package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
  255. package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -74
  256. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
  257. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -58
  258. package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
  259. package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -143
  260. package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
  261. package/src/Aggregation/parameterizedAggregationHeader.js +0 -65
  262. package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
  263. package/src/Aggregation/parameterizedAggregationHelpers.js +0 -121
  264. package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
  265. package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -74
  266. package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
  267. package/src/Aggregation/validateParameterizedAggregations.js +0 -25
  268. package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
  269. package/src/View/AdaptableComputedCSSVarsContext.js +0 -36
  270. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
  271. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -48
  272. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
  273. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -32
  274. package/src/View/Theme/VariantSelector.d.ts +0 -8
  275. package/src/View/Theme/VariantSelector.js +0 -25
  276. package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
  277. package/src/components/Select/CSSNumericVariableWatch.js +0 -51
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdaptableAgGrid = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const throttle_1 = tslib_1.__importDefault(require("../Utilities/utils/throttle"));
6
5
  const debounce_1 = tslib_1.__importDefault(require("../Utilities/utils/debounce"));
7
6
  const ag_grid_enterprise_1 = require("ag-grid-enterprise");
8
7
  const AdaptableLogger_1 = require("./AdaptableLogger");
@@ -25,6 +24,7 @@ const ThemeService_1 = require("../Utilities/Services/ThemeService");
25
24
  const ValidationService_1 = require("../Utilities/Services/ValidationService");
26
25
  const ModuleService_1 = require("../Utilities/Services/ModuleService");
27
26
  const CalculatedColumnExpressionService_1 = require("../Utilities/Services/CalculatedColumnExpressionService");
27
+ const CalculatedColumnSyntheticChange_1 = require("../Utilities/Services/CalculatedColumnSyntheticChange");
28
28
  const QueryLanguageService_1 = require("../Utilities/Services/QueryLanguageService");
29
29
  const AlertService_1 = require("../Utilities/Services/AlertService");
30
30
  const TeamSharingService_1 = require("../Utilities/Services/TeamSharingService");
@@ -83,11 +83,7 @@ const DateHelper_1 = require("../Utilities/Helpers/DateHelper");
83
83
  const AgGridColumnAdapter_1 = require("./AgGridColumnAdapter");
84
84
  const getScrollbarSize_1 = tslib_1.__importDefault(require("../Utilities/getScrollbarSize"));
85
85
  const AggregationColumns_1 = require("../AdaptableState/Common/AggregationColumns");
86
- const ParameterizedAggregationRegistry_1 = require("../Aggregation/ParameterizedAggregationRegistry");
87
- const parameterizedAggregationHelpers_1 = require("../Aggregation/parameterizedAggregationHelpers");
88
- const parameterizedAggregationHeader_1 = require("../Aggregation/parameterizedAggregationHeader");
89
86
  const RowFormService_1 = require("../Utilities/Services/RowFormService");
90
- const Enums_1 = require("../AdaptableState/Common/Enums");
91
87
  const EnvVars_1 = require("../EnvVars");
92
88
  const AdaptableUpgradeHelper_1 = require("../migration/AdaptableUpgradeHelper");
93
89
  const Modal_1 = require("../components/Modal");
@@ -95,6 +91,7 @@ const AdaptableLoadingScreen_1 = require("../View/Components/Popups/AdaptableLoa
95
91
  const react_1 = require("react");
96
92
  const createAgStatusPanelComponent_1 = require("../Utilities/createAgStatusPanelComponent");
97
93
  const only_1 = require("../Utilities/only");
94
+ const weightedAverage_1 = require("../Utilities/weightedAverage");
98
95
  const RowSummary_1 = require("../AdaptableState/Common/RowSummary");
99
96
  const FlashingCellService_1 = require("../Utilities/Services/FlashingCellService");
100
97
  const AgGridExportAdapter_1 = require("./AgGridExportAdapter");
@@ -208,7 +205,6 @@ class AdaptableAgGrid {
208
205
  LicenseService;
209
206
  ChartingService;
210
207
  rowListeners;
211
- throttleFilterOnDataChange;
212
208
  debouncedSetSelectedRows;
213
209
  debouncedSetSelectedCells;
214
210
  agGridListenerKeydown;
@@ -360,6 +356,7 @@ class AdaptableAgGrid {
360
356
  this._rawAdaptableOptions.adaptableId = `adaptable_id_${Date.now()}`;
361
357
  }
362
358
  this.logger = this.logger ?? new AdaptableLogger_1.AdaptableLogger(this._rawAdaptableOptions.adaptableId);
359
+ (0, LayoutHelpers_1.resetLayoutHelperErrorOnceMessages)();
363
360
  const adaptableId = this._rawAdaptableOptions.adaptableId;
364
361
  const initMarker = (0, devTools_1.getMarker)(adaptableId).track.Init.label.Init.start();
365
362
  const perfInitAdaptableAgGrid = this.logger.beginPerf(`Adaptable._initAdaptableAgGrid()`);
@@ -905,16 +902,7 @@ class AdaptableAgGrid {
905
902
  // #customize_header
906
903
  const defaultColDef = { ...original_defaultColDef };
907
904
  defaultColDef.headerValueGetter = (0, adaptableOverrideCheck_1.tagProvidedByAdaptable)((params) => {
908
- let columnHeaderName = this.api.columnApi.internalApi.getColumnHeaderName(params);
909
- const currentLayout = this.api.layoutApi.getCurrentLayout();
910
- if (params.column &&
911
- !currentLayout.SuppressAggFuncInHeader &&
912
- params.location === 'header') {
913
- const parameterizedParenthesisValue = (0, parameterizedAggregationHeader_1.getParameterizedAggregationHeaderParenthesisValue)(this.api, params.column.getColId(), currentLayout);
914
- if (parameterizedParenthesisValue) {
915
- columnHeaderName = parameterizedParenthesisValue;
916
- }
917
- }
905
+ const columnHeaderName = this.api.columnApi.internalApi.getColumnHeaderName(params);
918
906
  const formattedHeaderName = this.api.formatColumnApi.internalApi.formatColumnHeaderName(columnHeaderName, params);
919
907
  return formattedHeaderName;
920
908
  });
@@ -1128,16 +1116,17 @@ class AdaptableAgGrid {
1128
1116
  aggregationFunctions[AggregationColumns_1.ONLY_AGG_FN_NAME] = (params) => {
1129
1117
  return (0, only_1.only)(params);
1130
1118
  };
1131
- (0, ParameterizedAggregationRegistry_1.getParameterizedAggregationDefinitions)().forEach((definition) => {
1132
- aggregationFunctions[definition.agGridAggFuncName] = (params) => {
1133
- const columnId = params.column.getColId();
1134
- const parameterizedAggFunc = (0, parameterizedAggregationHelpers_1.getParameterizedAggForColumn)(columnId, this.api.layoutApi.getCurrentLayout());
1135
- if (!parameterizedAggFunc || parameterizedAggFunc.type !== definition.type) {
1136
- return undefined;
1137
- }
1138
- return (0, ParameterizedAggregationRegistry_1.computeParameterizedAggregation)(params, params.colDef.colId, parameterizedAggFunc);
1139
- };
1140
- });
1119
+ aggregationFunctions[AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME] = (params) => {
1120
+ const columnId = params.column.getColId();
1121
+ const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(columnId);
1122
+ if (!adaptableAggFunc) {
1123
+ return undefined;
1124
+ }
1125
+ if (adaptableAggFunc.type === 'weightedAverage') {
1126
+ return (0, weightedAverage_1.weightedAverage)(params, params.colDef.colId, adaptableAggFunc.weightedColumnId);
1127
+ }
1128
+ return undefined;
1129
+ };
1141
1130
  return aggregationFunctions;
1142
1131
  });
1143
1132
  /**
@@ -1703,12 +1692,6 @@ class AdaptableAgGrid {
1703
1692
  }), true);
1704
1693
  gridContainerElement.addEventListener('mouseleave', (this.agGridListenerMouseLeave = (event) => this._emit('MouseLeave', event)));
1705
1694
  }
1706
- this.throttleFilterOnDataChange = (0, throttle_1.default)(
1707
- // the extra function is to make sure we have a reference to ag-grid-api
1708
- () => this.agGridAdapter.getAgGridApi()?.onFilterChanged(), this.adaptableOptions.filterOptions.filterActionOnDataChange.throttleDelay, {
1709
- trailing: true,
1710
- leading: false,
1711
- });
1712
1695
  /**
1713
1696
  * Use Case: User has started inline editing but its disabled in Row Form Options
1714
1697
  * Action: Stop editing
@@ -3817,7 +3800,6 @@ class AdaptableAgGrid {
3817
3800
  this.listenerCellSelectionChanged = null;
3818
3801
  this.listenerGlobalSetRowSelection = null;
3819
3802
  this.listenerSortChanged = null;
3820
- this.throttleFilterOnDataChange = null;
3821
3803
  const liveGridOptions = this.agGridAdapter.DANGER_getLiveGridOptions();
3822
3804
  if (liveGridOptions) {
3823
3805
  this.agGridOptionsService.revertGridOptionsPropertiesToUserValue(liveGridOptions, [
@@ -4053,6 +4035,25 @@ class AdaptableAgGrid {
4053
4035
  ],
4054
4036
  });
4055
4037
  }
4038
+ getActiveAdaptableAggFuncForCol(columnId) {
4039
+ if (!columnId) {
4040
+ return null;
4041
+ }
4042
+ const currentLayout = this.api.layoutApi.getCurrentLayout();
4043
+ const aggregationFunctionsColumnsMap = ((0, LayoutHelpers_1.isPivotLayout)(currentLayout)
4044
+ ? currentLayout.PivotAggregationColumns
4045
+ : currentLayout.TableAggregationColumns).reduce((acc, col) => {
4046
+ acc[col.ColumnId] = col.AggFunc;
4047
+ return acc;
4048
+ }, {});
4049
+ const adaptableAggFunc = aggregationFunctionsColumnsMap[columnId];
4050
+ if (typeof adaptableAggFunc === 'object' &&
4051
+ 'type' in adaptableAggFunc &&
4052
+ adaptableAggFunc.type === 'weightedAverage') {
4053
+ return adaptableAggFunc;
4054
+ }
4055
+ return null;
4056
+ }
4056
4057
  onRowDataChanged({ rowNode, oldData, newData, }) {
4057
4058
  if (oldData == null || oldData == undefined) {
4058
4059
  return;
@@ -4137,6 +4138,7 @@ class AdaptableAgGrid {
4137
4138
  * There are a few things we need to do AFTER we edit a cell and it makes sense to put them in one place
4138
4139
  */
4139
4140
  performPostEditChecks(rowNode, cellDataChangedInfos) {
4141
+ cellDataChangedInfos = (0, CalculatedColumnSyntheticChange_1.expandCellDataChangedInfosWithCalculatedColumns)(this.api, cellDataChangedInfos);
4140
4142
  cellDataChangedInfos.forEach((cellDataChangedInfo) => {
4141
4143
  // if a Cell Data Change is undone, log to the Console
4142
4144
  if (cellDataChangedInfo.trigger === 'undo') {
@@ -4294,14 +4296,7 @@ class AdaptableAgGrid {
4294
4296
  }
4295
4297
  }
4296
4298
  filterOnDataChange() {
4297
- if (this.adaptableOptions.filterOptions.filterActionOnDataChange.applyFilter ==
4298
- Enums_1.FilterOnDataChangeOptions.Always) {
4299
- this.agGridAdapter.getAgGridApi()?.onFilterChanged();
4300
- }
4301
- else if (this.adaptableOptions.filterOptions.filterActionOnDataChange.applyFilter ==
4302
- Enums_1.FilterOnDataChangeOptions.Throttle) {
4303
- this.throttleFilterOnDataChange();
4304
- }
4299
+ this.agGridAdapter.getAgGridApi()?.onFilterChanged();
4305
4300
  }
4306
4301
  refreshLayout() {
4307
4302
  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;
@@ -12,8 +12,7 @@ const agGridDataTypeDefinitions_1 = require("./agGridDataTypeDefinitions");
12
12
  const ColumnApiImpl_1 = require("../Api/Implementation/ColumnApiImpl");
13
13
  const isPivotColumnTotal_1 = require("../layout-manager/src/isPivotColumnTotal");
14
14
  const isPivotAggTotalColumn_1 = require("../layout-manager/src/isPivotAggTotalColumn");
15
- const ParameterizedAggregationRegistry_1 = require("../Aggregation/ParameterizedAggregationRegistry");
16
- const ParameterizedAggregationRegistry_2 = require("../Aggregation/ParameterizedAggregationRegistry");
15
+ const AggregationColumns_1 = require("../AdaptableState/Common/AggregationColumns");
17
16
  // AG GRID obfuscates its internals, this is (currently) the best way to get hold of its internal services
18
17
  const DANGER_AG_GRID_BEANS_MAP = {};
19
18
  const getColumnApiModule = () => ag_grid_enterprise_1.ColumnApiModule;
@@ -230,9 +229,8 @@ class AgGridAdapter {
230
229
  if (fctName === 'only') {
231
230
  return 'Only';
232
231
  }
233
- const parameterizedDefinition = (0, ParameterizedAggregationRegistry_1.getParameterizedAggregationDefinitionByAgGridName)(fctName);
234
- if (parameterizedDefinition) {
235
- return parameterizedDefinition.agGridAggFuncName;
232
+ if (fctName === 'weightedAvg') {
233
+ return 'Weighted Average';
236
234
  }
237
235
  return original_getDefaultFuncLabel.call(this, fctName);
238
236
  };
@@ -546,16 +544,23 @@ class AgGridAdapter {
546
544
  abColumn.exportable = this.isColumnExportable(abColumn);
547
545
  if (abColumn.aggregatable) {
548
546
  abColumn.availableAggregationFunctions = this.getColumnAggregationFunctions(colDef);
549
- const userAllowedAggFuncs = this.getUserAllowedAggFuncs(ColumnId);
550
- if (userAllowedAggFuncs) {
551
- abColumn.userAllowedAggFuncs = userAllowedAggFuncs;
552
- }
547
+ Object.defineProperty(abColumn, 'userAllowedAggFuncs', {
548
+ get: () => this.getUserAllowedAggFuncs(ColumnId),
549
+ enumerable: true,
550
+ configurable: true,
551
+ });
553
552
  if (typeof colDef.aggFunc === 'string') {
554
553
  abColumn.aggregationFunction = colDef.aggFunc;
555
554
  }
556
555
  }
557
556
  return abColumn;
558
557
  }
558
+ getUserAllowedAggFuncs(columnId) {
559
+ const userColumnAllowed = this._adaptableInstance?.agGridColumnAdapter?.getUserColDefProperty(columnId, 'allowedAggFuncs');
560
+ const userDefaultColDef = this.getUserGridOptionsProperty('defaultColDef');
561
+ const userAllowed = userColumnAllowed ?? userDefaultColDef?.allowedAggFuncs;
562
+ return Array.isArray(userAllowed) ? [...userAllowed] : undefined;
563
+ }
559
564
  deriveAdaptableColumnDataType(agColumn, logWarning = true) {
560
565
  // Some columns can have no ID or Title. we return string as a consequence but it needs testing
561
566
  if (!agColumn) {
@@ -688,12 +693,6 @@ class AgGridAdapter {
688
693
  }
689
694
  return false;
690
695
  }
691
- getUserAllowedAggFuncs(columnId) {
692
- const userColumnAllowed = this._adaptableInstance?.agGridColumnAdapter?.getUserColDefProperty(columnId, 'allowedAggFuncs');
693
- const userDefaultColDef = this.getUserGridOptionsProperty('defaultColDef');
694
- const userAllowed = userColumnAllowed ?? userDefaultColDef?.allowedAggFuncs;
695
- return Array.isArray(userAllowed) ? [...userAllowed] : undefined;
696
- }
697
696
  getColumnAggregationFunctions(colDef) {
698
697
  const defaultAggFuncs = ['sum', 'min', 'max', 'count', 'avg', 'first', 'last'];
699
698
  const hasAllowedAggFuncs = Array.isArray(colDef.allowedAggFuncs);
@@ -701,9 +700,20 @@ class AgGridAdapter {
701
700
  const gridOptionsAggFuncs = this.adaptableApi.agGridApi.getGridOption('aggFuncs') || {};
702
701
  const gridOptionsAggFuncNames = Object.keys(gridOptionsAggFuncs);
703
702
  if (!hasAllowedAggFuncs) {
704
- result.push(...gridOptionsAggFuncNames);
703
+ // we assume gridOptionsAggFuncNames includes 'weightedAvg' and 'only'
704
+ const customAggFuncNames = gridOptionsAggFuncNames.filter((name) => name !== AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME && name !== AggregationColumns_1.ONLY_AGG_FN_NAME);
705
+ // 'weightedAvg' is displayed right after 'avg'
706
+ const avgIndex = result.indexOf('avg');
707
+ if (avgIndex >= 0) {
708
+ result.splice(avgIndex + 1, 0, AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME);
709
+ }
710
+ else {
711
+ result.push(AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME);
712
+ }
713
+ result.push(...customAggFuncNames);
714
+ // 'only' is always the last element
715
+ result.push(AggregationColumns_1.ONLY_AGG_FN_NAME);
705
716
  }
706
- result = result.filter((func) => !(0, ParameterizedAggregationRegistry_2.isParameterizedAggFuncName)(func));
707
717
  return [...new Set(result)];
708
718
  }
709
719
  isTreeColumn(isGeneratedRowGroupColumn) {
@@ -6,6 +6,7 @@ const tslib_1 = require("tslib");
6
6
  const kebabCase_1 = tslib_1.__importDefault(require("../Utilities/utils/kebabCase"));
7
7
  const AdaptableFormatPresets_1 = require("../AdaptableState/Common/AdaptableFormatPresets");
8
8
  const merge_1 = tslib_1.__importDefault(require("../Utilities/utils/merge"));
9
+ const SparklineOptionsHelper_1 = require("../Utilities/Helpers/SparklineOptionsHelper");
9
10
  const StyleHelper_1 = require("../Utilities/Helpers/StyleHelper");
10
11
  const StringExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/StringExtensions"));
11
12
  const AdaptableColumn_1 = require("../AdaptableState/Common/AdaptableColumn");
@@ -31,7 +32,7 @@ const AgGridFilterAdapter_1 = require("./AgGridFilterAdapter");
31
32
  const AgGridFloatingFilterAdapter_1 = require("./AgGridFloatingFilterAdapter");
32
33
  const AdaptableLogger_1 = require("./AdaptableLogger");
33
34
  const iconStyledColumnColumnSupport_1 = require("../Utilities/Helpers/iconStyledColumnColumnSupport");
34
- const ParameterizedAggregationRegistry_1 = require("../Aggregation/ParameterizedAggregationRegistry");
35
+ const AggregationColumns_1 = require("../AdaptableState/Common/AggregationColumns");
35
36
  /**
36
37
  * CSS property keys produced by `convertAdaptableStyleToCSS` from a
37
38
  * `CellFontStyle` slice. Used to strip Format-Column-derived font CSS
@@ -557,7 +558,7 @@ class AgGridColumnAdapter {
557
558
  if (styledColumn && !styledColumn.IsSuspended) {
558
559
  if (styledColumn.SparklineStyle) {
559
560
  const sanitizedSparklineOptions = AdaptableHelper_1.AdaptableHelper.removeAdaptableObjectPrimitives(styledColumn.SparklineStyle.options);
560
- const sparklineOptions = (0, merge_1.default)({}, userDefined?.sparklineOptions, sanitizedSparklineOptions);
561
+ const sparklineOptions = (0, SparklineOptionsHelper_1.resolveSparklineOptionsForRender)((0, merge_1.default)({}, userDefined?.sparklineOptions, sanitizedSparklineOptions));
561
562
  return {
562
563
  ...userDefined,
563
564
  sparklineOptions,
@@ -576,8 +577,7 @@ class AgGridColumnAdapter {
576
577
  // Icon Style has its own tooltip vocabulary (`'CellValue'` /
577
578
  // `'IconDescription'`) so we handle it before falling through to the
578
579
  // numeric tooltip branch.
579
- if (styledColumn.IconStyle &&
580
- !(0, iconStyledColumnColumnSupport_1.isUnsupportedColumnDataTypeForIconStyle)(abColumn.dataType)) {
580
+ if (styledColumn.IconStyle && !(0, iconStyledColumnColumnSupport_1.isUnsupportedColumnDataTypeForIconStyle)(abColumn.dataType)) {
581
581
  const iconTokens = styledColumn.IconStyle.ToolTipText ?? [];
582
582
  if (iconTokens.length === 0) {
583
583
  return undefined;
@@ -655,9 +655,7 @@ class AgGridColumnAdapter {
655
655
  if (textOptions.includes('CellValue')) {
656
656
  returnValue = String(params.value ?? '');
657
657
  }
658
- if (textOptions.includes('PercentageValue') &&
659
- min != undefined &&
660
- max != undefined) {
658
+ if (textOptions.includes('PercentageValue') && min != undefined && max != undefined) {
661
659
  let percentageValue;
662
660
  if (styledColumn.PercentBarStyle?.ColumnComparison) {
663
661
  const absMax = Math.abs(max);
@@ -666,8 +664,7 @@ class AgGridColumnAdapter {
666
664
  else {
667
665
  const scaleSpan = max - min;
668
666
  const clamped = Helper_1.default.clamp(Number(params.value), min, max);
669
- percentageValue =
670
- scaleSpan === 0 ? 0 : ((clamped - min) / scaleSpan) * 100;
667
+ percentageValue = scaleSpan === 0 ? 0 : ((clamped - min) / scaleSpan) * 100;
671
668
  }
672
669
  returnValue += ` (${percentageValue.toFixed(0)}%)`;
673
670
  }
@@ -733,8 +730,7 @@ class AgGridColumnAdapter {
733
730
  if (!abColumn.availableAggregationFunctions) {
734
731
  return undefined;
735
732
  }
736
- return abColumn.availableAggregationFunctions.filter((func) => !(0, ParameterizedAggregationRegistry_1.isParameterizedAggFuncName)(func));
737
- // .filter((func) => func !== ONLY_AGG_FN_NAME);
733
+ return abColumn.availableAggregationFunctions.filter((func) => !(0, AggregationColumns_1.isWeightedAverageAggFuncName)(func));
738
734
  });
739
735
  }
740
736
  setupColumnType(columnSetupInfo) {
@@ -956,10 +952,7 @@ class AgGridColumnAdapter {
956
952
  // 1. evaluate EditOptions.isCellEditable if provided
957
953
  if (this.adaptableApi.gridApi.internalApi.hasCellEditableAccordingToEditOptions()) {
958
954
  const gridCell = this.adaptableApi.gridApi.getGridCellFromRowNode(params.node, params.column.getColId());
959
- const editOptionsEditability = this.adaptableApi.gridApi.internalApi.isCellEditableAccordingToEditOptions(gridCell, getOriginalColDefEditable());
960
- if (editOptionsEditability) {
961
- return editOptionsEditability;
962
- }
955
+ return this.adaptableApi.gridApi.internalApi.isCellEditableAccordingToEditOptions(gridCell, getOriginalColDefEditable());
963
956
  }
964
957
  // 2. otherwise, fallback to colDef.editable
965
958
  return getOriginalColDefEditable();
@@ -1471,8 +1464,7 @@ class AgGridColumnAdapter {
1471
1464
  // basis when a Gradient cell has a tinted background, even if the user
1472
1465
  // also set `Font.ForeColor` as a baseline.
1473
1466
  const autoContrastColor = gradientStyle?.AutoContrastText && style.color ? style.color : undefined;
1474
- const iconStyleFontApplies = styledColumn.IconStyle &&
1475
- !(0, iconStyledColumnColumnSupport_1.isUnsupportedColumnDataTypeForIconStyle)(abColumn.dataType);
1467
+ const iconStyleFontApplies = styledColumn.IconStyle && !(0, iconStyledColumnColumnSupport_1.isUnsupportedColumnDataTypeForIconStyle)(abColumn.dataType);
1476
1468
  const fontSlot = styledColumn.GradientStyle?.Font ??
1477
1469
  styledColumn.PercentBarStyle?.Font ??
1478
1470
  styledColumn.BulletChartStyle?.Font ??
@@ -1484,8 +1476,7 @@ class AgGridColumnAdapter {
1484
1476
  if (fontSlot) {
1485
1477
  style = { ...style, ...(0, StyleHelper_1.convertAdaptableStyleToCSS)(fontSlot) };
1486
1478
  }
1487
- const iconStyleCellApplies = styledColumn.IconStyle &&
1488
- !(0, iconStyledColumnColumnSupport_1.isUnsupportedColumnDataTypeForIconStyle)(abColumn.dataType);
1479
+ const iconStyleCellApplies = styledColumn.IconStyle && !(0, iconStyledColumnColumnSupport_1.isUnsupportedColumnDataTypeForIconStyle)(abColumn.dataType);
1489
1480
  const cellSlot = styledColumn.RatingStyle?.Cell ??
1490
1481
  styledColumn.SparklineStyle?.Cell ??
1491
1482
  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;
@@ -6,8 +6,8 @@ const Icon_1 = require("../components/Icon");
6
6
  const icons_1 = require("../components/icons");
7
7
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
8
8
  const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
9
- const parameterizedAggregationColumnMenu_1 = require("../Aggregation/parameterizedAggregationColumnMenu");
10
- const parameterizedAggregationHelpers_1 = require("../Aggregation/parameterizedAggregationHelpers");
9
+ const buildValueAggregationMenuItem_1 = require("./buildValueAggregationMenuItem");
10
+ const createAgGridIcon_1 = require("./createAgGridIcon");
11
11
  class AgGridMenuAdapter {
12
12
  _adaptableInstance;
13
13
  constructor(_adaptableInstance) {
@@ -59,42 +59,25 @@ class AgGridMenuAdapter {
59
59
  .filter(Boolean);
60
60
  }
61
61
  // 2. if not, return the default context menu
62
- let defaultContextMenu = [
63
- ...agGridMenuItems,
62
+ // AG Grid does not allow customizing the built-in `valueAggSubMenu`, so we
63
+ // replace it with an Adaptable-built equivalent that also offers a Weighted
64
+ // Average aggregation (with a submenu to pick the weight column).
65
+ // Weighted Average is never used in Pivot Layouts, so we leave the AG Grid
66
+ // default item untouched there.
67
+ const isPivotLayout = this.adaptableApi.layoutApi.isCurrentLayoutPivot();
68
+ const mappedAgGridMenuItems = agGridMenuItems.map((itemName) => itemName === 'valueAggSubMenu' && !isPivotLayout
69
+ ? {
70
+ ...(0, buildValueAggregationMenuItem_1.buildValueAggregationMenuItem)(this.adaptableApi, menuContext),
71
+ icon: (0, createAgGridIcon_1.createAgGridIcon)('aggregation'),
72
+ }
73
+ : itemName);
74
+ const defaultContextMenu = [
75
+ ...mappedAgGridMenuItems,
64
76
  'separator',
65
77
  ...defaultColumnMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
66
78
  ];
67
- defaultContextMenu = this.injectParameterizedAggregationColumnMenuItems(defaultContextMenu, adaptableColumn);
68
79
  return this.removeConsecutiveSeparators(defaultContextMenu);
69
80
  }
70
- injectParameterizedAggregationColumnMenuItems(menuItems, column) {
71
- const consolidatedAggregationMenuItem = (0, parameterizedAggregationColumnMenu_1.buildConsolidatedAggregationColumnMenuItem)(this.adaptableApi, column, (columnId, parameterizedAgg) => {
72
- this.adaptableApi.layoutApi.setColumnParameterizedAggregation(columnId, parameterizedAgg);
73
- }, (columnId, aggFunc) => {
74
- this.adaptableApi.layoutApi.updateCurrentLayout((layout) => {
75
- if (aggFunc == null) {
76
- (0, parameterizedAggregationHelpers_1.removeColumnAggregationFromLayout)(layout, columnId);
77
- }
78
- else {
79
- (0, parameterizedAggregationHelpers_1.upsertColumnAggregationInLayout)(layout, columnId, aggFunc);
80
- }
81
- return layout;
82
- });
83
- this.adaptableApi.agGridApi.setColumnAggFunc(columnId, aggFunc);
84
- });
85
- if (!consolidatedAggregationMenuItem) {
86
- return menuItems;
87
- }
88
- consolidatedAggregationMenuItem.icon = this.mapAdaptableIconToAgGridIcon({ name: 'equation' });
89
- const originalValueAggMenuIndex = menuItems.findIndex((item) => (0, parameterizedAggregationColumnMenu_1.isValueAggregationMenuItem)(item));
90
- const menuItemsWithoutValueAgg = menuItems.filter((item) => !(0, parameterizedAggregationColumnMenu_1.isValueAggregationMenuItem)(item));
91
- const result = [...menuItemsWithoutValueAgg];
92
- const insertIndex = originalValueAggMenuIndex !== -1
93
- ? Math.min(originalValueAggMenuIndex, result.length)
94
- : (0, parameterizedAggregationColumnMenu_1.findParameterizedAggMenuInsertIndex)(menuItemsWithoutValueAgg);
95
- result.splice(insertIndex, 0, consolidatedAggregationMenuItem);
96
- return result;
97
- }
98
81
  buildContextMenu(params, originalGetContextMenuItems) {
99
82
  if (!params.column) {
100
83
  return [];
@@ -273,7 +256,7 @@ class AgGridMenuAdapter {
273
256
  ? () => this.adaptableApi.internalApi.dispatchReduxAction(fullMenuItem.reduxAction)
274
257
  : undefined,
275
258
  icon: this.mapAdaptableIconToAgGridIcon(fullMenuItem.icon, {
276
- fill: 'var(--ab-color-text-on-primary)',
259
+ fill: 'var(--ab-color-primary-foreground)',
277
260
  }),
278
261
  subMenu: fullMenuItem.subItems?.map((subMenuItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(subMenuItem)),
279
262
  };
@@ -286,7 +269,7 @@ class AgGridMenuAdapter {
286
269
  return {
287
270
  name: customMenuItem.label,
288
271
  icon: this.mapAdaptableIconToAgGridIcon(customMenuItem.icon, {
289
- fill: 'var(--ab-color-text-on-primary)',
272
+ fill: 'var(--ab-color-primary-foreground)',
290
273
  }),
291
274
  disabled: customMenuItem.disabled,
292
275
  subMenu: !customMenuItem.disabled
@@ -314,7 +297,7 @@ class AgGridMenuAdapter {
314
297
  name: userMenuItem.label,
315
298
  action: () => (userMenuItem.onClick ? userMenuItem.onClick(menuContext) : null),
316
299
  icon: this.mapAdaptableIconToAgGridIcon(userMenuItem.icon, {
317
- fill: 'var(--ab-color-text-on-primary)',
300
+ fill: 'var(--ab-color-primary-foreground)',
318
301
  }),
319
302
  disabled: userMenuItem.disabled,
320
303
  subMenu: userMenuItem.subMenuItems
@@ -739,7 +722,7 @@ class AgGridMenuAdapter {
739
722
  }
740
723
  else {
741
724
  return (0, icons_1.iconToString)(icon, {
742
- fill: 'var(--ab-color-text-on-primary)',
725
+ fill: 'var(--ab-color-primary-foreground)',
743
726
  });
744
727
  }
745
728
  }
@@ -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,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildValueAggregationMenuItem = buildValueAggregationMenuItem;
4
+ const AggregationColumns_1 = require("../AdaptableState/Common/AggregationColumns");
5
+ const toFuncLabel = (funcName) => {
6
+ if (funcName === 'avg') {
7
+ return 'Average';
8
+ }
9
+ if (funcName === 'weightedAvg') {
10
+ return 'Weighted Average';
11
+ }
12
+ return funcName ? funcName.charAt(0).toUpperCase() + funcName.slice(1) : funcName;
13
+ };
14
+ /**
15
+ * Builds the replacement for AG Grid's built-in `valueAggSubMenu` column menu item.
16
+ *
17
+ * AG Grid does not allow customizing the built-in submenu, so we rebuild an
18
+ * equivalent one: the column's existing aggregation functions plus a
19
+ * `Weighted Average` item whose submenu lists the numeric columns that can be
20
+ * used as the weight parameter.
21
+ *
22
+ * Both standard and weighted selections persist through the current Layout
23
+ * (`updateCurrentLayout`), so the existing `weightedAvg` aggFunc can read the
24
+ * chosen `weightedColumnId` back from the Layout.
25
+ *
26
+ * Weighted Average is never used in Pivot Layouts, so this only deals with the
27
+ * Table Layout aggregations and the caller skips it entirely in Pivot mode.
28
+ */
29
+ function buildValueAggregationMenuItem(adaptableApi, menuContext) {
30
+ const column = menuContext.adaptableColumn;
31
+ const columnId = column.columnId;
32
+ const currentLayout = adaptableApi.layoutApi.getCurrentLayout();
33
+ const aggregationColumns = currentLayout.TableAggregationColumns || [];
34
+ const currentAggFunc = aggregationColumns.find((agg) => agg.ColumnId === columnId)?.AggFunc;
35
+ let activeAggFuncName;
36
+ if (currentAggFunc != null) {
37
+ const aggFuncName = (0, AggregationColumns_1.getAggFuncName)(currentAggFunc);
38
+ activeAggFuncName = aggFuncName === true ? column.aggregationFunction : aggFuncName;
39
+ }
40
+ const activeWeightColumnId = (0, AggregationColumns_1.isWeightedAverageAggregation)(currentAggFunc)
41
+ ? currentAggFunc.weightedColumnId
42
+ : undefined;
43
+ const applyAggregation = (aggFuncValue) => {
44
+ const upsert = (cols) => {
45
+ const list = cols ? [...cols] : [];
46
+ const index = list.findIndex((col) => col.ColumnId === columnId);
47
+ if (index >= 0) {
48
+ list[index] = { ...list[index], AggFunc: aggFuncValue };
49
+ }
50
+ else {
51
+ list.push({ ColumnId: columnId, AggFunc: aggFuncValue });
52
+ }
53
+ return list;
54
+ };
55
+ adaptableApi.layoutApi.updateCurrentLayout((layout) => {
56
+ const tableLayout = layout;
57
+ return {
58
+ ...tableLayout,
59
+ TableAggregationColumns: upsert(tableLayout.TableAggregationColumns),
60
+ };
61
+ });
62
+ };
63
+ const removeAggregation = () => {
64
+ adaptableApi.layoutApi.updateCurrentLayout((layout) => {
65
+ const tableLayout = layout;
66
+ return {
67
+ ...tableLayout,
68
+ TableAggregationColumns: (tableLayout.TableAggregationColumns || []).filter((col) => col.ColumnId !== columnId),
69
+ };
70
+ });
71
+ };
72
+ // 'None' clears any aggregation for the column and is checked when none is set
73
+ const subMenu = [
74
+ {
75
+ name: 'None',
76
+ checked: activeAggFuncName == null,
77
+ action: () => removeAggregation(),
78
+ },
79
+ ];
80
+ // getDisplayAggFuncNames already positions weightedAvg right after 'avg'
81
+ // (and only includes it when the column is eligible)
82
+ const aggFuncItems = (0, AggregationColumns_1.getDisplayAggFuncNames)(column).map((funcName) => {
83
+ // Weighted Average needs a weight column parameter, so instead of a plain
84
+ // action it gets a submenu listing the numeric columns usable as the weight.
85
+ if (funcName === AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME) {
86
+ const weightColumnItems = adaptableApi.columnApi
87
+ .getNumericColumns()
88
+ .filter((numericColumn) => numericColumn.columnId !== columnId)
89
+ .map((numericColumn) => ({
90
+ name: numericColumn.friendlyName ?? numericColumn.columnId,
91
+ checked: activeWeightColumnId === numericColumn.columnId,
92
+ action: () => applyAggregation({
93
+ type: 'weightedAverage',
94
+ weightedColumnId: numericColumn.columnId,
95
+ }),
96
+ }));
97
+ return {
98
+ name: 'Weighted Average',
99
+ checked: activeAggFuncName === AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME,
100
+ subMenu: weightColumnItems,
101
+ };
102
+ }
103
+ return {
104
+ name: toFuncLabel(funcName),
105
+ checked: activeAggFuncName === funcName,
106
+ action: () => applyAggregation(funcName),
107
+ };
108
+ });
109
+ subMenu.push(...aggFuncItems);
110
+ return {
111
+ name: 'Value Aggregation',
112
+ subMenu,
113
+ };
114
+ }
@@ -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;