@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
@@ -14,7 +14,8 @@ import ArrayExtensions from '../../../Utilities/Extensions/ArrayExtensions';
14
14
  import AdaptableInput from '../../Components/AdaptableInput';
15
15
  import { Box, Flex } from '../../../components/Flex';
16
16
  import { SingleSelect } from '../../../components/NewSelect';
17
- import { StyledColumnRangeBarListPreview } from './StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews';
17
+ import { RangeBarRangesSummaryPreview } from './StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview';
18
+ import { StyledColumnRangeBarPreviewCard } from './StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview';
18
19
  import { Card } from '../../../components/Card';
19
20
  const RANGE_STYLE_FORM_SIZES = ['200px', '1fr'];
20
21
  const BOUND_MODE_LABELS = {
@@ -45,40 +46,121 @@ const summarizeBound = (bound) => {
45
46
  }
46
47
  return bound;
47
48
  };
48
- // ---------------------------------------------------------------------------
49
- // Summary helper (Wizard "Style" step header)
50
- // ---------------------------------------------------------------------------
49
+ const formatRangeBarCellTextSummary = (cellText) => cellText
50
+ ?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value'))
51
+ .join(' + ') ?? '';
52
+ const formatRangeBarToolTipSummary = (toolTipText) => toolTipText
53
+ ?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value'))
54
+ .join(' + ') ?? '';
55
+ export const getStyledColumnRangeBarRangeViewValues = (data) => {
56
+ const range = data.RangeBarStyle;
57
+ if (!range) {
58
+ return [];
59
+ }
60
+ const items = [
61
+ `Min: ${summarizeBound(range.Min)}`,
62
+ `Max: ${summarizeBound(range.Max)}`,
63
+ ];
64
+ if (range.Reference != undefined) {
65
+ items.push(`Reference: ${summarizeBound(range.Reference)}`);
66
+ }
67
+ const bandCount = range.CellRanges?.length ?? 0;
68
+ if (bandCount > 0) {
69
+ items.push(`Bands: ${bandCount}`);
70
+ }
71
+ if (range.RangeValueType != null) {
72
+ items.push(`Range Value Type: ${range.RangeValueType}`);
73
+ }
74
+ return items;
75
+ };
76
+ const buildStyledColumnRangeBarDisplaySummaryStrings = (range, options) => {
77
+ const items = [];
78
+ const valueMarker = range.Marker;
79
+ const referenceMarker = range.ReferenceMarker;
80
+ items.push(`Value Marker Shape: ${valueMarker?.Shape ?? 'Diamond'}`);
81
+ if (valueMarker?.Color) {
82
+ items.push(`Value Marker Colour: ${valueMarker.Color}`);
83
+ }
84
+ if (valueMarker?.Size != null) {
85
+ items.push(`Value Marker Size: ${valueMarker.Size}px`);
86
+ }
87
+ if (range.Reference != undefined) {
88
+ items.push(`Reference Marker Shape: ${referenceMarker?.Shape ?? 'Line'}`);
89
+ if (referenceMarker?.Color) {
90
+ items.push(`Reference Marker Colour: ${referenceMarker.Color}`);
91
+ }
92
+ if (referenceMarker?.Size != null) {
93
+ items.push(`Reference Marker Size: ${referenceMarker.Size}px`);
94
+ }
95
+ }
96
+ if (range.Orientation === 'Vertical') {
97
+ items.push('Orientation: Vertical');
98
+ }
99
+ const outOfRangeMode = range.OutOfRangeMode ?? 'Clamp';
100
+ if (outOfRangeMode !== 'Clamp') {
101
+ items.push(`Out of Range: ${outOfRangeMode}`);
102
+ }
103
+ if (range.OutOfRangeColor) {
104
+ items.push(`Out of Range Colour: ${range.OutOfRangeColor}`);
105
+ }
106
+ if (range.TrackColor) {
107
+ items.push(`Track Colour: ${range.TrackColor}`);
108
+ }
109
+ if (range.TrackHeight != null) {
110
+ items.push(`Track Height: ${range.TrackHeight}px`);
111
+ }
112
+ if (range.BackColor) {
113
+ items.push(`Back Colour: ${range.BackColor}`);
114
+ }
115
+ if (range.CellText?.length) {
116
+ items.push(`Cell Text: ${formatRangeBarCellTextSummary(range.CellText)}`);
117
+ items.push(`Cell Text Position: ${range.CellTextPosition ?? 'Below'}`);
118
+ }
119
+ else if (options.includeEmptyCellText) {
120
+ items.push('Cell Text: None');
121
+ }
122
+ if (range.ToolTipText?.length) {
123
+ items.push(`Tooltip: ${formatRangeBarToolTipSummary(range.ToolTipText)}`);
124
+ }
125
+ else if (options.includeEmptyTooltip) {
126
+ items.push('Tooltip: No Tooltip');
127
+ }
128
+ return items;
129
+ };
130
+ export const getStyledColumnRangeBarDisplayViewValues = (data) => {
131
+ const range = data.RangeBarStyle;
132
+ if (!range) {
133
+ return [];
134
+ }
135
+ return buildStyledColumnRangeBarDisplaySummaryStrings(range, {
136
+ includeEmptyCellText: false,
137
+ includeEmptyTooltip: false,
138
+ });
139
+ };
51
140
  /** Summary line for the Range wizard step (bounds + bands only). */
52
141
  export const renderStyledColumnRangeBarRangeStepSummary = (data) => {
53
142
  const range = data.RangeBarStyle;
54
143
  if (!range) {
55
144
  return _jsx(Tag, { children: "No Styling Defined" });
56
145
  }
57
- const bandCount = range.CellRanges?.length ?? 0;
58
- const hasReference = range.Reference != undefined;
59
- return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2 twa:items-start", children: [_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap", children: [_jsxs(Box, { className: "twa:mr-1", children: ["Min: ", _jsx(Tag, { children: summarizeBound(range.Min) })] }), _jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Max: ", _jsx(Tag, { children: summarizeBound(range.Max) })] }), hasReference && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Ref: ", _jsx(Tag, { children: summarizeBound(range.Reference) })] })), bandCount > 0 && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 ", bandCount, " ", bandCount === 1 ? 'band' : 'bands'] }))] }), _jsx(StyledColumnRangeBarListPreview, { range: range })] }));
146
+ const tagItems = getStyledColumnRangeBarRangeViewValues(data);
147
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2 twa:items-start", children: [_jsx(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: tagItems.map((item) => (_jsx(Tag, { children: item }, item))) }), _jsx(RangeBarRangesSummaryPreview, { rangeStyle: range })] }));
60
148
  };
