@adaptabletools/adaptable 23.0.0-canary.4 → 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 (248) hide show
  1. package/index.css +116 -61
  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/ModuleProfile.js +1 -1
  73. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
  74. package/src/View/Components/Popups/WindowPopups/windowFactory.js +0 -1
  75. package/src/View/Components/RangesComponent.d.ts +7 -2
  76. package/src/View/Components/RangesComponent.js +94 -22
  77. package/src/View/Components/StyleComponent.d.ts +1 -0
  78. package/src/View/Components/StyleComponent.js +1 -1
  79. package/src/View/Components/ValueSelector/index.js +70 -57
  80. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
  81. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
  82. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  83. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
  84. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +6 -4
  85. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +3 -2
  86. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +5 -15
  87. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -26
  88. package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -13
  89. package/src/View/Export/Wizard/ReportRowsWizardSection.js +20 -22
  90. package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
  91. package/src/View/Export/Wizard/ScheduledReportSettings.js +13 -13
  92. package/src/View/Export/Wizard/ScheduledReportWizard.js +4 -5
  93. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
  94. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +21 -22
  95. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
  96. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +21 -5
  97. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
  98. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
  99. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +117 -12
  100. package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
  101. package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +66 -0
  102. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
  103. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +30 -0
  104. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +13 -8
  105. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
  106. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
  107. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +62 -13
  108. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +5 -3
  109. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
  110. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +15 -0
  111. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
  112. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +53 -0
  113. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
  114. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +33 -68
  115. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +15 -11
  116. package/src/View/Layout/TransposedPopup.js +2 -2
  117. package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
  118. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
  119. package/src/View/Layout/Wizard/sections/AggregationsSection.js +115 -26
  120. package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
  121. package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
  122. package/src/View/Layout/Wizard/sections/GridFilterSection.js +11 -11
  123. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
  124. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -52
  125. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
  126. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
  127. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
  128. package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
  129. package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
  130. package/src/View/Layout/Wizard/sections/SettingsSection.js +4 -5
  131. package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
  132. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  133. package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +9 -14
  134. package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
  135. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
  136. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +43 -13
  137. package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +11 -18
  138. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
  139. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +6 -22
  140. package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
  141. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
  142. package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +11 -18
  143. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +17 -6
  144. package/src/View/Shortcut/Wizard/ShortcutWizard.js +3 -3
  145. package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
  146. package/src/View/Shortcut/shortcutOperations.js +28 -0
  147. package/src/View/SpecialColumnSettingsWizardStep.js +9 -8
  148. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
  149. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +24 -15
  150. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
  151. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +96 -16
  152. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
  153. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +45 -24
  154. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
  155. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +108 -33
  156. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +21 -13
  157. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
  158. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +121 -23
  159. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
  160. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +34 -11
  161. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
  162. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +86 -12
  163. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
  164. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +121 -34
  165. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
  166. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -75
  167. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
  168. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +16 -0
  169. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +7 -13
  170. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
  171. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +4 -3
  172. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
  173. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +12 -14
  174. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
  175. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +16 -0
  176. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
  177. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +31 -3
  178. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
  179. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +58 -0
  180. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
  181. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +30 -0
  182. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
  183. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +91 -0
  184. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
  185. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +52 -0
  186. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
  187. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +53 -0
  188. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
  189. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +58 -0
  190. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
  191. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +126 -0
  192. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
  193. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
  194. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +52 -29
  195. package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
  196. package/src/View/Theme/ThemePopup.d.ts +2 -14
  197. package/src/View/Theme/ThemePopup.js +1 -36
  198. package/src/View/UIHelper.js +1 -1
  199. package/src/View/Wizard/OnePageAdaptableWizard.js +7 -21
  200. package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
  201. package/src/agGrid/AdaptableAgGrid.js +35 -25
  202. package/src/agGrid/AgGridAdapter.d.ts +1 -1
  203. package/src/agGrid/AgGridAdapter.js +27 -17
  204. package/src/agGrid/AgGridColumnAdapter.js +9 -15
  205. package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
  206. package/src/agGrid/AgGridMenuAdapter.js +20 -37
  207. package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
  208. package/src/agGrid/buildValueAggregationMenuItem.js +111 -0
  209. package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
  210. package/src/agGrid/cellRenderers/IconRenderer.js +43 -15
  211. package/src/agGrid/createAgGridIcon.d.ts +10 -0
  212. package/src/agGrid/createAgGridIcon.js +16 -0
  213. package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
  214. package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
  215. package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
  216. package/src/components/Input/NumberInput.js +1 -1
  217. package/src/components/Panel/index.js +1 -1
  218. package/src/components/SimpleButton/index.js +4 -4
  219. package/src/components/Toggle/Toggle.js +1 -1
  220. package/src/components/Toggle/ToggleGroup.js +1 -1
  221. package/src/env.js +2 -2
  222. package/src/layout-manager/src/index.js +2 -9
  223. package/src/metamodel/adaptable.metamodel.d.ts +39 -29
  224. package/src/metamodel/adaptable.metamodel.js +1 -1
  225. package/src/types.d.ts +5 -4
  226. package/themes/dark.css +1 -68
  227. package/themes/light.css +1 -5
  228. package/tsconfig.esm.tsbuildinfo +1 -1
  229. package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
  230. package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -63
  231. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
  232. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -55
  233. package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
  234. package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -137
  235. package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
  236. package/src/Aggregation/parameterizedAggregationHeader.js +0 -60
  237. package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
  238. package/src/Aggregation/parameterizedAggregationHelpers.js +0 -111
  239. package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
  240. package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -66
  241. package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
  242. package/src/Aggregation/validateParameterizedAggregations.js +0 -20
  243. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
  244. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -43
  245. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
  246. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -28
  247. package/src/View/Theme/VariantSelector.d.ts +0 -8
  248. package/src/View/Theme/VariantSelector.js +0 -20
