@adaptabletools/adaptable 23.0.0-canary.4 → 23.0.0-canary.6

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 (250) hide show
  1. package/index.css +117 -62
  2. package/package.json +9 -4
  3. package/src/AdaptableOptions/EditOptions.d.ts +2 -2
  4. package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
  5. package/src/AdaptableState/Common/AggregationColumns.js +27 -2
  6. package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
  7. package/src/AdaptableState/Common/Enums.d.ts +5 -5
  8. package/src/AdaptableState/Common/Enums.js +4 -4
  9. package/src/AdaptableState/PlusMinusState.d.ts +3 -3
  10. package/src/AdaptableState/ShortcutState.d.ts +2 -6
  11. package/src/AdaptableState/StyledColumnState.d.ts +3 -5
  12. package/src/AdaptableState/ThemeState.d.ts +33 -28
  13. package/src/Api/EventApi.d.ts +14 -1
  14. package/src/Api/Events/ThemeChanged.d.ts +6 -0
  15. package/src/Api/Events/ThemeSelected.d.ts +11 -0
  16. package/src/Api/Events/ThemeSelected.js +1 -0
  17. package/src/Api/Implementation/EventApiImpl.js +4 -0
  18. package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -2
  19. package/src/Api/Implementation/LayoutApiImpl.js +0 -14
  20. package/src/Api/Implementation/LayoutHelpers.d.ts +2 -0
  21. package/src/Api/Implementation/LayoutHelpers.js +17 -7
  22. package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
  23. package/src/Api/Implementation/ThemeApiImpl.js +19 -15
  24. package/src/Api/Internal/EventInternalApi.d.ts +2 -0
  25. package/src/Api/Internal/EventInternalApi.js +8 -1
  26. package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
  27. package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
  28. package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
  29. package/src/Api/Internal/ThemeInternalApi.js +0 -10
  30. package/src/Api/LayoutApi.d.ts +1 -8
  31. package/src/Api/ThemeApi.d.ts +6 -2
  32. package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
  33. package/src/Strategy/FormatColumnModule.js +14 -7
  34. package/src/Strategy/LayoutModule.js +13 -8
  35. package/src/Strategy/StyledColumnModule.js +64 -36
  36. package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
  37. package/src/Utilities/Constants/ReduxConstants.js +1 -14
  38. package/src/Utilities/Helpers/FormatHelper.js +20 -1
  39. package/src/Utilities/Helpers/SparklineOptionsHelper.d.ts +7 -0
  40. package/src/Utilities/Helpers/SparklineOptionsHelper.js +65 -0
  41. package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
  42. package/src/Utilities/Helpers/StyledColumnGradientHelper.js +204 -0
  43. package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
  44. package/src/Utilities/Helpers/ThemeHelpers.js +38 -0
  45. package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
  46. package/src/Utilities/Helpers/percentBarPreviewHelper.js +143 -0
  47. package/src/Utilities/ObjectFactory.d.ts +1 -3
  48. package/src/Utilities/ObjectFactory.js +0 -8
  49. package/src/Utilities/Services/ThemeService.js +1 -1
  50. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
  51. package/src/View/Alert/Wizard/AlertButtonsEditor.js +114 -103
  52. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +13 -14
  53. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +55 -55
  54. package/src/View/Alert/Wizard/AlertRulesWizardSection.js +3 -2
  55. package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +2 -2
  56. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +31 -39
  57. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +3 -4
  58. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
  59. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +30 -17
  60. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
  61. package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +3 -3
  62. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  63. package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
  64. package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
  65. package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +32 -41
  66. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
  67. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
  68. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +21 -0
  69. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
  70. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +10 -7
  71. package/src/View/Comments/CommentsEditor.js +1 -1
  72. package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +0 -1
  73. package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +3 -1
  74. package/src/View/Components/ModuleProfile.js +1 -1
  75. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
  76. package/src/View/Components/Popups/WindowPopups/windowFactory.js +0 -1
  77. package/src/View/Components/RangesComponent.d.ts +7 -2
  78. package/src/View/Components/RangesComponent.js +94 -22
  79. package/src/View/Components/StyleComponent.d.ts +1 -0
  80. package/src/View/Components/StyleComponent.js +1 -1
  81. package/src/View/Components/ValueSelector/index.js +70 -57
  82. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
  83. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
  84. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  85. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
  86. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +6 -4
  87. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +3 -2
  88. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +5 -15
  89. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -26
  90. package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -13
  91. package/src/View/Export/Wizard/ReportRowsWizardSection.js +20 -22
  92. package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
  93. package/src/View/Export/Wizard/ScheduledReportSettings.js +13 -13
  94. package/src/View/Export/Wizard/ScheduledReportWizard.js +4 -5
  95. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
  96. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +21 -22
  97. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
  98. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +21 -5
  99. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
  100. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
  101. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +117 -12
  102. package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
  103. package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +66 -0
  104. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
  105. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +30 -0
  106. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +13 -8
  107. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
  108. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
  109. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +62 -13
  110. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +5 -3
  111. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
  112. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +15 -0
  113. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
  114. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +53 -0
  115. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
  116. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +33 -68
  117. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +15 -11
  118. package/src/View/Layout/TransposedPopup.js +2 -2
  119. package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
  120. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
  121. package/src/View/Layout/Wizard/sections/AggregationsSection.js +115 -26
  122. package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
  123. package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
  124. package/src/View/Layout/Wizard/sections/GridFilterSection.js +11 -11
  125. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
  126. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -52
  127. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
  128. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
  129. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
  130. package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
  131. package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
  132. package/src/View/Layout/Wizard/sections/SettingsSection.js +4 -5
  133. package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
  134. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  135. package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +9 -14
  136. package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
  137. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
  138. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +43 -13
  139. package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +11 -18
  140. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
  141. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +6 -22
  142. package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
  143. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
  144. package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +11 -18
  145. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +17 -6
  146. package/src/View/Shortcut/Wizard/ShortcutWizard.js +3 -3
  147. package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
  148. package/src/View/Shortcut/shortcutOperations.js +28 -0
  149. package/src/View/SpecialColumnSettingsWizardStep.js +9 -8
  150. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
  151. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +24 -15
  152. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
  153. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +96 -16
  154. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
  155. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +45 -24
  156. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
  157. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +108 -33
  158. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +21 -13
  159. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
  160. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +121 -23
  161. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
  162. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +34 -11
  163. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
  164. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +86 -12
  165. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
  166. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +121 -34
  167. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
  168. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -75
  169. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
  170. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +16 -0
  171. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +7 -13
  172. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
  173. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +4 -3
  174. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
  175. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +12 -14
  176. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
  177. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +16 -0
  178. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
  179. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +31 -3
  180. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
  181. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +58 -0
  182. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
  183. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +30 -0
  184. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
  185. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +91 -0
  186. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
  187. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +52 -0
  188. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
  189. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +53 -0
  190. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
  191. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +58 -0
  192. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
  193. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +126 -0
  194. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
  195. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
  196. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +52 -29
  197. package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
  198. package/src/View/Theme/ThemePopup.d.ts +2 -14
  199. package/src/View/Theme/ThemePopup.js +1 -36
  200. package/src/View/UIHelper.js +1 -1
  201. package/src/View/Wizard/OnePageAdaptableWizard.js +7 -21
  202. package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
  203. package/src/agGrid/AdaptableAgGrid.js +36 -26
  204. package/src/agGrid/AgGridAdapter.d.ts +1 -1
  205. package/src/agGrid/AgGridAdapter.js +27 -17
  206. package/src/agGrid/AgGridColumnAdapter.js +9 -15
  207. package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
  208. package/src/agGrid/AgGridMenuAdapter.js +20 -37
  209. package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
  210. package/src/agGrid/buildValueAggregationMenuItem.js +111 -0
  211. package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
  212. package/src/agGrid/cellRenderers/IconRenderer.js +43 -15
  213. package/src/agGrid/createAgGridIcon.d.ts +10 -0
  214. package/src/agGrid/createAgGridIcon.js +16 -0
  215. package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
  216. package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
  217. package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
  218. package/src/components/Input/NumberInput.js +1 -1
  219. package/src/components/Panel/index.js +1 -1
  220. package/src/components/SimpleButton/index.js +4 -4
  221. package/src/components/Toggle/Toggle.js +1 -1
  222. package/src/components/Toggle/ToggleGroup.js +1 -1
  223. package/src/env.js +2 -2
  224. package/src/layout-manager/src/index.js +2 -9
  225. package/src/metamodel/adaptable.metamodel.d.ts +39 -29
  226. package/src/metamodel/adaptable.metamodel.js +1 -1
  227. package/src/types.d.ts +5 -4
  228. package/themes/dark.css +1 -68
  229. package/themes/light.css +1 -5
  230. package/tsconfig.esm.tsbuildinfo +1 -1
  231. package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
  232. package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -63
  233. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
  234. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -55
  235. package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
  236. package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -137
  237. package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
  238. package/src/Aggregation/parameterizedAggregationHeader.js +0 -60
  239. package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
  240. package/src/Aggregation/parameterizedAggregationHelpers.js +0 -111
  241. package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
  242. package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -66
  243. package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
  244. package/src/Aggregation/validateParameterizedAggregations.js +0 -20
  245. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
  246. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -43
  247. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
  248. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -28
  249. package/src/View/Theme/VariantSelector.d.ts +0 -8
  250. package/src/View/Theme/VariantSelector.js +0 -20