149
+ export const StyledColumnRangeBarRangeView = ({ data }) => renderStyledColumnRangeBarRangeStepSummary(data);
61
150
  /** Summary for the Display wizard step (markers, track, text). */
62
151
  export const renderStyledColumnRangeBarDisplayStepSummary = (data) => {
63
152
  const range = data.RangeBarStyle;
64
153
  if (!range) {
65
154
  return _jsx(Tag, { children: "No Styling Defined" });
66
155
  }
67
- const isVertical = range.Orientation === 'Vertical';
68
- const mode = range.OutOfRangeMode ?? 'Clamp';
69
- const parts = [];
70
- parts.push(_jsxs(Box, { className: "twa:mr-1", children: ["Value marker: ", _jsx(Tag, { children: range.Marker?.Shape ?? 'Diamond' })] }, "vm"));
71
- if (range.Reference != undefined) {
72
- parts.push(_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Ref marker: ", _jsx(Tag, { children: range.ReferenceMarker?.Shape ?? 'Line' })] }, "rm"));
73
- }
74
- if (isVertical) {
75
- parts.push(_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 ", _jsx(Tag, { children: "vertical" })] }, "v"));
156
+ const items = buildStyledColumnRangeBarDisplaySummaryStrings(range, {
157
+ includeEmptyCellText: true,
158
+ includeEmptyTooltip: true,
159
+ });
160
+ if (!items.length) {
161
+ return _jsx(Tag, { children: "No Display Defined" });
76
162
  }
77
- parts.push(_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Out: ", _jsx(Tag, { children: mode })] }, "orm"));
78
- if (range.CellText?.length) {
79
- parts.push(_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Text: ", _jsx(Tag, { children: range.CellText.join(', ') })] }, "ct"));
80
- }
81
- return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2 twa:items-start", children: [_jsx(Flex, { alignItems: "center", className: "twa:flex-wrap", children: parts }), _jsx(StyledColumnRangeBarListPreview, { range: range })] }));
163
+ return (_jsx(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: items.map((item) => (_jsx(Tag, { children: item }, item))) }));
82
164
  };
83
165
  /**
84
166
  * Combined summary for the Styled Columns list row (preview + key facts).
@@ -88,10 +170,7 @@ export const renderStyledColumnRangeBarSummary = (data) => {
88
170
  if (!range) {
89
171
  return _jsx(Tag, { children: "No Styling Defined" });
90
172
  }
91
- const bandCount = range.CellRanges?.length ?? 0;
92
- const isVertical = range.Orientation === 'Vertical';
93
- const hasReference = range.Reference != undefined;
94
- return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2 twa:items-start", children: [_jsx(StyledColumnRangeBarListPreview, { range: range }), _jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap", children: [_jsxs(Box, { className: "twa:mr-1", children: ["Min: ", _jsx(Tag, { children: summarizeBound(range.Min) })] }), _jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Max: ", _jsx(Tag, { children: summarizeBound(range.Max) })] }), hasReference && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Ref: ", _jsx(Tag, { children: summarizeBound(range.Reference) })] })), bandCount > 0 && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 ", bandCount, " ", bandCount === 1 ? 'band' : 'bands'] })), isVertical && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 ", _jsx(Tag, { children: "vertical" })] }))] })] }));
173
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:items-start", children: [renderStyledColumnRangeBarRangeStepSummary(data), renderStyledColumnRangeBarDisplayStepSummary(data)] }));
95
174
  };
96
175
  // ---------------------------------------------------------------------------
97
176
  // Wizard validity check (also used by the wizard step config)
@@ -128,19 +207,25 @@ const MARKER_SHAPES = [
128
207
  ];
129
208
  export const StyledColumnWizardRangeBarSection = (props) => {
130
209
  const { data, api } = useOnePageAdaptableWizardContext();
131
- const minMaxRangeValues = React.useMemo(() => {
210
+ const column = React.useMemo(() => {
132
211
  const columnId = data.ColumnId;
133
- if (!columnId)
212
+ if (!columnId) {
213
+ return undefined;
214
+ }
215
+ return api.columnApi.getColumnWithColumnId(columnId);
216
+ }, [data.ColumnId, api]);
217
+ const minMaxRangeValues = React.useMemo(() => {
218
+ if (!column) {
134
219
  return null;
135
- const column = api.columnApi.getColumnWithColumnId(columnId);
220
+ }
136
221
  return {
137
222
  min: api.styledColumnApi.internalApi.getMinValueForNumericColumn(column),
138
223
  max: api.styledColumnApi.internalApi.getMaxValueForNumericColumn(column),
139
224
  };
140
- }, [data]);
225
+ }, [column, api]);
141
226
  const scope = { ColumnIds: [data.ColumnId] };
142
227
  const range = data.RangeBarStyle ?? {};
143
- const disabled = !data.ColumnId;
228
+ const disabled = !data.ColumnId || !column;
144
229
  // -------------------------------------------------------------------------
145
230
  // Updaters
146
231
  // -------------------------------------------------------------------------
@@ -270,8 +355,10 @@ export const StyledColumnWizardRangeBarSection = (props) => {
270
355
  // -------------------------------------------------------------------------
271
356
  // Render
272
357
  // -------------------------------------------------------------------------
273
- if (!data.ColumnId) {
274
- return (_jsx(Box, { children: _jsx(ErrorBox, { className: "twa:mt-2", children: "You need to select a column before styling." }) }));
358
+ if (!data.ColumnId || !column) {
359
+ return (_jsx(Box, { children: _jsx(ErrorBox, { className: "twa:mt-2", children: !data.ColumnId
360
+ ? 'You need to select a column before styling.'
361
+ : `Column "${data.ColumnId}" was not found in the grid.` }) }));
275
362
  }
276
363
  const hasReference = range.Reference != undefined;
277
364
  const outOfRangeMode = range.OutOfRangeMode ?? 'Clamp';
@@ -291,7 +378,7 @@ export const StyledColumnWizardRangeBarSection = (props) => {
291
378
  field: 'Reference',
292
379
  optional: true,
293
380
  fallbackNumber: minMaxRangeValues?.max ?? 0,
294
- })] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Ranges" }), _jsxs(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-700px]", children: ["Optional coloured segments drawn ", _jsx("em", { children: "behind" }), " track to form qualitative scale;leave empty for a plain track"] })] }), _jsx(Card.Body, { children: _jsx(RangesComponent, { allowEmptyRanges: true, disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, ranges: range.CellRanges, rangeValueType: range.RangeValueType, onRangeValueTypeChange: onRangeValueTypeChange, columnComparison: range.ColumnComparison, updateRanges: onUpdateRanges, updateColumnComparison: onUpdateColumnComparison, hideColumnComparison: true }) })] })] })), !isRangeVariant && (_jsxs(_Fragment, { children: [_jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Value Marker" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Drawn at the cell value's position along the track." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Shape:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: valueMarker.Shape, onValueChange: (s) => updateValueMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), _jsx(FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(ColorPicker, { disabled: disabled, api: api, value: valueMarker.Color || undefined, onChange: (c) => updateValueMarker({ Color: c }) }) }), _jsx(FormRow, { label: "Size:", children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: valueMarker.Size, onChange: (e) => updateValueMarker({ Size: Number(e.target.value) }) }) }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Reference Marker" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: hasReference
381
+ })] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Ranges" }), _jsxs(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-700px]", children: ["Optional coloured segments drawn ", _jsx("em", { children: "behind" }), " track to form qualitative scale;leave empty for a plain track"] })] }), _jsx(Card.Body, { children: _jsx(RangesComponent, { allowEmptyRanges: true, disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, ranges: range.CellRanges ?? [], rangeValueType: range.RangeValueType, onRangeValueTypeChange: onRangeValueTypeChange, columnComparison: range.ColumnComparison, updateRanges: onUpdateRanges, updateColumnComparison: onUpdateColumnComparison, hideColumnComparison: true }) })] })] })), !isRangeVariant && (_jsxs(_Fragment, { children: [_jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Value Marker" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Drawn at the cell value's position along the track." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Shape:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: valueMarker.Shape, onValueChange: (s) => updateValueMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), _jsx(FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(ColorPicker, { disabled: disabled, api: api, value: valueMarker.Color || undefined, onChange: (c) => updateValueMarker({ Color: c }) }) }), _jsx(FormRow, { label: "Size:", children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: valueMarker.Size, onChange: (e) => updateValueMarker({ Size: Number(e.target.value) }) }) }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Reference Marker" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: hasReference
295
382
  ? 'Drawn at the Reference value (e.g. previous close, target, midpoint).'
296
383
  : 'Optional second marker when a Reference bound is set on the Style step.' })] }), _jsx(Card.Body, { children: hasReference ? (_jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Shape:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: referenceMarker.Shape, onValueChange: (s) => updateReferenceMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), _jsx(FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(ColorPicker, { disabled: disabled, api: api, value: referenceMarker.Color || undefined, onChange: (c) => updateReferenceMarker({ Color: c }) }) }), _jsx(FormRow, { label: "Size:", children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: referenceMarker.Size, onChange: (e) => updateReferenceMarker({ Size: Number(e.target.value) }) }) }) })] })) : (_jsx(Box, { className: "twa:text-xs twa:opacity-60 twa:max-w-[520px]", children: "Add a Reference value on the Style step (Bounds section) to enable this marker (e.g. previous close, target, midpoint)." })) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Track" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "The line representing the [Min, Max] interval, plus optional cell background." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Orientation:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: range.Orientation ?? 'Horizontal', onValueChange: (v) => update({ Orientation: v }), items: [
297
384
  { value: 'Horizontal', label: 'Horizontal' },
@@ -306,5 +393,5 @@ export const StyledColumnWizardRangeBarSection = (props) => {
306
393
  { label: 'Above Bar', onClick: () => handleCellTextPositionChange('Above') },
307
394
  { label: 'Below Bar', onClick: () => handleCellTextPositionChange('Below') },
308
395
  { label: 'Merged', onClick: () => handleCellTextPositionChange('Merged') },
309
- ], children: range.CellTextPosition ?? 'Below' }) }), _jsxs(FormRow, { label: "Tooltip Display:", children: [_jsx(CheckBox, { disabled: disabled, checked: range.ToolTipText?.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { disabled: disabled, className: "twa:ml-3", checked: range.ToolTipText?.includes('PercentageValue'), onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percent Value" })] })] }) })] })] }))] }));
396
+ ], children: range.CellTextPosition ?? 'Below' }) }), _jsxs(FormRow, { label: "Tooltip Display:", children: [_jsx(CheckBox, { disabled: disabled, checked: range.ToolTipText?.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { disabled: disabled, className: "twa:ml-3", checked: range.ToolTipText?.includes('PercentageValue'), onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percent Value" })] })] }) })] }), _jsx(StyledColumnRangeBarPreviewCard, { data: data })] }))] }));
310
397
  };
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { StyledColumn } from '../../../AdaptableState/StyledColumnState';
3
+ export declare const getStyledColumnRatingStyleViewValues: (data: StyledColumn) => string[];
3
4
  export declare const renderStyledColumnRatingSummary: (data: StyledColumn) => React.JSX.Element;
4
5
  export declare const isValidRatingStyle: (data: StyledColumn) => true | string;
5
6
  export interface StyledColumnWizardRatingSectionProps {
@@ -1,5 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import { CheckBox } from '../../../components/CheckBox';
4
3
  import ErrorBox from '../../../components/ErrorBox';
5
4
  import FormLayout, { FormRow } from '../../../components/FormLayout';
@@ -9,9 +8,9 @@ import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableW
9
8
  import { Box, Flex } from '../../../components/Flex';
10
9
  import { SingleSelect } from '../../../components/NewSelect';
11
10
  import Input from '../../../components/Input';
12
- import { renderCellStyleSummaryTags, StyledColumnCellStyleEditor, } from './StyledColumnSliceStyleEditors';
11
+ import { getCellBoxStyleSummaryItems, StyledColumnCellStyleEditor, } from './StyledColumnSliceStyleEditors';
13
12
  import { Card } from '../../../components/Card';
14
- import { convertAdaptableStyleToCSS, hasCellBoxStyle, } from '../../../Utilities/Helpers/StyleHelper';
13
+ import { DEFAULT_RATING_GAP, DEFAULT_RATING_ICON, DEFAULT_RATING_MAX, DEFAULT_RATING_SIZE, StyledColumnRatingPreviewCard, } from './StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview';
15
14
  const STYLE_FORM_SIZES = ['200px', '1fr'];
16
15
  const ICON_CHOICES = [
17
16
  { value: 'Star', label: 'Star' },
@@ -19,13 +18,48 @@ const ICON_CHOICES = [
19
18
  { value: 'Circle', label: 'Circle' },
20
19
  { value: 'Thumb', label: 'Thumb' },
21
20
  ];
22
- // Mirrors the renderer defaults so the wizard preview/summary stay in sync.
23
- const DEFAULT_MAX = 5;
24
- const DEFAULT_SIZE = 14;
25
- const DEFAULT_GAP = 2;
26
- const DEFAULT_ICON = 'Star';
27
- const DEFAULT_FILLED_COLOR = 'var(--ab-color-warn, #f5a623)';
28
- const DEFAULT_EMPTY_COLOR = 'color-mix(in srgb, currentColor 22%, transparent)';
21
+ const formatRatingToolTipSummary = (toolTipText) => toolTipText
22
+ ?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percentage Value'))
23
+ .join(' + ') ?? '';
24
+ const buildStyledColumnRatingStyleSummaryStrings = (rating, options) => {
25
+ const items = [
26
+ `Max: ${rating.Max ?? DEFAULT_RATING_MAX}`,
27
+ `Icon: ${rating.Icon ?? DEFAULT_RATING_ICON}`,
28
+ ];
29
+ if (rating.FilledColor) {
30
+ items.push(`Filled Colour: ${rating.FilledColor}`);
31
+ }
32
+ if (rating.EmptyColor) {
33
+ items.push(`Empty Colour: ${rating.EmptyColor}`);
34
+ }
35
+ if (rating.Size != null) {
36
+ items.push(`Icon Size: ${rating.Size}px`);
37
+ }
38
+ if (rating.Gap != null) {
39
+ items.push(`Icon Gap: ${rating.Gap}px`);
40
+ }
41
+ items.push(`Allow Half: ${(rating.AllowHalf ?? true) ? 'Yes' : 'No'}`);
42
+ items.push(`Show Value: ${rating.ShowValue ? 'Yes' : 'No'}`);
43
+ if (rating.ToolTipText?.length) {
44
+ items.push(`Tooltip: ${formatRatingToolTipSummary(rating.ToolTipText)}`);
45
+ }
46
+ else if (options.includeEmptyTooltip) {
47
+ items.push('Tooltip: No Tooltip');
48
+ }
49
+ getCellBoxStyleSummaryItems(rating.Cell).forEach(({ label, value }) => {
50
+ items.push(`${label}: ${value}`);
51
+ });
52
+ return items;
53
+ };
54
+ export const getStyledColumnRatingStyleViewValues = (data) => {
55
+ const rating = data.RatingStyle;
56
+ if (!rating) {
57
+ return [];
58
+ }
59
+ return buildStyledColumnRatingStyleSummaryStrings(rating, {
60
+ includeEmptyTooltip: false,
61
+ });
62
+ };
29
63
  /**
30
64
  * Resolve a CSS custom property (e.g. `--ab-color-warn`) to its computed
31
65
  * value at runtime. Returns the fallback hex on SSR or when the variable
@@ -49,17 +83,10 @@ const resolveCssVar = (varName, fallbackHex) => {
49
83
  * the user hasn't chosen one. The renderer uses `var(--ab-color-warn,
50
84
  * #f5a623)`, but `ColorPicker` can't parse a `var(...)` with a fallback,
51
85
  * so we resolve the variable manually and pass a concrete hex.
52
- *
53
- * State remains untouched - the picker only writes to state when the user
54
- * actively picks a colour, so we never accidentally bake the resolved
55
- * theme value into the saved styled column.
56
86
  */
57
87
  const getDisplayedFilledColor = (rating) => rating.FilledColor || resolveCssVar('--ab-color-warn', '#f5a623');
58
88
  /**
59
- * Best-effort preview colour for the wizard's `Empty Colour` picker. The
60
- * renderer's actual default is `color-mix(in srgb, currentColor 22%,
61
- * transparent)`, which the picker can't parse either; we approximate it
62
- * by reading the document foreground colour and setting alpha to 0.22.
89
+ * Best-effort preview colour for the wizard's `Empty Colour` picker.
63
90
  */
64
91
  const getDisplayedEmptyColor = (rating) => {
65
92
  if (rating.EmptyColor)
@@ -78,62 +105,16 @@ const getDisplayedEmptyColor = (rating) => {
78
105
  }
79
106
  return 'rgba(127, 127, 127, 0.22)';
80
107
  };
81
- // ---------------------------------------------------------------------------
82
- // Inline preview (also reused by the wizard summary so the user sees a
83
- // pixel-accurate idea of the resulting cell at all times).
84
- // ---------------------------------------------------------------------------
85
- const ICON_PATHS = {
86
- Star: 'M12 2 L14.9 8.6 L22 9.3 L16.7 14.1 L18.2 21 L12 17.4 L5.8 21 L7.3 14.1 L2 9.3 L9.1 8.6 Z',
87
- Heart: 'M12 21 C 12 21 3 14.5 3 8.5 C 3 5.5 5.5 3 8.5 3 C 10.3 3 11.7 4 12 5.2 C 12.3 4 13.7 3 15.5 3 C 18.5 3 21 5.5 21 8.5 C 21 14.5 12 21 12 21 Z',
88
- Circle: 'M12 4 a8 8 0 1 0 0.0001 0 Z',
89
- Thumb: 'M2 11 h4 v10 h-4 z M7 11 l4 -8 c.5 -1 2 -1 2 0 l-1 5 h6 c1 0 2 1 1.7 2 l-2 8 c-.3 1 -1 1.6 -2 1.6 H7 z',
90
- };
91
- const clamp = (n, lo, hi) => Math.max(lo, Math.min(hi, n));
92
- function getRatingCellChromeCss(cell) {
93
- if (!cell || !hasCellBoxStyle(cell)) {
94
- return {};
95
- }
96
- return convertAdaptableStyleToCSS(cell);
97
- }
98
- const RatingPreview = ({ rating, value, }) => {
99
- const max = rating.Max ?? DEFAULT_MAX;
100
- const size = rating.Size ?? DEFAULT_SIZE;
101
- const gap = rating.Gap ?? DEFAULT_GAP;
102
- const icon = rating.Icon ?? DEFAULT_ICON;
103
- const filledColor = rating.FilledColor ?? DEFAULT_FILLED_COLOR;
104
- const emptyColor = rating.EmptyColor ?? DEFAULT_EMPTY_COLOR;
105
- const allowHalf = rating.AllowHalf ?? true;
106
- const previewValue = value ?? Math.max(1, Math.min(max, max * 0.7));
107
- const effective = allowHalf ? previewValue : Math.round(previewValue);
108
- const d = ICON_PATHS[icon];
109
- return (_jsxs("span", { style: {
110
- display: 'inline-flex',
111
- alignItems: 'center',
112
- gap: `${gap}px`,
113
- lineHeight: 1,
114
- }, "aria-hidden": "true", children: [Array.from({ length: max }).map((_, i) => {
115
- const fill = clamp(effective - i, 0, 1);
116
- const clipId = `ab-rating-preview-clip-${i}-${icon}-${size}`;
117
- return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", children: [_jsx("path", { d: d, fill: emptyColor }), fill > 0 && (_jsxs(_Fragment, { children: [_jsx("defs", { children: _jsx("clipPath", { id: clipId, children: _jsx("rect", { x: 0, y: 0, width: 24 * fill, height: 24 }) }) }), _jsx("path", { d: d, fill: filledColor, clipPath: `url(#${clipId})` })] }))] }, i));
118
- }), rating.ShowValue && (_jsx("span", { style: { marginLeft: 6, fontVariantNumeric: 'tabular-nums' }, children: previewValue }))] }));
119
- };
120
- // ---------------------------------------------------------------------------
121
- // Wizard summary
122
- // ---------------------------------------------------------------------------
123
108
  export const renderStyledColumnRatingSummary = (data) => {
124
109
  const rating = data.RatingStyle;
125
110
  if (!rating) {
126
111
  return _jsx(Tag, { children: "No Styling Defined" });
127
112
  }
128
- const max = rating.Max ?? DEFAULT_MAX;
129
- const icon = rating.Icon ?? DEFAULT_ICON;
130
- const cellTags = renderCellStyleSummaryTags(rating.Cell);
131
- const toolTipTokens = rating.ToolTipText ?? [];
132
- return (_jsxs(Flex, { alignItems: "center", className: "twa:gap-2 twa:flex-wrap", children: [_jsx(Box, { className: "twa:inline-flex twa:items-center twa:gap-2 twa:box-border", style: getRatingCellChromeCss(rating.Cell), children: _jsx(RatingPreview, { rating: rating }) }), _jsxs(Box, { children: ["Out of ", _jsx(Tag, { children: max })] }), _jsxs(Box, { children: ["Icon: ", _jsx(Tag, { children: icon })] }), toolTipTokens.length > 0 && (_jsxs(Box, { children: ["Tooltip: ", _jsx(Tag, { children: toolTipTokens.join(', ') })] })), cellTags && _jsxs(Box, { children: ["Cell: ", cellTags] })] }));
113
+ const items = buildStyledColumnRatingStyleSummaryStrings(rating, {
114
+ includeEmptyTooltip: true,
115
+ });
116
+ return (_jsx(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: items.map((item) => (_jsx(Tag, { children: item }, item))) }));
133
117
  };
134
- // ---------------------------------------------------------------------------
135
- // Wizard validation
136
- // ---------------------------------------------------------------------------
137
118
  export const isValidRatingStyle = (data) => {
138
119
  const rating = data.RatingStyle;
139
120
  if (!rating) {
@@ -167,8 +148,7 @@ export const StyledColumnWizardRatingSection = (props) => {
167
148
  : current.filter((t) => t !== token);
168
149
  update({ ToolTipText: next });
169
150
  };
170
- const previewCellChrome = React.useMemo(() => getRatingCellChromeCss(rating.Cell), [rating.Cell]);
171
- return (_jsxs(Box, { children: [_jsxs(Flex, { alignItems: "center", className: "twa:mb-3 twa:p-3 twa:rounded-standard twa:border twa:border-border twa:gap-3", children: [_jsx(Box, { className: "twa:text-3 twa:font-medium", children: "Preview:" }), _jsx(Box, { className: "twa:inline-flex twa:items-center twa:box-border", style: previewCellChrome, children: _jsx(RatingPreview, { rating: rating }) }), _jsxs(Box, { className: "twa:text-2 twa:opacity-70", children: ["(sample value ", (rating.Max ?? DEFAULT_MAX) * 0.7, ")"] })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsx(Card.Title, { children: "Icon" }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Max:", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(Input, { type: "number", min: 1, step: 1, value: rating.Max ?? '', placeholder: String(DEFAULT_MAX), style: { width: 80 }, onChange: (event) => {
151
+ return (_jsxs(Box, { children: [_jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsx(Card.Title, { children: "Icon" }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Max:", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(Input, { type: "number", min: 1, step: 1, value: rating.Max ?? '', placeholder: String(DEFAULT_RATING_MAX), style: { width: 80 }, onChange: (event) => {
172
152
  const raw = event.target.value;
173
153
  if (raw === '' || raw == null) {
174
154
  update({ Max: undefined });
@@ -178,7 +158,7 @@ export const StyledColumnWizardRatingSection = (props) => {
178
158
  update({
179
159
  Max: Number.isFinite(parsed) && parsed >= 1 ? Math.floor(parsed) : undefined,
180
160
  });
181
- } }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Icon count and rating cap (no auto scaling is applied)" })] }) }), _jsx(FormRow, { label: "Icon:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: rating.Icon ?? DEFAULT_ICON, onValueChange: (v) => update({ Icon: v }), items: ICON_CHOICES }) }) }), _jsx(FormRow, { label: "Filled Colour:", children: _jsx(ColorPicker, { disabled: disabled, api: api, value: getDisplayedFilledColor(rating), onChange: (c) => update({ FilledColor: c }) }) }), _jsx(FormRow, { label: "Empty Colour:", children: _jsx(ColorPicker, { disabled: disabled, api: api, value: getDisplayedEmptyColor(rating), onChange: (c) => update({ EmptyColor: c }) }) }), _jsx(FormRow, { label: "Icon Size (px):", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(Input, { type: "number", min: 4, step: 1, value: rating.Size ?? '', placeholder: String(DEFAULT_SIZE), style: { width: 80 }, onChange: (event) => {
161
+ } }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Icon count and rating cap (no auto scaling is applied)" })] }) }), _jsx(FormRow, { label: "Icon:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: rating.Icon ?? DEFAULT_RATING_ICON, onValueChange: (v) => update({ Icon: v }), items: ICON_CHOICES }) }) }), _jsx(FormRow, { label: "Filled Colour:", children: _jsx(ColorPicker, { disabled: disabled, api: api, value: getDisplayedFilledColor(rating), onChange: (c) => update({ FilledColor: c }) }) }), _jsx(FormRow, { label: "Empty Colour:", children: _jsx(ColorPicker, { disabled: disabled, api: api, value: getDisplayedEmptyColor(rating), onChange: (c) => update({ EmptyColor: c }) }) }), _jsx(FormRow, { label: "Icon Size (px):", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(Input, { type: "number", min: 4, step: 1, value: rating.Size ?? '', placeholder: String(DEFAULT_RATING_SIZE), style: { width: 80 }, onChange: (event) => {
182
162
  const raw = event.target.value;
183
163
  if (raw === '' || raw == null) {
184
164
  update({ Size: undefined });
@@ -188,7 +168,7 @@ export const StyledColumnWizardRatingSection = (props) => {
188
168
  update({
189
169
  Size: Number.isFinite(parsed) && parsed >= 4 ? parsed : undefined,
190
170
  });
191
- } }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Square pixel size of each icon" })] }) }), _jsx(FormRow, { label: "Icon Gap (px):", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(Input, { type: "number", min: 0, step: 1, value: rating.Gap ?? '', placeholder: String(DEFAULT_GAP), style: { width: 80 }, onChange: (event) => {
171
+ } }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Square pixel size of each icon" })] }) }), _jsx(FormRow, { label: "Icon Gap (px):", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(Input, { type: "number", min: 0, step: 1, value: rating.Gap ?? '', placeholder: String(DEFAULT_RATING_GAP), style: { width: 80 }, onChange: (event) => {
192
172
  const raw = event.target.value;
193
173
  if (raw === '' || raw == null) {
194
174
  update({ Gap: undefined });
@@ -198,7 +178,7 @@ export const StyledColumnWizardRatingSection = (props) => {
198
178
  update({
199
179
  Gap: Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined,
200
180
  });
201
- } }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Pixel space between adjacent icons" })] }) }), _jsx(FormRow, { label: "Allow Half Icons:", children: _jsx(CheckBox, { disabled: disabled, className: "twa:ml-2", checked: rating.AllowHalf ?? true, onChange: (checked) => update({ AllowHalf: checked }), children: "Render fractional values as a partial icon (e.g. 3.5 \u2192 \u2605\u2605\u2605\u00BD\u2606)" }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsx(Card.Title, { children: "Text" }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Show Value:", children: _jsx(CheckBox, { disabled: disabled, className: "twa:ml-2", checked: rating.ShowValue ?? false, onChange: (checked) => update({ ShowValue: checked }), children: "Display the numeric value beside the icons" }) }), _jsx(FormRow, { label: "Tooltip:", children: _jsxs(Flex, { flexDirection: "column", className: "twa:gap-1 twa:ml-2", children: [_jsx(CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('CellValue') ?? false, onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), _jsx(CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('PercentageValue') ?? false, onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percentage Value (value \u00F7 Max)" })] }) })] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[500px]", children: "Optional Cell Style properties overrides Format Column properties)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnCellStyleEditor, { api: api, disabled: disabled, value: rating.Cell, onChange: (next) => {
181
+ } }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Pixel space between adjacent icons" })] }) }), _jsx(FormRow, { label: "Allow Half Icons:", children: _jsx(CheckBox, { disabled: disabled, className: "twa:ml-2", checked: rating.AllowHalf ?? true, onChange: (checked) => update({ AllowHalf: checked }), children: "Render fractional values as a partial icon (e.g. 3.5 \u2192 \u2605\u2605\u2605\u00BD\u2606)" }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsx(Card.Title, { children: "Text" }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Show Value:", children: _jsx(CheckBox, { disabled: disabled, className: "twa:ml-2", checked: rating.ShowValue ?? false, onChange: (checked) => update({ ShowValue: checked }), children: "Display the numeric value beside the icons" }) }), _jsx(FormRow, { label: "Tooltip:", children: _jsxs(Flex, { flexDirection: "column", className: "twa:gap-1 twa:ml-2", children: [_jsx(CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('CellValue') ?? false, onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), _jsx(CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('PercentageValue') ?? false, onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percentage Value (value \u00F7 Max)" })] }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[500px]", children: "Optional Cell Style properties overrides Format Column properties)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnCellStyleEditor, { api: api, disabled: disabled, value: rating.Cell, onChange: (next) => {
202
182
  if (next) {
203
183
  update({ Cell: next });
204
184
  }
@@ -207,5 +187,5 @@ export const StyledColumnWizardRatingSection = (props) => {
207
187
  delete cleaned.Cell;
208
188
  props.onChange({ ...data, RatingStyle: cleaned });
209
189
  }
210
- } }) })] })] }));
190
+ } }) })] }), _jsx(StyledColumnRatingPreviewCard, { data: data })] }));
211
191
  };
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { BulletChartStyle } from '../../../../../AdaptableState/StyledColumnState';
3
+ export declare const BulletRangesSummaryPreview: React.FunctionComponent<{
4
+ bulletStyle: BulletChartStyle;
5
+ }>;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Flex } from '../../../../../components/Flex';
3
+ import { Tag } from '../../../../../components/Tag';
4
+ import { getVariableColor } from '../../../../../Utilities/Helpers/StyleHelper';
5
+ const stripClassName = 'twa:h-6 twa:w-[128px] twa:rounded twa:overflow-hidden twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]';
6
+ export const BulletRangesSummaryPreview = ({ bulletStyle }) => {
7
+ const ranges = bulletStyle.CellRanges ?? [];
8
+ if (!ranges.length) {
9
+ return _jsx(Tag, { children: "No bands defined" });
10
+ }
11
+ let postfix = '';
12
+ if (bulletStyle.RangeValueType === 'Percentage') {
13
+ postfix = '%';
14
+ }
15
+ return (_jsx(Flex, { flexDirection: "column", className: "twa:gap-2", children: ranges.map((range, i) => (_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Tag, { children: [range.Min, postfix, " \u2192 ", range.Max, postfix] }), _jsx(Box, { className: stripClassName, style: { background: getVariableColor(range.Color) } })] }, i))) }));
16
+ };
@@ -1,8 +1,9 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import tinycolor from 'tinycolor2';
3
3
  import { Box, Flex } from '../../../../../components/Flex';