@@ -1,53 +1,44 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from 'react';
3
2
  import { CheckBox } from '../../../../components/CheckBox';
4
3
  import { SingleSelect } from '../../../../components/NewSelect';
5
- import FormLayout, { FormRow } from '../../../../components/FormLayout';
6
4
  import { validateChartName } from '../../../../Utilities/Helpers/chartingHelper';
7
- import AdaptableInput from '../../../Components/AdaptableInput';
5
+ import { Box, Flex } from '../../../../components/Flex';
6
+ import { Card } from '../../../../components/Card';
7
+ import Input from '../../../../components/Input';
8
+ import { PreviewChartSection } from './PreviewChartSection';
8
9
  export const isSettingsValid = (chartDefinition, api) => {
9
10
  return validateChartName(api, chartDefinition.Name, chartDefinition.Uuid);
10
11
  };
12
+ const AGG_FUNCS = ['sum', 'min', 'max', 'count', 'avg', 'first', 'last'];
11
13
  export const SettingsSection = (props) => {
12
- const handleNameChange = React.useCallback((event) => {
13
- props.onChange({
14
- ...props.chartDefinition,
15
- Name: event.target.value,
16
- Model: props.chartDefinition.Model,
17
- });
18
- }, [props.chartDefinition]);
19
- const handleUnLinkChange = React.useCallback(() => {
20
- props.onChange({
21
- ...props.chartDefinition,
22
- Model: {
23
- ...props.chartDefinition.Model,
24
- unlinkChart: !props.chartDefinition.Model.unlinkChart,
25
- },
26
- });
27
- }, [props.chartDefinition]);
28
- const handleSuppressChartRanges = React.useCallback(() => {
29
- props.onChange({
30
- ...props.chartDefinition,
31
- Model: {
32
- ...props.chartDefinition.Model,
33
- suppressChartRanges: !props.chartDefinition.Model.suppressChartRanges,
34
- },
35
- });
36
- }, [props.chartDefinition]);
37
- const aggFuncs = ['sum', 'min', 'max', 'count', 'avg', 'first', 'last'];
38
- const aggFunc = props.chartDefinition.Model.aggFunc;
39
- const handleAggFuncChange = React.useCallback((value) => {
40
- props.onChange({
41
- ...props.chartDefinition,
42
- Model: {
43
- ...props.chartDefinition.Model,
44
- aggFunc: value,
45
- },
46
- });
47
- }, [props.chartDefinition]);
48
- const aggFuncsOptions = aggFuncs.map((option) => ({
14
+ const { chartDefinition, onChange } = props;
15
+ const aggFunc = chartDefinition.Model.aggFunc;
16
+ const showAggFunc = chartDefinition.Model.modelType === 'range' && typeof aggFunc !== 'function';
17
+ const aggFuncsOptions = AGG_FUNCS.map((option) => ({
49
18
  label: option,
50
19
  value: option,
51
20
  }));
52
- return (_jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Name", children: _jsx(AdaptableInput, { onChange: handleNameChange, value: props.chartDefinition.Name }) }), _jsx(FormRow, { label: "Unlink Chart", children: _jsx(CheckBox, { onClick: handleUnLinkChange, checked: props.chartDefinition.Model.unlinkChart }) }), _jsx(FormRow, { label: "Suppress Chart Ranges", children: _jsx(CheckBox, { onClick: handleSuppressChartRanges, checked: props.chartDefinition.Model.suppressChartRanges }) }), props.chartDefinition.Model.modelType === 'range' && typeof aggFunc !== 'function' && (_jsx(FormRow, { label: "Agg Func", children: _jsx(SingleSelect, { placeholder: "Select", items: aggFuncsOptions, value: aggFunc || undefined, onValueChange: handleAggFuncChange }) }))] }));
21
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3 twa:h-full twa:min-h-0", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Name" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Provide a unique name for the chart" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { "data-name": "chart-name", className: "twa:max-w-[300px] twa:w-full", onChange: (event) => onChange({
22
+ ...chartDefinition,
23
+ Name: event.target.value,
24
+ Model: chartDefinition.Model,
25
+ }), value: chartDefinition.Name ?? '', placeholder: "Enter chart name" }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Unlink Chart" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "When enabled, the chart is not linked to the grid data range" })] }), _jsx(Card.Body, { children: _jsx(CheckBox, { "data-name": "unlink-chart", checked: chartDefinition.Model.unlinkChart, onChange: (checked) => onChange({
26
+ ...chartDefinition,
27
+ Model: {
28
+ ...chartDefinition.Model,
29
+ unlinkChart: checked,
30
+ },
31
+ }), children: "Unlink from data" }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Suppress Chart Ranges" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Hide chart range highlights on the grid while the chart is open" })] }), _jsx(Card.Body, { children: _jsx(CheckBox, { "data-name": "suppress-chart-ranges", checked: chartDefinition.Model.suppressChartRanges, onChange: (checked) => onChange({
32
+ ...chartDefinition,
33
+ Model: {
34
+ ...chartDefinition.Model,
35
+ suppressChartRanges: checked,
36
+ },
37
+ }), children: "Suppress chart ranges" }) })] }), showAggFunc ? (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Aggregation" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Aggregation function used for range charts" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(SingleSelect, { "data-name": "chart-agg-func", placeholder: "Select", className: "twa:max-w-[300px]", items: aggFuncsOptions, value: aggFunc || undefined, onValueChange: (value) => onChange({
38
+ ...chartDefinition,
39
+ Model: {
40
+ ...chartDefinition.Model,
41
+ aggFunc: value,
42
+ },
43
+ }) }) })] })) : null, _jsxs(Card, { shadow: false, className: "twa:flex-1 twa:min-h-0", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Preview" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Live preview of the chart \u2014 changes here are reflected in the chart model" })] }), _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-[280px]", children: _jsx(PreviewChartSection, { chartDefinition: chartDefinition, onChange: onChange }) })] })] }));
53
44
  };