@@ -8,15 +8,40 @@ import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableW
8
8
  import { Box, Flex } from '../../../components/Flex';
9
9
  import { NumberInput } from '../../../components/Input/NumberInput';
10
10
  import { DEFAULT_GRADIENT_MAX_ALPHA, DEFAULT_GRADIENT_MIN_ALPHA, } from '../../../Utilities/Helpers/StyledColumnGradientHelper';
11
- import { renderFontStyleSummaryTags, StyledColumnFontStyleEditor, } from './StyledColumnSliceStyleEditors';
11
+ import { getCellFontStyleSummaryItems, StyledColumnFontStyleEditor, } from './StyledColumnSliceStyleEditors';
12
12
  import { Card } from '../../../components/Card';
13
+ import { StyledColumnGradientPreviewCard } from './StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview';
13
14
  const STYLE_FORM_SIZES = ['200px', '1fr'];
14
- function formatToolTipText(opts) {
15
- if (!opts || opts.length === 0) {
16
- return '';
17
- }
18
- return opts.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value')).join(' + ');
15
+ function formatGradientToolTipSummary(opts) {
16
+ return opts
17
+ .map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value'))
18
+ .join(' + ');
19
19
  }
20
+ const buildStyledColumnGradientStyleSummaryStrings = (gs, options) => {
21
+ const minA = gs.MinAlpha ?? DEFAULT_GRADIENT_MIN_ALPHA;
22
+ const maxA = gs.MaxAlpha ?? DEFAULT_GRADIENT_MAX_ALPHA;
23
+ const items = [`Alpha: ${minA} → ${maxA}`];
24
+ if (gs.AutoContrastText) {
25
+ items.push('Auto Contrast: On');
26
+ }
27
+ if (gs.ToolTipText?.length) {
28
+ items.push(`Tooltip: ${formatGradientToolTipSummary(gs.ToolTipText)}`);
29
+ }
30
+ else if (options.includeEmptyTooltip) {
31
+ items.push('Tooltip: No Tooltip');
32
+ }
33
+ getCellFontStyleSummaryItems(gs.Font).forEach(({ label, value }) => {
34
+ items.push(`${label}: ${value}`);
35
+ });
36
+ return items;
37
+ };
38
+ export const getStyledColumnGradientStyleViewValues = (data) => {
39
+ const gs = data.GradientStyle;
40
+ if (!gs) {
41
+ return [];
42
+ }
43
+ return buildStyledColumnGradientStyleSummaryStrings(gs, { includeEmptyTooltip: false });
44
+ };
20
45
  /**
21
46
  * Summary of Gradient-only style options (alpha bounds, auto-contrast, tooltip).
22
47
  */
@@ -25,10 +50,8 @@ export const renderStyledColumnGradientStyleSummary = (data) => {
25
50
  if (!gs) {
26
51
  return _jsx(Tag, { children: "No Styling Defined" });
27
52
  }
28
- const minA = gs.MinAlpha ?? DEFAULT_GRADIENT_MIN_ALPHA;
29
- const maxA = gs.MaxAlpha ?? DEFAULT_GRADIENT_MAX_ALPHA;
30
- const fontTags = renderFontStyleSummaryTags(gs.Font);
31
- return (_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Box, { children: ["Alpha: ", _jsx(Tag, { children: minA }), " \u2192 ", _jsx(Tag, { children: maxA })] }), gs.AutoContrastText && (_jsxs(Box, { children: ["Text: ", _jsx(Tag, { children: "Auto contrast" })] })), _jsxs(Box, { children: ["Tooltip: ", _jsx(Tag, { children: formatToolTipText(gs.ToolTipText) })] }), fontTags && _jsxs(Box, { children: ["Font: ", fontTags] })] }));
53
+ const items = buildStyledColumnGradientStyleSummaryStrings(gs, { includeEmptyTooltip: true });
54
+ return (_jsx(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: items.map((item) => (_jsx(Tag, { children: item }, item))) }));
32
55
  };