4
+ import { Tag } from '../../../../../components/Tag';
4
5
  import { getVariableColor } from '../../../../../Utilities/Helpers/StyleHelper';
5
- import { DEFAULT_GRADIENT_MAX_ALPHA, DEFAULT_GRADIENT_MIN_ALPHA, } from '../../../../../Utilities/Helpers/StyledColumnGradientHelper';
6
+ import { DEFAULT_GRADIENT_MAX_ALPHA, DEFAULT_GRADIENT_MIN_ALPHA, isDivergingZeroCellRanges, } from '../../../../../Utilities/Helpers/StyledColumnGradientHelper';
6
7
  function clamp01(n) {
7
8
  if (Number.isNaN(n)) {
8
9
  return 0;
@@ -19,16 +20,9 @@ export function gradientRangeStripCss(color, reverseGradient, minAlpha, maxAlpha
19
20
  const c2 = tinycolor(prepared).setAlpha(rightA).toRgbString();
20
21
  return `linear-gradient(to right, ${c1}, ${c2})`;
21
22
  }
22
- function isDivergingZeroPair(ranges) {
23
- if (!ranges || ranges.length !== 2) {
24
- return false;
25
- }
26
- const [a, b] = ranges;
27
- return a.Max === 0 && b.Min === 0;
28
- }
29
23
  const stripClassName = 'twa:h-6 twa:w-[128px] twa:rounded twa:overflow-hidden twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]';
30
24
  function zeroCentredSplitPreview(negativeColor, positiveColor, postfix, minA, maxA) {
31
- return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2", children: [_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Box, { className: "twa:text-sm", children: ["Col-Min", postfix, " \u2192 0", postfix] }), _jsx(Box, { className: "twa:text-xs twa:opacity-50", children: "|" }), _jsxs(Box, { className: "twa:text-sm", children: ["0", postfix, " \u2192 Col-Max", postfix] })] }), _jsxs(Flex, { className: `${stripClassName} twa:w-[200px]`, children: [_jsx(Box, { className: "twa:flex-1", style: {
25
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2", children: [_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Tag, { children: ["Col-Min", postfix, " \u2192 0", postfix] }), _jsxs(Tag, { children: ["0", postfix, " \u2192 Col-Max", postfix] })] }), _jsxs(Flex, { className: `${stripClassName} twa:w-[200px]`, children: [_jsx(Box, { className: "twa:flex-1", style: {
32
26
  background: gradientRangeStripCss(negativeColor, true, minA, maxA),
33
27
  } }), _jsx(Box, { className: "twa:flex-1", style: {
34
28
  background: gradientRangeStripCss(positiveColor, false, minA, maxA),
@@ -47,15 +41,15 @@ export const GradientRangesSummaryPreview = (props) => {
47
41
  return zeroCentredSplitPreview(props.zeroCentred.NegativeColor, props.zeroCentred.PositiveColor, postfix, minA, maxA);
48
42
  }
49
43
  const ranges = props.ranges ?? [];
50
- if (isDivergingZeroPair(ranges)) {
44
+ if (isDivergingZeroCellRanges(ranges)) {
51
45
  const [r0, r1] = ranges;
52
- return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2", children: [_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Box, { className: "twa:text-sm", children: [r0.Min, postfix, " \u2192 ", r0.Max, postfix] }), _jsx(Box, { className: "twa:text-xs twa:opacity-50", children: "|" }), _jsxs(Box, { className: "twa:text-sm", children: [r1.Min, postfix, " \u2192 ", r1.Max, postfix] })] }), _jsxs(Flex, { className: `${stripClassName} twa:w-[200px]`, children: [_jsx(Box, { className: "twa:flex-1", style: {
46
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2", children: [_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Tag, { children: [r0.Min, postfix, " \u2192 ", r0.Max, postfix] }), _jsxs(Tag, { children: [r1.Min, postfix, " \u2192 ", r1.Max, postfix] })] }), _jsxs(Flex, { className: `${stripClassName} twa:w-[200px]`, children: [_jsx(Box, { className: "twa:flex-1", style: {
53
47
  background: gradientRangeStripCss(r0.Color, !!r0.ReverseGradient, minA, maxA),
54
48
  } }), _jsx(Box, { className: "twa:flex-1", style: {
55
49
  background: gradientRangeStripCss(r1.Color, !!r1.ReverseGradient, minA, maxA),
56
50
  } })] })] }));