@@ -3,25 +3,6 @@ import * as React from 'react';
3
3
  import { useAdaptable } from '../../../AdaptableContext';
4
4
  import { OnePageAdaptableWizard } from '../../../Wizard/OnePageAdaptableWizard';
5
5
  import { isSettingsValid, SettingsSection } from './SettingsSection';
6
- import { Box } from '../../../../components/Flex';
7
- const PreviewChartSection = ({ chartDefinition }) => {
8
- const adaptable = useAdaptable();
9
- const divRef = React.useRef(null);
10
- React.useEffect(() => {
11
- if (!divRef.current) {
12
- return;
13
- }
14
- const container = {
15
- name: 'Preview Chart',
16
- element: divRef.current,
17
- };
18
- const transientChartDefinition = adaptable.api.chartingApi.internalApi.onPreviewExternalChart(chartDefinition, container);
19
- return () => {
20
- adaptable.api.chartingApi.internalApi.onHideExternalChart(transientChartDefinition);
21
- };
22
- }, [divRef]);
23
- return _jsx("div", { ref: divRef });
24
- };
25
6
  export const ExternalChartingWizard = (props) => {
26
7
  const adaptable = useAdaptable();
27
8
  const onPreviewChart = adaptable.api.optionsApi.getChartingOptions().externalChartingOptions?.onPreviewChart;
@@ -34,18 +15,10 @@ export const ExternalChartingWizard = (props) => {
34
15
  };
35
16
  return (_jsx(OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: chartDefinition, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
36
17
  {
37
- title: 'Settings',
38
- details: 'Chart Settings',
18
+ title: 'Chart',
19
+ details: 'Configure chart properties and preview the result',
39
20
  isValid: isSettingsValid,
40
- render: () => (_jsx(Box, { className: "twa:p-2", children: _jsx(SettingsSection, { chartDefinition: chartDefinition, onChange: setChartDefinition }) })),
21
+ render: () => (_jsx(SettingsSection, { chartDefinition: chartDefinition, onChange: setChartDefinition, showPreview: Boolean(onPreviewChart) })),
41
22
  },
42
- onPreviewChart
43
- ? {
44
- title: 'Preview Chart',
45
- render: () => {
46
- return (_jsx(Box, { className: "twa:p-2", children: _jsx(PreviewChartSection, { chartDefinition: chartDefinition }) }));
47
- },
48
- }
49
- : null,
50
- ].filter(Boolean) }));
23
+ ] }));
51
24
  };
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { ExternalChartDefinition } from '../../../../AdaptableState/ChartingState';
3
+ export declare const PreviewChartSection: React.FunctionComponent<{
4
+ chartDefinition: ExternalChartDefinition;
5
+ }>;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useAdaptable } from '../../../AdaptableContext';
4
+ export const PreviewChartSection = (props) => {
5
+ const adaptable = useAdaptable();
6
+ const divRef = React.useRef(null);
7
+ React.useEffect(() => {
8
+ if (!divRef.current) {
9
+ return;
10
+ }
11
+ const container = {
12
+ name: 'Preview Chart',
13
+ element: divRef.current,
14
+ };
15
+ const transientChartDefinition = adaptable.api.chartingApi.internalApi.onPreviewExternalChart(props.chartDefinition, container);
16
+ return () => {
17
+ adaptable.api.chartingApi.internalApi.onHideExternalChart(transientChartDefinition);
18
+ };
19
+ }, [divRef]);
20
+ return _jsx("div", { ref: divRef, className: "twa:min-h-[280px] twa:h-full twa:w-full" });
21
+ };
@@ -5,5 +5,6 @@ export declare const isSettingsValid: (chartDefinition: ExternalChartDefinition,
5
5
  export interface SettingsSectionProps {
6
6
  chartDefinition: ExternalChartDefinition;
7
7
  onChange: (chartDefinition: ExternalChartDefinition) => void;
8
+ showPreview?: boolean;
8
9
  }
9
10
  export declare const SettingsSection: React.FunctionComponent<SettingsSectionProps>;
@@ -1,13 +1,16 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import FormLayout, { FormRow } from '../../../../components/FormLayout';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import { validateChartName } from '../../../../Utilities/Helpers/chartingHelper';
4
- import AdaptableInput from '../../../Components/AdaptableInput';
3
+ import { Box, Flex } from '../../../../components/Flex';
4
+ import { Card } from '../../../../components/Card';
5
+ import Input from '../../../../components/Input';
6
+ import { PreviewChartSection } from './PreviewChartSection';
5
7
  export const isSettingsValid = (chartDefinition, api) => {
6
8
  return validateChartName(api, chartDefinition.Name, chartDefinition.Uuid);
7
9
  };
8
10
  export const SettingsSection = (props) => {
9
- return (_jsx(FormLayout, { children: _jsx(FormRow, { label: "Name", children: _jsx(AdaptableInput, { value: props.chartDefinition.Name, onChange: (e) => props.onChange({
10
- ...props.chartDefinition,
11
- Name: e.target.value,
12
- }) }) }) }));
11
+ const { chartDefinition, onChange, showPreview } = props;
12
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3 twa:h-full twa:min-h-0", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Name" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Provide a unique name for the chart" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { "data-name": "chart-name", className: "twa:max-w-[300px] twa:w-full", value: chartDefinition.Name ?? '', placeholder: "Enter chart name", onChange: (event) => onChange({
13
+ ...chartDefinition,
14
+ Name: event.target.value,
15
+ }) }) })] }), showPreview ? (_jsxs(Card, { shadow: false, className: "twa:flex-1 twa:min-h-0", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Preview" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Live preview of the external chart" })] }), _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-[280px]", children: _jsx(PreviewChartSection, { chartDefinition: chartDefinition }) })] })) : null] }));
13
16
  };