33
56
  export const StyledColumnWizardGradientSection = (props) => {
34
57
  const { data, api } = useOnePageAdaptableWizardContext();
@@ -86,5 +109,5 @@ export const StyledColumnWizardGradientSection = (props) => {
86
109
  else {
87
110
  patchGradient({ AutoContrastText: true });
88
111
  }
89
- }, children: "Make text readable on tinted backgrounds" }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[600px]", children: "Set Tooltip properties" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: _jsx(FormRow, { label: "Tooltip:", children: _jsxs(Box, { className: "twa:ml-2", children: [_jsx(CheckBox, { disabled: disabled, checked: gs.ToolTipText?.includes('CellValue'), onChange: (checked) => onToolTipTextChanged('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { disabled: disabled, className: "twa:ml-3", checked: gs.ToolTipText?.includes('PercentageValue'), onChange: (checked) => onToolTipTextChanged('PercentageValue', checked), children: "Percent along scale" })] }) }) }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Font" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[480px]", children: "Optional font properties (takes precedence over Format Column)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnFontStyleEditor, { api: api, disabled: disabled, value: gs.Font, onChange: onFontChange }) })] }), !data.ColumnId && (_jsx(ErrorBox, { className: "twa:mt-2", children: "Select a column before changing Gradient style." }))] }));
112
+ }, children: "Make text readable on tinted backgrounds" }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[600px]", children: "Set Tooltip properties" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: _jsx(FormRow, { label: "Tooltip:", children: _jsxs(Box, { className: "twa:ml-2", children: [_jsx(CheckBox, { disabled: disabled, checked: gs.ToolTipText?.includes('CellValue'), onChange: (checked) => onToolTipTextChanged('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { disabled: disabled, className: "twa:ml-3", checked: gs.ToolTipText?.includes('PercentageValue'), onChange: (checked) => onToolTipTextChanged('PercentageValue', checked), children: "Percent along scale" })] }) }) }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Font" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[480px]", children: "Optional font properties (takes precedence over Format Column)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnFontStyleEditor, { api: api, disabled: disabled, value: gs.Font, onChange: onFontChange }) })] }), _jsx(StyledColumnGradientPreviewCard, { data: data }), !data.ColumnId && (_jsx(ErrorBox, { className: "twa:mt-2", children: "Select a column before changing Gradient style." }))] }));
90
113
  };
