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