57
51
  }
58
- return (_jsx(Flex, { flexDirection: "column", className: "twa:gap-2", children: ranges.map((r, i) => (_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Box, { className: "twa:text-sm twa:min-w-[120px]", children: [r.Min, postfix, " to ", r.Max, postfix] }), _jsx(Box, { className: stripClassName, style: {
52
+ return (_jsx(Flex, { flexDirection: "column", className: "twa:gap-2", children: ranges.map((r, i) => (_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Tag, { children: [r.Min, postfix, " \u2192 ", r.Max, postfix] }), _jsx(Box, { className: stripClassName, style: {
59
53
  background: gradientRangeStripCss(r.Color, !!r.ReverseGradient, minA, maxA),
60
54
  } })] }, i))) }));
61
55
  };
@@ -65,7 +59,7 @@ export const GradientColumnComparisonSummaryPreview = (props) => {
65
59
  const fmt = (v) => isNaN(Number(v))
66
60
  ? `[${props.api.columnApi.getFriendlyNameForColumnId(String(v))}]`
67
61
  : v;
68
- return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2", children: [_jsxs(Box, { className: "twa:text-sm", children: ["Min: ", fmt(props.columnComparison.MinValue), " \u2014 Max:", ' ', fmt(props.columnComparison.MaxValue)] }), _jsx(Box, { className: `${stripClassName} twa:w-[200px]`, style: {
62
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2", children: [_jsxs(Tag, { children: ["Min: ", fmt(props.columnComparison.MinValue), " \u2014 Max: ", fmt(props.columnComparison.MaxValue)] }), _jsx(Box, { className: `${stripClassName} twa:w-[200px]`, style: {
69
63
  background: gradientRangeStripCss(props.columnComparison.Color, false, minA, maxA),
70
64
  } })] }));