@@ -1,7 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { StyledColumn } from '../../../AdaptableState/StyledColumnState';
3
+ export declare const getStyledColumnIconMappingsViewValues: (data: StyledColumn) => string[];
4
+ export declare const getStyledColumnIconStyleViewValues: (data: StyledColumn) => string[];
3
5
  /** Mappings step summary. */
4
6
  export declare const renderStyledColumnIconMappingsSummary: (data: StyledColumn) => React.JSX.Element;
7
+ export declare const StyledColumnIconMappingsView: React.FunctionComponent<React.PropsWithChildren<{
8
+ data: StyledColumn;
9
+ }>>;
5
10
  /** Style step summary (size, text, tooltip, font / cell). */
6
11
  export declare const renderStyledColumnIconStyleSummary: (data: StyledColumn) => React.JSX.Element;
7
12
  /**
@@ -12,9 +12,10 @@ import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableW
12
12
  import { AdaptableIconSelector } from '../../Components/AdaptableIconSelector';
13
13
  import { AdaptableIconComponent } from '../../Components/AdaptableIconComponent';
14
14
  import { ICON_STYLE_PRESET_DESCRIPTIONS, ICON_STYLE_PRESET_LABELS, getIconStylePresetMappings, } from '../../../Utilities/Helpers/IconStylePresets';
15
- import { resolveEffectiveIconStyleMappings } from '../../../agGrid/cellRenderers/IconRenderer';
15
+ import { resolveEffectiveIconStyleMappings, resolveIconStyleMappingsForSummaryPreview } from '../../../agGrid/cellRenderers/IconRenderer';
16
16
  import { Card } from '../../../components/Card';
17
- import { StyledColumnCellStyleEditor, StyledColumnFontStyleEditor, } from './StyledColumnSliceStyleEditors';
17
+ import { getCellBoxStyleSummaryItems, getCellFontStyleSummaryItems, StyledColumnCellStyleEditor, StyledColumnFontStyleEditor, } from './StyledColumnSliceStyleEditors';
18
+ import { StyledColumnIconPreviewCard } from './StyledColumnWizardStyleSection/Components/StyledColumnIconPreview';
18
19
  const STYLE_FORM_SIZES = ['200px', '1fr'];
19
20
  const detectIconKind = (spec) => {
20
21
  if (typeof spec === 'string')
@@ -37,37 +38,110 @@ const previewIcon = (spec) => {
37
38
  // ---------------------------------------------------------------------------
38
39
  // Summary helpers (used by the wizard step header + Styled Columns list)
39
40
  // ---------------------------------------------------------------------------
41
+ const ICON_MAPPINGS_PREVIEW_CHIP_LIMIT = 6;
40
42
  const previewMapping = (mapping, index) => {
41
- return (_jsxs(Flex, { alignItems: "center", className: "twa:gap-1 twa:px-1.5 twa:py-0.5 twa:rounded twa:bg-[var(--ab-color-primary)] twa:text-[var(--ab-color-primarytext)]", children: [_jsx(Box, { children: previewIcon(mapping.Icon) }), _jsx(Box, { className: "twa:text-xs twa:opacity-90", children: String(mapping.Key) })] }, index));
43
+ return (_jsxs(Flex, { alignItems: "center", className: "twa:gap-1 twa:px-1.5 twa:py-0.5 twa:rounded twa:bg-[var(--ab-color-primary)] twa:text-[var(--ab-color-primarytext)]", children: [_jsx(Box, { children: previewIcon(mapping.Icon) }), _jsx(Box, { className: "twa:text-xs twa:opacity-90", children: String(mapping.Key) })] }, `${String(mapping.Key)}-${index}`));
42
44
  };
43
45
  const renderMappingsPreview = (mappings) => {
44
46
  if (!mappings || mappings.length === 0) {
45
47
  return _jsx(Tag, { children: "No mappings" });
46
48
  }
47
- const previewItems = mappings.slice(0, 6).map((m, i) => previewMapping(m, i));
49
+ const previewItems = mappings.slice(0, ICON_MAPPINGS_PREVIEW_CHIP_LIMIT).map((m, i) => previewMapping(m, i));
48
50
  const remaining = mappings.length - previewItems.length;
49
51
  return (_jsxs(Flex, { alignItems: "center", className: "twa:gap-1 twa:flex-wrap", children: [previewItems, remaining > 0 && _jsxs(Box, { className: "twa:text-xs twa:opacity-60", children: ["+", remaining, " more"] })] }));
50
52
  };
53
+ const formatIconCellTextSummary = (cellText) => cellText
54
+ ?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Description'))
55
+ .join(' + ') ?? '';
56
+ const formatIconToolTipSummary = (toolTipText) => toolTipText
57
+ ?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Description'))
58
+ .join(' + ') ?? '';
59
+ export const getStyledColumnIconMappingsViewValues = (data) => {
60
+ const ic = data.IconStyle;
61
+ if (!ic) {
62
+ return [];
63
+ }
64
+ const effectiveMappings = resolveEffectiveIconStyleMappings(ic);
65
+ const items = [`Mappings: ${effectiveMappings.length}`];
66
+ if (ic.Preset) {
67
+ items.push(`Preset: ${ICON_STYLE_PRESET_LABELS[ic.Preset]}`);
68
+ }
69
+ const customCount = ic.Mappings?.length ?? 0;
70
+ if (customCount > 0) {
71
+ items.push(`Custom Mappings: ${customCount}`);
72
+ }
73
+ if (ic.MatchMode && ic.MatchMode !== 'Exact') {
74
+ items.push(`Match Mode: ${ic.MatchMode}`);
75
+ }
76
+ if (ic.Fallback && ic.Fallback !== 'Hide') {
77
+ items.push(`Fallback: ${ic.Fallback}`);
78
+ }
79
+ return items;
80
+ };
81
+ const buildStyledColumnIconStyleSummaryStrings = (ic, options) => {
82
+ const items = [];
83
+ if (ic.Size != null) {
84
+ items.push(`Icon Size: ${ic.Size}px`);
85
+ }
86
+ if (ic.Gap != null) {
87
+ items.push(`Gap: ${ic.Gap}px`);
88
+ }
89
+ if (ic.CellText?.length) {
90
+ items.push(`Cell Text: ${formatIconCellTextSummary(ic.CellText)}`);
91
+ items.push(`Cell Text Position: ${ic.CellTextPosition ?? 'After'}`);
92
+ }
93
+ else if (options.includeEmptyCellText) {
94
+ items.push('Cell Text: None');
95
+ }
96
+ getCellFontStyleSummaryItems(ic.Font).forEach(({ label, value }) => {
97
+ items.push(`${label}: ${value}`);
98
+ });
99
+ getCellBoxStyleSummaryItems(ic.Cell).forEach(({ label, value }) => {
100
+ items.push(`${label}: ${value}`);
101
+ });
102
+ if (ic.ToolTipText?.length) {
103
+ items.push(`Tooltip: ${formatIconToolTipSummary(ic.ToolTipText)}`);
104
+ }
105
+ else if (options.includeEmptyTooltip) {
106
+ items.push('Tooltip: No Tooltip');
107
+ }
108
+ return items;
109
+ };
110
+ export const getStyledColumnIconStyleViewValues = (data) => {
111
+ const ic = data.IconStyle;
112
+ if (!ic) {
113
+ return [];
114
+ }
115
+ return buildStyledColumnIconStyleSummaryStrings(ic, {
116
+ includeEmptyCellText: false,
117
+ includeEmptyTooltip: false,
118
+ });
119
+ };
51
120
  /** Mappings step summary. */
