@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.
- package/index.css +117 -62
- package/package.json +9 -4
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
- package/src/AdaptableState/Common/AggregationColumns.js +27 -2
- package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
- package/src/AdaptableState/Common/Enums.d.ts +5 -5
- package/src/AdaptableState/Common/Enums.js +4 -4
- package/src/AdaptableState/PlusMinusState.d.ts +3 -3
- package/src/AdaptableState/ShortcutState.d.ts +2 -6
- package/src/AdaptableState/StyledColumnState.d.ts +3 -5
- package/src/AdaptableState/ThemeState.d.ts +33 -28
- package/src/Api/EventApi.d.ts +14 -1
- package/src/Api/Events/ThemeChanged.d.ts +6 -0
- package/src/Api/Events/ThemeSelected.d.ts +11 -0
- package/src/Api/Events/ThemeSelected.js +1 -0
- package/src/Api/Implementation/EventApiImpl.js +4 -0
- package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -2
- package/src/Api/Implementation/LayoutApiImpl.js +0 -14
- package/src/Api/Implementation/LayoutHelpers.d.ts +2 -0
- package/src/Api/Implementation/LayoutHelpers.js +17 -7
- package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
- package/src/Api/Implementation/ThemeApiImpl.js +19 -15
- package/src/Api/Internal/EventInternalApi.d.ts +2 -0
- package/src/Api/Internal/EventInternalApi.js +8 -1
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
- package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
- package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
- package/src/Api/Internal/ThemeInternalApi.js +0 -10
- package/src/Api/LayoutApi.d.ts +1 -8
- package/src/Api/ThemeApi.d.ts +6 -2
- package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
- package/src/Strategy/FormatColumnModule.js +14 -7
- package/src/Strategy/LayoutModule.js +13 -8
- package/src/Strategy/StyledColumnModule.js +64 -36
- package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
- package/src/Utilities/Constants/ReduxConstants.js +1 -14
- package/src/Utilities/Helpers/FormatHelper.js +20 -1
- package/src/Utilities/Helpers/SparklineOptionsHelper.d.ts +7 -0
- package/src/Utilities/Helpers/SparklineOptionsHelper.js +65 -0
- package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +204 -0
- package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
- package/src/Utilities/Helpers/ThemeHelpers.js +38 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.js +143 -0
- package/src/Utilities/ObjectFactory.d.ts +1 -3
- package/src/Utilities/ObjectFactory.js +0 -8
- package/src/Utilities/Services/ThemeService.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +114 -103
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +13 -14
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +55 -55
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +3 -2
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +2 -2
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +31 -39
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +3 -4
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +30 -17
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +3 -3
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +32 -41
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +21 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +10 -7
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +0 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +3 -1
- package/src/View/Components/ModuleProfile.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +0 -1
- package/src/View/Components/RangesComponent.d.ts +7 -2
- package/src/View/Components/RangesComponent.js +94 -22
- package/src/View/Components/StyleComponent.d.ts +1 -0
- package/src/View/Components/StyleComponent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +70 -57
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +6 -4
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +3 -2
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +5 -15
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -26
- package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -13
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +20 -22
- package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
- package/src/View/Export/Wizard/ScheduledReportSettings.js +13 -13
- package/src/View/Export/Wizard/ScheduledReportWizard.js +4 -5
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +21 -22
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +21 -5
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +117 -12
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +66 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +30 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +13 -8
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +62 -13
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +5 -3
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +15 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +53 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +33 -68
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +15 -11
- package/src/View/Layout/TransposedPopup.js +2 -2
- package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +115 -26
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
- package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
- package/src/View/Layout/Wizard/sections/GridFilterSection.js +11 -11
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -52
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
- package/src/View/Layout/Wizard/sections/SettingsSection.js +4 -5
- package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
- package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +9 -14
- package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +43 -13
- package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +11 -18
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +6 -22
- package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
- package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +11 -18
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +17 -6
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +3 -3
- package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
- package/src/View/Shortcut/shortcutOperations.js +28 -0
- package/src/View/SpecialColumnSettingsWizardStep.js +9 -8
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +24 -15
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +96 -16
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +45 -24
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +108 -33
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +21 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +121 -23
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +34 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +86 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +121 -34
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -75
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +16 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +7 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +4 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +12 -14
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +16 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +31 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +30 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +91 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +52 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +53 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +126 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +52 -29
- package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
- package/src/View/Theme/ThemePopup.d.ts +2 -14
- package/src/View/Theme/ThemePopup.js +1 -36
- package/src/View/UIHelper.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +7 -21
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
- package/src/agGrid/AdaptableAgGrid.js +36 -26
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +27 -17
- package/src/agGrid/AgGridColumnAdapter.js +9 -15
- package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
- package/src/agGrid/AgGridMenuAdapter.js +20 -37
- package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
- package/src/agGrid/buildValueAggregationMenuItem.js +111 -0
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
- package/src/agGrid/cellRenderers/IconRenderer.js +43 -15
- package/src/agGrid/createAgGridIcon.d.ts +10 -0
- package/src/agGrid/createAgGridIcon.js +16 -0
- package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/components/Input/NumberInput.js +1 -1
- package/src/components/Panel/index.js +1 -1
- package/src/components/SimpleButton/index.js +4 -4
- package/src/components/Toggle/Toggle.js +1 -1
- package/src/components/Toggle/ToggleGroup.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.js +2 -9
- package/src/metamodel/adaptable.metamodel.d.ts +39 -29
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +5 -4
- package/themes/dark.css +1 -68
- package/themes/light.css +1 -5
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
- package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -63
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -55
- package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
- package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -137
- package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
- package/src/Aggregation/parameterizedAggregationHeader.js +0 -60
- package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
- package/src/Aggregation/parameterizedAggregationHelpers.js +0 -111
- package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
- package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -66
- package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
- package/src/Aggregation/validateParameterizedAggregations.js +0 -20
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -43
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -28
- package/src/View/Theme/VariantSelector.d.ts +0 -8
- 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
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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(
|
|
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: '
|
|
38
|
-
details: '
|
|
18
|
+
title: 'Chart',
|
|
19
|
+
details: 'Configure chart properties and preview the result',
|
|
39
20
|
isValid: isSettingsValid,
|
|
40
|
-
render: () => (_jsx(
|
|
21
|
+
render: () => (_jsx(SettingsSection, { chartDefinition: chartDefinition, onChange: setChartDefinition, showPreview: Boolean(onPreviewChart) })),
|
|
41
22
|
},
|
|
42
|
-
|
|
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,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
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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-
|
|
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
|
}
|
|
@@ -78,7 +78,6 @@ export const ColumnFilterInput = (props) => {
|
|
|
78
78
|
} }));
|
|
79
79
|
}
|
|
80
80
|
if (usePrimitiveInputs === false && (type === 'number' || type === 'text')) {
|
|
81
|
-
// we use the permitted values selector
|
|
82
81
|
return (_jsx(PermittedValuesSelector, { allowNewValues: true, searchable: 'inline', value: liveValue, columnId: columnId, onFocus: onFocus, onBlur: onBlur, onChange: (value) => {
|
|
83
82
|
if (value == undefined) {
|
|
84
83
|
onClear();
|
|
@@ -36,7 +36,9 @@ export const ColumnFilterInputList = (props) => {
|
|
|
36
36
|
}
|
|
37
37
|
return (_jsx(_Fragment, { children: (matchingInputs ?? []).map((input, index) => {
|
|
38
38
|
const value = props?.predicate?.args?.[index];
|
|
39
|
-
|
|
39
|
+
const operator = props.predicate?.operator;
|
|
40
|
+
const usePermittedValuesSelector = input === 'number' || operator === 'Is' || operator === 'IsNot';
|
|
41
|
+
return (_jsx(ColumnFilterInput, { columnId: props.columnId, usePrimitiveInputs: !usePermittedValuesSelector, disabled: props.disabled, type: input, value: value, onKeyDown: props.onKeyDown, onClear: () => {
|
|
40
42
|
const args = [...props.predicate.args];
|
|
41
43
|
args.splice(index, 1);
|
|
42
44
|
const newPredicate = {
|
|
@@ -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-
|
|
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
|
|
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. `
|
|
25
|
-
* 4.
|
|
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'
|
|
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
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
|
303
|
+
Min = this.props.minMaxRangeValues?.max ?? 100;
|
|
258
304
|
previousRange = {
|
|
259
305
|
...previousRange,
|
|
260
|
-
Max: this.props.minMaxRangeValues
|
|
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;
|
|
@@ -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
|
};
|