71
65
  };
@@ -2,12 +2,12 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useAdaptable } from '../../../../AdaptableContext';
3
3
  import { PercentBarStylePreview } from './PercentBarStylePreview';
4
4
  import { Box, Flex } from '../../../../../components/Flex';
5
+ import { Tag } from '../../../../../components/Tag';
5
6
  export const PercentBarColumnComparisonPreview = (props) => {
6
7
  const { api } = useAdaptable();
7
8
  const columnComparison = props.percentBarStyle.ColumnComparison;
8
- return (_jsxs(Flex, { alignItems: "center", className: "twa:mr-3", children: [_jsxs(Box, { className: "twa:basis-[120px] twa:mr-3", children: [isNaN(Number(columnComparison.MinValue))
9
- ? '[' + api.columnApi.getFriendlyNameForColumnId(String(columnComparison.MinValue)) + ']'
10
- : columnComparison.MinValue, ' ', "to", ' ', isNaN(Number(columnComparison.MaxValue))
11
- ? '[' + api.columnApi.getFriendlyNameForColumnId(String(columnComparison.MaxValue)) + ']'
12
- : columnComparison.MaxValue, ' '] }), _jsx(PercentBarStylePreview, { backgroundColor: columnComparison.Color, barBackgroundColor: props.percentBarStyle.BackColor, cellText: props.percentBarStyle.CellText, toolTipText: props.percentBarStyle.ToolTipText })] }));
9
+ const fmt = (v) => isNaN(Number(v))
10
+ ? `[${api.columnApi.getFriendlyNameForColumnId(String(v))}]`
11
+ : v;
12
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2", children: [_jsxs(Tag, { children: ["Min: ", fmt(columnComparison.MinValue), " \u2014 Max: ", fmt(columnComparison.MaxValue)] }), _jsx(Box, { className: "twa:max-w-[200px]", children: _jsx(PercentBarStylePreview, { backgroundColor: props.percentBarStyle.BackColor, barBackgroundColor: columnComparison.Color }) })] }));
13
13
  };