52
121
  export const renderStyledColumnIconMappingsSummary = (data) => {
53
122
  const ic = data.IconStyle;
54
123
  if (!ic) {
55
124
  return _jsx(Tag, { children: "No Icon Style defined" });
56
125
  }
57
- // Show the *effective* mapping count (preset + user) so the summary
58
- // matches what the renderer actually uses at runtime.
59
- const effectiveMappings = resolveEffectiveIconStyleMappings(ic);
60
- const customCount = ic.Mappings?.length ?? 0;
61
- 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: [effectiveMappings.length, " ", effectiveMappings.length === 1 ? 'mapping' : 'mappings'] }), ic.Preset && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Preset: ", _jsx(Tag, { children: ICON_STYLE_PRESET_LABELS[ic.Preset] })] })), customCount > 0 && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Custom: ", _jsx(Tag, { children: customCount })] })), ic.MatchMode && ic.MatchMode !== 'Exact' && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Match: ", _jsx(Tag, { children: ic.MatchMode })] })), ic.Fallback && ic.Fallback !== 'Hide' && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Fallback: ", _jsx(Tag, { children: ic.Fallback })] }))] }), renderMappingsPreview(effectiveMappings)] }));
126
+ const tagItems = getStyledColumnIconMappingsViewValues(data);
127
+ const previewMappings = resolveIconStyleMappingsForSummaryPreview(ic);
128
+ 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))) }), renderMappingsPreview(previewMappings)] }));
62
129
  };