@@ -53,7 +53,7 @@ export const CommentsEditor = (props) => {
53
53
  const formatDate = (date, format) => {
54
54
  return FormatHelper.DateFormatter(date, { Pattern: format });
55
55
  };
56
- return (_jsxs(Panel, { color: "var(--ab-color-text-on-primary)", onClick: () => props.enableEditMode(), className: "ab-CommentPopup twa:min-w-[250px]", onKeyDown: (event) => {
56
+ return (_jsxs(Panel, { color: "var(--ab-color-primary-foreground)", onClick: () => props.enableEditMode(), className: "ab-CommentPopup twa:min-w-[250px]", onKeyDown: (event) => {
57
57
  if (event.key === 'Escape') {
58
58
  api.commentApi.hideCommentsPopup();
59
59
  }
@@ -4,7 +4,7 @@ import { Icon } from '../../components/icons';
4
4
  export class ModuleProfile extends React.Component {
5
5
  render() {
6
6
  return (_jsxs("div", { children: [_jsx(Icon, { name: this.props.moduleInfo.Glyph, style: {
7
- fill: 'var(--ab-color-text-on-primary)',
7
+ fill: 'var(--ab-color-primary-foreground)',
8
8
  } }), ' ', this.props.moduleInfo.FriendlyName] }));
9
9
  }
10
10
  }
@@ -1,7 +1,6 @@
1
1
  import { WindowPopupChildProps } from './WindowPopups';
2
2
  export declare const WINDOW_GRID_FILTER_EDITOR = "WINDOW_GRID_FILTER_EDITOR";
3
3
  export declare const SHOW_PIVOT_COLUMN_DETAILS = "SHOW_PIVOT_COLUMN_DETAILS";
4
- export declare const SHOW_THEME_EDITOR = "SHOW_THEME_EDITOR";
5
4
  export declare const WINDOW_SHOW_TRANSPOSED_VIEW = "WINDOW_SHOW_TRANSPOSED_VIEW";
6
5
  export declare const COLUMN_FILTER_WINDOW = "COLUMN_FILTER_WINDOW";
7
6
  export declare const windowFactory: Record<string, React.FunctionComponent<WindowPopupChildProps>>;
@@ -4,7 +4,6 @@ import { TransposedPopup } from '../../../Layout/TransposedPopup';
4
4
  import { ColumnFilterWindow } from '../../ColumnFilter/ColumnFilterWindow';
5
5
  export const WINDOW_GRID_FILTER_EDITOR = 'WINDOW_GRID_FILTER_EDITOR';
6
6
  export const SHOW_PIVOT_COLUMN_DETAILS = 'SHOW_PIVOT_COLUMN_DETAILS';
7
- export const SHOW_THEME_EDITOR = 'SHOW_THEME_EDITOR';
8
7
  export const WINDOW_SHOW_TRANSPOSED_VIEW = 'WINDOW_SHOW_TRANSPOSED_VIEW';
9
8
  export const COLUMN_FILTER_WINDOW = 'COLUMN_FILTER_WINDOW';
10
9
  export const windowFactory = {
@@ -14,7 +14,7 @@ export interface RangesComponentProps extends React.ClassAttributes<RangesCompon
14
14
  minMaxRangeValues: {
15
15
  min: number;
16
16
  max: number;
17
- };
17
+ } | null;
18
18
  disabled?: boolean;
19
19
  /**
20
20
  * When true, the user may delete every band so `ranges` becomes `[]`.
@@ -45,7 +45,7 @@ export interface RangesComponentProps extends React.ClassAttributes<RangesCompon
45
45
  showRangeDirection?: boolean;
46
46
  }
47
47
  export interface RangesComponentState {
48
- rangesType: 'NumberRange' | 'PercentageRange' | 'ZeroCentred' | 'ColumnComparison';
48
+ rangesType: 'None' | 'NumberRange' | 'PercentageRange' | 'ZeroCentred' | 'ColumnComparison';
49
49
  }
50
50
  export declare class RangesComponent extends React.Component<RangesComponentProps, RangesComponentState> {
51
51
  constructor(props: RangesComponentProps);
@@ -60,6 +60,11 @@ export declare class RangesComponent extends React.Component<RangesComponentProp
60
60
  setRangeColMin(range: CellColorRange): void;
61
61
  setRangeColMax(range: CellColorRange): void;
62
62
  addRange(): void;
63
+ /**
64
+ * When there is exactly one band spanning the full scale (Col-Min→Col-Max or
65
+ * 0→100), split at the midpoint instead of at the column maximum.
66
+ */
67
+ private splitFullSpanRangeAtMidpoint;
63
68
  changeColumnComparisonMinValue(value: number): void;
64
69
  private onMinColumnSelectedChanged;
65
70
  changeColumnComparisonMaxValue(value: number): void;
@@ -15,14 +15,16 @@ const DEFAULT_ZERO_CENTRED_COLORS = {
15
15
  NegativeColor: 'rgba(220, 53, 69, 0.55)',
16
16
  PositiveColor: 'rgba(40, 167, 69, 0.55)',
17
17
  };
18
+ const hasConfiguredRanges = (ranges) => (ranges?.length ?? 0) > 0;
18
19
  /**
19
- * Decide which of the four range tabs should be active given the current props.
20
+ * Decide which range tab should be active given the current props.
20
21
  *
21
22
  * Precedence:
22
23
  * 1. `columnComparison` set → Column Comparison tab
23
24
  * 2. Zero Centred set + supported → Zero Centred tab
24
- * 3. `rangeValueType === 'Percentage'`Percentage Range tab
25
- * 4. otherwise Number Range tab (default for new styles)
25
+ * 3. `allowEmptyRanges` + no bands No Ranges tab
26
+ * 4. `rangeValueType === 'Percentage'` Percentage Range tab
27
+ * 5. otherwise → Number Range tab (default for new styles)
26
28
  */
27
29
  function deriveInitialRangesType(props) {
28
30
  if (props.columnComparison) {
@@ -31,6 +33,9 @@ function deriveInitialRangesType(props) {
31
33
  if (props.showZeroCentredTab && props.zeroCentred) {
32
34
  return 'ZeroCentred';
33
35
  }
36
+ if (props.allowEmptyRanges && !hasConfiguredRanges(props.ranges)) {
37
+ return 'None';
38
+ }
34
39
  return props.rangeValueType === 'Percentage' ? 'PercentageRange' : 'NumberRange';
35
40
  }
36
41
  export class RangesComponent extends React.Component {
@@ -66,6 +71,7 @@ export class RangesComponent extends React.Component {
66
71
  // vs Percentage Range tab) instead of an inline radio. The inner content
67
72
  // is shared between the two range tabs and parameterised on this flag.
68
73
  const isRangeValueTypeNumber = this.state.rangesType === 'NumberRange';
74
+ const renderNoneContent = () => (_jsx(Box, { className: "twa:text-2 twa:opacity-70 twa:py-2 twa:max-w-[520px]", children: "No coloured bands configured" }));
69
75
  const renderRangesContent = () => (_jsxs(_Fragment, { children: [this.props.ranges?.map((range, index, list) => (_jsxs(Flex, { alignItems: "end", className: "twa:mb-2", "data-name": "percent-bar-range", children: [_jsxs(Flex, { flexDirection: "column", children: [isRangeValueTypeNumber && index === 0 && (_jsx(CheckBox, { onClick: () => this.setRangeColMin(range), checked: range.Min === 'Col-Min', className: "twa:mt-0 twa:mb-1 twa:text-3", disabled: this.props.disabled, children: "Col Min" })), _jsx(NumberInput, { disabled: this.props.disabled ||
70
76
  range.Min === 'Col-Min' ||
71
77
  (index === 0 && !isRangeValueTypeNumber), value: range.Min, onChange: (value) => {
@@ -97,7 +103,7 @@ export class RangesComponent extends React.Component {
97
103
  const tabFlex = { flex: 1 };
98
104
  const radioCls = 'twa:m-0 twa:align-baseline';
99
105
  const renderTabRadio = (label, value) => (_jsx(Radio, { tabIndex: -1, className: radioCls, checked: this.state.rangesType === value, children: label }));
100
- return (_jsxs(Tabs, { autoFocus: false, className: "twa:mt-2", value: this.state.rangesType, onValueChange: (v) => this.handleRangesModeTab(v), children: [_jsx(Tabs.Tab, { value: "NumberRange", style: tabFlex, children: renderTabRadio('Number Range', 'NumberRange') }), _jsx(Tabs.Tab, { value: "PercentageRange", style: tabFlex, children: renderTabRadio('Percentage Range', 'PercentageRange') }), this.props.showZeroCentredTab && (_jsx(Tabs.Tab, { value: "ZeroCentred", style: tabFlex, children: renderTabRadio('Zero Centred Range', 'ZeroCentred') })), !this.props.hideColumnComparison && (_jsx(Tabs.Tab, { value: "ColumnComparison", style: tabFlex, children: renderTabRadio('Column Comparison', 'ColumnComparison') })), _jsx(Tabs.Content, { value: "NumberRange", children: renderRangesContent() }), _jsx(Tabs.Content, { value: "PercentageRange", children: renderRangesContent() }), this.props.showZeroCentredTab && (_jsx(Tabs.Content, { value: "ZeroCentred", children: renderZeroCentredContent() })), !this.props.hideColumnComparison && (_jsx(Tabs.Content, { value: "ColumnComparison", children: renderColumnComparisonContent() }))] }));
106
+ return (_jsxs(Tabs, { autoFocus: false, className: "twa:mt-2", value: this.state.rangesType, onValueChange: (v) => this.handleRangesModeTab(v), children: [this.props.allowEmptyRanges && (_jsx(Tabs.Tab, { value: "None", style: tabFlex, children: renderTabRadio('No Ranges', 'None') })), _jsx(Tabs.Tab, { value: "NumberRange", style: tabFlex, children: renderTabRadio('Number Range', 'NumberRange') }), _jsx(Tabs.Tab, { value: "PercentageRange", style: tabFlex, children: renderTabRadio('Percentage Range', 'PercentageRange') }), this.props.showZeroCentredTab && (_jsx(Tabs.Tab, { value: "ZeroCentred", style: tabFlex, children: renderTabRadio('Zero Centred Range', 'ZeroCentred') })), !this.props.hideColumnComparison && (_jsx(Tabs.Tab, { value: "ColumnComparison", style: tabFlex, children: renderTabRadio('Column Comparison', 'ColumnComparison') })), this.props.allowEmptyRanges && (_jsx(Tabs.Content, { value: "None", children: renderNoneContent() })), _jsx(Tabs.Content, { value: "NumberRange", children: renderRangesContent() }), _jsx(Tabs.Content, { value: "PercentageRange", children: renderRangesContent() }), this.props.showZeroCentredTab && (_jsx(Tabs.Content, { value: "ZeroCentred", children: renderZeroCentredContent() })), !this.props.hideColumnComparison && (_jsx(Tabs.Content, { value: "ColumnComparison", children: renderColumnComparisonContent() }))] }));
101
107
  }
102
108
  componentDidUpdate(prevProps) {
103
109
  const wasComparison = !!prevProps.columnComparison;
@@ -125,12 +131,31 @@ export class RangesComponent extends React.Component {
125
131
  rangesType: this.props.rangeValueType === 'Percentage' ? 'PercentageRange' : 'NumberRange',
126
132
  });
127
133
  }
134
+ if (this.props.allowEmptyRanges) {
135
+ const hadRanges = hasConfiguredRanges(prevProps.ranges);
136
+ const hasRanges = hasConfiguredRanges(this.props.ranges);
137
+ if (!hadRanges && hasRanges && this.state.rangesType === 'None') {
138
+ this.setState({
139
+ rangesType: this.props.rangeValueType === 'Percentage' ? 'PercentageRange' : 'NumberRange',
140
+ });
141
+ }
142
+ else if (hadRanges &&
143
+ !hasRanges &&
144
+ this.state.rangesType !== 'ColumnComparison' &&
145
+ this.state.rangesType !== 'ZeroCentred') {
146
+ this.setState({ rangesType: 'None' });
147
+ }
148
+ }
128
149
  }
129
150
  handleRangesModeTab(value) {
130
151
  if (value === this.state.rangesType) {
131
152
  return;
132
153
  }
133
154
  this.setState({ rangesType: value });
155
+ if (value === 'None') {
156
+ this.props.updateRanges([]);
157
+ return;
158
+ }
134
159
  if (value === 'ColumnComparison') {
135
160
  const columnComparison = {
136
161
  Color: getGraySwatchColor(),
@@ -198,7 +223,9 @@ export class RangesComponent extends React.Component {
198
223
  setRangeColMin(range) {
199
224
  const newRanges = this.props.ranges.map((rangeItem) => {
200
225
  if (rangeItem === range) {
201
- let newMin = rangeItem.Min === 'Col-Min' ? this.props.minMaxRangeValues.min : 'Col-Min';
226
+ let newMin = rangeItem.Min === 'Col-Min'
227
+ ? (this.props.minMaxRangeValues?.min ?? 0)
228
+ : 'Col-Min';
202
229
  return {
203
230
  ...rangeItem,
204
231
  Min: newMin,
@@ -232,32 +259,51 @@ export class RangesComponent extends React.Component {
232
259
  const existingRanges = this.props.ranges ?? [];
233
260
  if (existingRanges.length === 0) {
234
261
  const isPercentage = this.props.rangeValueType === 'Percentage';
235
- const min = isPercentage ? 0 : this.props.minMaxRangeValues?.min ?? 0;
236
- const max = isPercentage ? 100 : this.props.minMaxRangeValues?.max ?? 100;
237
- const mid = Math.round((min + max) / 2);
238
- const seedRanges = [
239
- {
240
- Min: isPercentage ? 0 : 'Col-Min',
241
- Max: mid,
242
- Color: 'rgba(128, 128, 128, 0.25)',
243
- },
244
- {
245
- Min: mid,
246
- Max: isPercentage ? 100 : 'Col-Max',
247
- Color: 'rgba(128, 128, 128, 0.55)',
248
- },
249
- ];
262
+ const seedRanges = this.props.allowEmptyRanges
263
+ ? [
264
+ {
265
+ Min: isPercentage ? 0 : 'Col-Min',
266
+ Max: isPercentage ? 100 : 'Col-Max',
267
+ Color: getGraySwatchColor(),
268
+ },
269
+ ]
270
+ : (() => {
271
+ const min = isPercentage ? 0 : this.props.minMaxRangeValues?.min ?? 0;
272
+ const max = isPercentage ? 100 : this.props.minMaxRangeValues?.max ?? 100;
273
+ const mid = Math.round((min + max) / 2);
274
+ return [
275
+ {
276
+ Min: isPercentage ? 0 : 'Col-Min',
277
+ Max: mid,
278
+ Color: 'rgba(128, 128, 128, 0.25)',
279
+ },
280
+ {
281
+ Min: mid,
282
+ Max: isPercentage ? 100 : 'Col-Max',
283
+ Color: 'rgba(128, 128, 128, 0.55)',
284
+ },
285
+ ];
286
+ })();
250
287
  this.props.updateRanges(seedRanges);
251
288
  return;
252
289
  }
290
+ // Splitting a single full-width band at the midpoint is easier to reason
291
+ // about than anchoring the break at the column maximum (e.g. tradeId 1–200 → 100).
292
+ if (existingRanges.length === 1) {
293
+ const splitAtMidpoint = this.splitFullSpanRangeAtMidpoint(existingRanges[0]);
294
+ if (splitAtMidpoint) {
295
+ this.props.updateRanges(splitAtMidpoint);
296
+ return;
297
+ }
298
+ }
253
299
  const lastRange = existingRanges[existingRanges.length - 1];
254
300
  let previousRange = lastRange;
255
301
  let Min = null;
256
302
  if (lastRange.Max === 'Col-Max') {
257
- Min = this.props.minMaxRangeValues.max;
303
+ Min = this.props.minMaxRangeValues?.max ?? 100;
258
304
  previousRange = {
259
305
  ...previousRange,
260
- Max: this.props.minMaxRangeValues.max,
306
+ Max: this.props.minMaxRangeValues?.max ?? 100,
261
307
  };
262
308
  }
263
309
  else {
@@ -271,6 +317,32 @@ export class RangesComponent extends React.Component {
271
317
  const newRanges = [...existingRanges.slice(0, -1), previousRange, newRange];
272
318
  this.props.updateRanges(newRanges);
273
319
  }
320
+ /**
321
+ * When there is exactly one band spanning the full scale (Col-Min→Col-Max or
322
+ * 0→100), split at the midpoint instead of at the column maximum.
323
+ */
324
+ splitFullSpanRangeAtMidpoint(onlyRange) {
325
+ const isPercentage = this.props.rangeValueType === 'Percentage';
326
+ if (isPercentage) {
327
+ if (onlyRange.Min !== 0 || onlyRange.Max !== 100) {
328
+ return null;
329
+ }
330
+ return [
331
+ { ...onlyRange, Max: 50 },
332
+ { Min: 50, Max: 100, Color: getGraySwatchColor() },
333
+ ];
334
+ }
335
+ if (onlyRange.Min !== 'Col-Min' || onlyRange.Max !== 'Col-Max') {
336
+ return null;
337
+ }
338
+ const min = this.props.minMaxRangeValues?.min ?? 0;
339
+ const max = this.props.minMaxRangeValues?.max ?? 100;
340
+ const mid = Math.round((min + max) / 2);
341
+ return [
342
+ { ...onlyRange, Max: mid },
343
+ { Min: mid, Max: 'Col-Max', Color: getGraySwatchColor() },
344
+ ];
345
+ }
274
346
  changeColumnComparisonMinValue(value) {
275
347
  const { columnComparison } = this.props;
276
348
  columnComparison.MinValue = value;
@@ -8,6 +8,7 @@ export interface StyleComponentProps {
8
8
  api: AdaptableApi;
9
9
  headless?: boolean;
10
10
  hidePreview?: boolean;
11
+ previewText?: React.ReactNode;
11
12
  headerText?: string;
12
13
  Style: AdaptableStyle;
13
14
  UpdateStyle: (style: AdaptableStyle) => void;
@@ -187,5 +187,5 @@ export const StyleComponent = (props) => {
187
187
  label: enumName,
188
188
  value: enumName,
189
189
  })),
190
- ], value: componentStyle.FontSize?.toString() ?? '', onValueChange: (value) => onFontSizeChange(value) }) }), _jsx("span", { children: "Alignment" }), _jsxs(ToggleGroup, { children: [_jsx(Toggle, { icon: "align-left", pressed: componentStyle.Alignment === 'Left', onPressedChange: (pressed) => pressed ? onAlignmentChange('Left') : onAlignmentChange('Default') }), _jsx(Toggle, { icon: "align-center", pressed: componentStyle.Alignment === 'Center', onPressedChange: (pressed) => pressed ? onAlignmentChange('Center') : onAlignmentChange('Default') }), _jsx(Toggle, { icon: "align-right", pressed: componentStyle.Alignment === 'Right', onPressedChange: (pressed) => pressed ? onAlignmentChange('Right') : onAlignmentChange('Default') })] })] }) }) })), !props.hidePreview && (_jsxs(Card, { shadow: false, children: [_jsx(Card.Title, { children: "Preview" }), _jsx(Card.Body, { className: "twa:grid twa:place-items-center", children: _jsx(Box, { className: "twa:p-2 twa:inline-block", children: _jsx(StylePreview, { className: "twa:mt-0", styleObject: componentStyle }) }) })] }))] }));
190
+ ], value: componentStyle.FontSize?.toString() ?? '', onValueChange: (value) => onFontSizeChange(value) }) }), _jsx("span", { children: "Alignment" }), _jsxs(ToggleGroup, { children: [_jsx(Toggle, { icon: "align-left", pressed: componentStyle.Alignment === 'Left', onPressedChange: (pressed) => pressed ? onAlignmentChange('Left') : onAlignmentChange('Default') }), _jsx(Toggle, { icon: "align-center", pressed: componentStyle.Alignment === 'Center', onPressedChange: (pressed) => pressed ? onAlignmentChange('Center') : onAlignmentChange('Default') }), _jsx(Toggle, { icon: "align-right", pressed: componentStyle.Alignment === 'Right', onPressedChange: (pressed) => pressed ? onAlignmentChange('Right') : onAlignmentChange('Default') })] })] }) }) })), !props.hidePreview && (_jsxs(Card, { shadow: false, children: [_jsx(Card.Title, { children: "Preview" }), _jsx(Card.Body, { className: "twa:grid twa:place-items-center", children: _jsx(Box, { className: "twa:p-2 twa:inline-block", children: _jsx(StylePreview, { className: "twa:mt-0", styleObject: componentStyle, children: props.previewText }) }) })] }))] }));
191
191
  };