@@ -1,10 +1,11 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PercentBarStylePreview } from './PercentBarStylePreview';
3
- import { Flex } from '../../../../../components/Flex';
3
+ import { Box, Flex } from '../../../../../components/Flex';
4
+ import { Tag } from '../../../../../components/Tag';
4
5
  export const PercentBarPreview = (props) => {
5
6
  let postfix = '';
6
7
  if (props.percentBarStyle.RangeValueType === 'Percentage') {
7
8
  postfix = '%';
8
9
  }
9
- return (_jsx(_Fragment, { children: props.percentBarStyle.CellRanges.map((range, i) => (_jsxs(Flex, { alignItems: "stretch", className: "twa:mr-3 twa:mb-2", children: [_jsxs(Flex, { className: "twa:basis-[120px] twa:mr-3", alignItems: "center", children: [range.Min, postfix, " to ", range.Max, postfix] }), _jsx(PercentBarStylePreview, { backgroundColor: props.percentBarStyle.BackColor, barBackgroundColor: range.Color, cellText: props.percentBarStyle.CellText, toolTipText: props.percentBarStyle.ToolTipText })] }, i))) }));
10
+ return (_jsx(Flex, { flexDirection: "column", className: "twa:gap-2", children: props.percentBarStyle.CellRanges.map((range, i) => (_jsxs(Flex, { alignItems: "stretch", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Tag, { children: [range.Min, postfix, " \u2192 ", range.Max, postfix] }), _jsx(Box, { className: "twa:flex-1 twa:min-w-[120px]", children: _jsx(PercentBarStylePreview, { backgroundColor: props.percentBarStyle.BackColor, barBackgroundColor: range.Color }) })] }, i))) }));
10
11
  };
@@ -1,8 +1,9 @@
1
1
  import * as React from 'react';
2
- import { CellTextOptions } from '../../../../../types';
2
+ /**
3
+ * Compact range-colour strip for Percent Bar range summaries.
4
+ * Cell text / origin / font are shown in `StyledColumnPercentBarPreview`.
5
+ */
3
6
  export declare const PercentBarStylePreview: React.FunctionComponent<{
4
- backgroundColor: string;
7
+ backgroundColor?: string | null;
5
8
  barBackgroundColor?: string;
6
- cellText?: CellTextOptions;
7
- toolTipText?: CellTextOptions;
8
9
  }>;