130
+ export const StyledColumnIconMappingsView = ({ data }) => renderStyledColumnIconMappingsSummary(data);
63
131
  /** Style step summary (size, text, tooltip, font / cell). */
64
132
  export const renderStyledColumnIconStyleSummary = (data) => {
65
133
  const ic = data.IconStyle;
66
134
  if (!ic) {
67
135
  return _jsx(Tag, { children: "No Icon Style defined" });
68
136
  }
69
- const cellText = ic.CellText ?? [];
70
- return (_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap", children: [_jsxs(Box, { className: "twa:mr-1", children: ["Size: ", _jsxs(Tag, { children: [ic.Size ?? 18, "px"] })] }), cellText.length > 0 && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Text: ", _jsx(Tag, { children: cellText.join(', ') })] })), cellText.length > 0 && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Position: ", _jsx(Tag, { children: ic.CellTextPosition ?? 'After' })] })), ic.ToolTipText?.length > 0 && (_jsxs(Box, { className: "twa:mr-1", children: ["\u00B7 Tooltip: ", _jsx(Tag, { children: ic.ToolTipText.join(', ') })] }))] }));
137
+ const items = buildStyledColumnIconStyleSummaryStrings(ic, {
138
+ includeEmptyCellText: true,
139
+ includeEmptyTooltip: true,
140
+ });
141
+ if (!items.length) {
142
+ return _jsx(Tag, { children: "No Style Defined" });
143
+ }
144
+ return (_jsx(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: items.map((item) => (_jsx(Tag, { children: item }, item))) }));
71
145
  };
72
146
  /**
73
147
  * Combined summary for the Styled Columns list row (preview + key facts).
@@ -240,7 +314,7 @@ export const StyledColumnWizardIconSection = (props) => {
240
314
  { value: 'After', label: 'After' },
241
315
  { value: 'Above', label: 'Above' },
242
316
  { value: 'Below', label: 'Below' },
243
- ] }) }) })] }), _jsx(Box, { className: `twa:mt-3 twa:pt-3 twa:border-t twa:border-foreground/15 ${cellTextDisabled ? 'twa:opacity-50' : ''}`, children: _jsx(StyledColumnFontStyleEditor, { api: api, disabled: disabled || cellTextDisabled, value: iconStyle.Font, onChange: onFontChange }) })] })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose whether and how to display a tooltip" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: _jsxs(FormRow, { label: "Tooltip Display:", children: [_jsx(CheckBox, { checked: toolTipText.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { className: "twa:ml-3", checked: toolTipText.includes('IconDescription'), onChange: (checked) => toggleToolTipText('IconDescription', checked), children: "Description" })] }) }) })] }), _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-[520px]", children: "Optional cell box styling (overrides Format Column properties)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnCellStyleEditor, { api: api, disabled: disabled, value: iconStyle.Cell, onChange: onCellChange }) })] })] }));
317
+ ] }) }) })] }), _jsx(Box, { className: `twa:mt-3 twa:pt-3 twa:border-t twa:border-foreground/15 ${cellTextDisabled ? 'twa:opacity-50' : ''}`, children: _jsx(StyledColumnFontStyleEditor, { api: api, disabled: disabled || cellTextDisabled, value: iconStyle.Font, onChange: onFontChange }) })] })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose whether and how to display a tooltip" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { sizes: [...STYLE_FORM_SIZES], children: _jsxs(FormRow, { label: "Tooltip Display:", children: [_jsx(CheckBox, { checked: toolTipText.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { className: "twa:ml-3", checked: toolTipText.includes('IconDescription'), onChange: (checked) => toggleToolTipText('IconDescription', checked), children: "Description" })] }) }) })] }), _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-[520px]", children: "Optional cell box styling (overrides Format Column properties)" })] }), _jsx(Card.Body, { children: _jsx(StyledColumnCellStyleEditor, { api: api, disabled: disabled, value: iconStyle.Cell, onChange: onCellChange }) })] }), _jsx(StyledColumnIconPreviewCard, { data: data })] }));
244
318
  };
245
319
  const IconSpecEditorFields = (props) => {
246
320
  const kind = detectIconKind(props.value);
@@ -1,7 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { StyledColumn } from '../../../AdaptableState/StyledColumnState';
3
+ export declare const getStyledColumnRangeBarRangeViewValues: (data: StyledColumn) => string[];
4
+ export declare const getStyledColumnRangeBarDisplayViewValues: (data: StyledColumn) => string[];
3
5
  /** Summary line for the Range wizard step (bounds + bands only). */
4
6
  export declare const renderStyledColumnRangeBarRangeStepSummary: (data: StyledColumn) => React.JSX.Element;
7
+ export declare const StyledColumnRangeBarRangeView: React.FunctionComponent<React.PropsWithChildren<{
8
+ data: StyledColumn;
9
+ }>>;
5
10
  /** Summary for the Display wizard step (markers, track, text). */
6
11
  export declare const renderStyledColumnRangeBarDisplayStepSummary: (data: StyledColumn) => React.JSX.Element;
7
12
  /**
@@ -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 {