@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
|
@@ -3,14 +3,16 @@ import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
|
3
3
|
import * as FormatColumnRedux from '../Redux/ActionsReducers/FormatColumnRedux';
|
|
4
4
|
import * as PopupRedux from '../Redux/ActionsReducers/PopupRedux';
|
|
5
5
|
import { FormatColumnWizard } from '../View/FormatColumn/Wizard/FormatColumnWizard';
|
|
6
|
-
import { getFormatColumnFormatSummaryValue } from '../View/FormatColumn/Wizard/FormatColumnFormatWizardSection';
|
|
6
|
+
import { getFormatColumnFormatSummaryValue, hasFormatColumnDisplayFormat } from '../View/FormatColumn/Wizard/FormatColumnFormatWizardSection';
|
|
7
7
|
import { getFormatColumnSettingsViewItems } from './Utilities/FormatColumn/getFormatColumnSettingsViewItems';
|
|
8
8
|
import { MoveFormatColumn } from '../View/FormatColumn/MoveFormatColumn';
|
|
9
9
|
import { getObjectTagsViewItems } from '../Utilities/getObjectTagsViewItems';
|
|
10
10
|
import { getRuleViewItems } from '../Utilities/getRuleViewItems';
|
|
11
11
|
import { getScopeViewItems } from '../Utilities/getScopeViewItems';
|
|
12
12
|
import { getFormatColumnRowTargetItems } from './Utilities/FormatColumn/getFormatColumnRowTargetItems';
|
|
13
|
-
import {
|
|
13
|
+
import { getFormatColumnStyleViewValues, hasFormatColumnStyle, } from '../View/FormatColumn/Wizard/FormatColumnStyleWizardSection';
|
|
14
|
+
import { hasFormatColumnCondition } from '../View/FormatColumn/Wizard/FormatColumnRuleWizardSection';
|
|
15
|
+
import { renderFormatColumnPreviewSummary } from '../View/FormatColumn/Wizard/FormatColumnPreview';
|
|
14
16
|
export class FormatColumnModule extends AdaptableModuleBase {
|
|
15
17
|
constructor(api) {
|
|
16
18
|
super(ModuleConstants.FormatColumnModuleId, ModuleConstants.FormatColumnFriendlyName, 'color-palette', 'FormatColumnPopup', 'Create a column style, display format or cell alignment', api);
|
|
@@ -86,19 +88,24 @@ export class FormatColumnModule extends AdaptableModuleBase {
|
|
|
86
88
|
name: 'Name',
|
|
87
89
|
values: [formatColumn.Name],
|
|
88
90
|
},
|
|
91
|
+
getFormatColumnSettingsViewItems(formatColumn),
|
|
89
92
|
getScopeViewItems(formatColumn.Scope, this.api),
|
|
90
93
|
getFormatColumnRowTargetItems(formatColumn),
|
|
91
|
-
formatColumn
|
|
92
|
-
|
|
94
|
+
hasFormatColumnCondition(formatColumn) &&
|
|
95
|
+
getRuleViewItems(formatColumn.Rule, this.api),
|
|
96
|
+
hasFormatColumnStyle(formatColumn) && {
|
|
93
97
|
name: 'Style',
|
|
94
|
-
|
|
98
|
+
values: getFormatColumnStyleViewValues(formatColumn),
|
|
95
99
|
},
|
|
96
|
-
{
|
|
100
|
+
hasFormatColumnDisplayFormat(formatColumn) && {
|
|
97
101
|
name: 'Display Format',
|
|
98
102
|
values: [getFormatColumnFormatSummaryValue(formatColumn)],
|
|
99
103
|
},
|
|
100
|
-
getFormatColumnSettingsViewItems(formatColumn),
|
|
101
104
|
getObjectTagsViewItems(formatColumn, this.api),
|
|
105
|
+
{
|
|
106
|
+
name: 'Preview',
|
|
107
|
+
view: () => renderFormatColumnPreviewSummary(formatColumn, this.api),
|
|
108
|
+
},
|
|
102
109
|
].filter(Boolean),
|
|
103
110
|
};
|
|
104
111
|
}
|
|
@@ -9,8 +9,7 @@ import { LayoutCloneButton } from '../View/Layout/LayoutCloneButton';
|
|
|
9
9
|
import { LayoutWizard } from '../View/Layout/Wizard/LayoutWizard';
|
|
10
10
|
import { getLayoutFilterViewItems } from './Utilities/Layout/getLayoutFilterViewItems';
|
|
11
11
|
import { getLayoutSortViewItems } from './Utilities/Layout/getLayoutSortViewItems';
|
|
12
|
-
import {
|
|
13
|
-
import { getParameterizedAggregationDisplayName } from '../Aggregation/parameterizedAggregationHeader';
|
|
12
|
+
import { WEIGHTED_AVERAGE_AGG_FN_NAME } from '../AdaptableState/Common/AggregationColumns';
|
|
14
13
|
import { SHOW_PIVOT_COLUMN_DETAILS } from '../View/Components/Popups/WindowPopups/windowFactory';
|
|
15
14
|
import flattenDeep from '../Utilities/utils/flattenDeep';
|
|
16
15
|
import StringExtensions from '../Utilities/Extensions/StringExtensions';
|
|
@@ -338,10 +337,13 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
338
337
|
if (ColumnId === 'Source' || ColumnId === 'Uuid' || ColumnId === 'AdaptableVersion') {
|
|
339
338
|
return '';
|
|
340
339
|
}
|
|
341
|
-
|
|
342
|
-
|
|
340
|
+
let aggFnName = '';
|
|
341
|
+
if (typeof aggFn === 'string') {
|
|
342
|
+
aggFnName = aggFn;
|
|
343
|
+
}
|
|
344
|
+
else if (typeof aggFn === 'object' && aggFn.type === 'weightedAverage') {
|
|
345
|
+
aggFnName = WEIGHTED_AVERAGE_AGG_FN_NAME;
|
|
343
346
|
}
|
|
344
|
-
const aggFnName = typeof aggFn === 'string' ? aggFn : '';
|
|
345
347
|
return `${aggFnName}(${columnIdToFriendlyName(ColumnId)})`;
|
|
346
348
|
}).filter(Boolean),
|
|
347
349
|
},
|
|
@@ -353,10 +355,13 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
353
355
|
if (ColumnId === 'Source' || ColumnId === 'Uuid' || ColumnId === 'AdaptableVersion') {
|
|
354
356
|
return '';
|
|
355
357
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
+
let aggFnName = '';
|
|
359
|
+
if (typeof aggFn === 'string') {
|
|
360
|
+
aggFnName = aggFn;
|
|
361
|
+
}
|
|
362
|
+
else if (typeof aggFn === 'object' && aggFn.type === 'weightedAverage') {
|
|
363
|
+
aggFnName = WEIGHTED_AVERAGE_AGG_FN_NAME;
|
|
358
364
|
}
|
|
359
|
-
const aggFnName = typeof aggFn === 'string' ? aggFn : '';
|
|
360
365
|
return `${aggFnName}(${columnIdToFriendlyName(ColumnId)})`;
|
|
361
366
|
}).filter(Boolean),
|
|
362
367
|
},
|
|
@@ -2,17 +2,25 @@ import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
|
2
2
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
3
3
|
import * as StyledColumnRedux from '../Redux/ActionsReducers/StyledColumnRedux';
|
|
4
4
|
import { StyledColumnWizard } from '../View/StyledColumn/Wizard/StyledColumnWizard';
|
|
5
|
-
import { renderStyledColumnRangesSummary,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { renderStyledColumnRangesSummary, getStyledColumnPercentBarStyleViewValues, } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection';
|
|
6
|
+
import { getStyledColumnGradientStyleViewValues } from '../View/StyledColumn/Wizard/StyledColumnWizardGradientSection';
|
|
7
|
+
import { getStyledColumnBulletStyleViewValues, StyledColumnBulletRangesView, } from '../View/StyledColumn/Wizard/StyledColumnWizardBulletSection';
|
|
8
|
+
import { StyledColumnBulletPreview } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview';
|
|
9
|
+
import { getStyledColumnRatingStyleViewValues } from '../View/StyledColumn/Wizard/StyledColumnWizardRatingSection';
|
|
10
|
+
import { StyledColumnRatingPreview } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview';
|
|
11
|
+
import { getStyledColumnRangeBarDisplayViewValues, StyledColumnRangeBarRangeView, } from '../View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection';
|
|
12
|
+
import { StyledColumnRangeBarPreview } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview';
|
|
13
|
+
import { getStyledColumnIconStyleViewValues, StyledColumnIconMappingsView, } from '../View/StyledColumn/Wizard/StyledColumnWizardIconSection';
|
|
14
|
+
import { StyledColumnIconPreview } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview';
|
|
11
15
|
import { collectIncludedRowKindLabels } from '../View/StyledColumn/Wizard/StyledColumnWizardScopeSection';
|
|
12
16
|
import ObjectFactory from '../Utilities/ObjectFactory';
|
|
13
17
|
import { StyledColumnBadgePreview } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview';
|
|
18
|
+
import { StyledColumnGradientPreview } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview';
|
|
19
|
+
import { StyledColumnPercentBarPreview } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview';
|
|
20
|
+
import { getStyledColumnBadgeStyleViewValues, StyledColumnBadgeDefinitionsView, } from '../View/StyledColumn/Wizard/StyledColumnBadgeSection';
|
|
21
|
+
import { getStyledColumnSparklineStyleViewValues } from '../View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection';
|
|
22
|
+
import { StyledColumnSparklinePreview } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview';
|
|
14
23
|
import { getObjectTagsViewItems } from '../Utilities/getObjectTagsViewItems';
|
|
15
|
-
import { StyledColumnBadgeSettings } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings';
|
|
16
24
|
export class StyledColumnModule extends AdaptableModuleBase {
|
|
17
25
|
constructor(api) {
|
|
18
26
|
super(ModuleConstants.StyledColumnModuleId, ModuleConstants.StyledColumnFriendlyName, 'brush', 'StyledColumnPopup', // to change
|
|
@@ -283,80 +291,100 @@ export class StyledColumnModule extends AdaptableModuleBase {
|
|
|
283
291
|
if (styledColumn.PercentBarStyle) {
|
|
284
292
|
specificTypeItems.push({
|
|
285
293
|
name: 'Style',
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
294
|
+
values: getStyledColumnPercentBarStyleViewValues(styledColumn),
|
|
295
|
+
});
|
|
296
|
+
specificTypeItems.push({
|
|
297
|
+
name: 'Preview',
|
|
298
|
+
view: StyledColumnPercentBarPreview,
|
|
289
299
|
});
|
|
290
300
|
}
|
|
291
301
|
if (styledColumn.GradientStyle) {
|
|
292
302
|
specificTypeItems.push({
|
|
293
303
|
name: 'Style',
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
304
|
+
values: getStyledColumnGradientStyleViewValues(styledColumn),
|
|
305
|
+
});
|
|
306
|
+
specificTypeItems.push({
|
|
307
|
+
name: 'Preview',
|
|
308
|
+
view: StyledColumnGradientPreview,
|
|
297
309
|
});
|
|
298
310
|
}
|
|
299
311
|
}
|
|
300
312
|
if (styledColumn.BulletChartStyle) {
|
|
301
313
|
specificTypeItems.push({
|
|
302
314
|
name: 'Ranges',
|
|
303
|
-
view:
|
|
304
|
-
return renderStyledColumnBulletRangesSummary(styledColumn);
|
|
305
|
-
},
|
|
315
|
+
view: StyledColumnBulletRangesView,
|
|
306
316
|
});
|
|
307
317
|
specificTypeItems.push({
|
|
308
318
|
name: 'Style',
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
319
|
+
values: getStyledColumnBulletStyleViewValues(styledColumn),
|
|
320
|
+
});
|
|
321
|
+
specificTypeItems.push({
|
|
322
|
+
name: 'Preview',
|
|
323
|
+
view: StyledColumnBulletPreview,
|
|
312
324
|
});
|
|
313
325
|
}
|
|
314
326
|
if (styledColumn.RatingStyle) {
|
|
315
327
|
specificTypeItems.push({
|
|
316
328
|
name: 'Style',
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
329
|
+
values: getStyledColumnRatingStyleViewValues(styledColumn),
|
|
330
|
+
});
|
|
331
|
+
specificTypeItems.push({
|
|
332
|
+
name: 'Preview',
|
|
333
|
+
view: StyledColumnRatingPreview,
|
|
320
334
|
});
|
|
321
335
|
}
|
|
322
336
|
if (styledColumn.RangeBarStyle) {
|
|
323
337
|
specificTypeItems.push({
|
|
324
338
|
name: 'Style',
|
|
325
|
-
view:
|
|
326
|
-
return renderStyledColumnRangeBarRangeStepSummary(styledColumn);
|
|
327
|
-
},
|
|
339
|
+
view: StyledColumnRangeBarRangeView,
|
|
328
340
|
});
|
|
329
341
|
specificTypeItems.push({
|
|
330
342
|
name: 'Display',
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
343
|
+
values: getStyledColumnRangeBarDisplayViewValues(styledColumn),
|
|
344
|
+
});
|
|
345
|
+
specificTypeItems.push({
|
|
346
|
+
name: 'Preview',
|
|
347
|
+
view: StyledColumnRangeBarPreview,
|
|
334
348
|
});
|
|
335
349
|
}
|
|
336
350
|
if (styledColumn.IconStyle) {
|
|
337
351
|
specificTypeItems.push({
|
|
338
352
|
name: 'Mappings',
|
|
339
|
-
view:
|
|
340
|
-
return renderStyledColumnIconMappingsSummary(styledColumn);
|
|
341
|
-
},
|
|
353
|
+
view: StyledColumnIconMappingsView,
|
|
342
354
|
});
|
|
343
355
|
specificTypeItems.push({
|
|
344
356
|
name: 'Style',
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
357
|
+
values: getStyledColumnIconStyleViewValues(styledColumn),
|
|
358
|
+
});
|
|
359
|
+
specificTypeItems.push({
|
|
360
|
+
name: 'Preview',
|
|
361
|
+
view: StyledColumnIconPreview,
|
|
348
362
|
});
|
|
349
363
|
}
|
|
350
364
|
if (styledColumn.BadgeStyle) {
|
|
351
365
|
specificTypeItems.push({
|
|
352
|
-
name: '
|
|
353
|
-
view:
|
|
366
|
+
name: 'Badges',
|
|
367
|
+
view: StyledColumnBadgeDefinitionsView,
|
|
368
|
+
});
|
|
369
|
+
specificTypeItems.push({
|
|
370
|
+
name: 'Style',
|
|
371
|
+
values: getStyledColumnBadgeStyleViewValues(styledColumn, this.api),
|
|
354
372
|
});
|
|
355
373
|
specificTypeItems.push({
|
|
356
374
|
name: 'Preview',
|
|
357
375
|
view: StyledColumnBadgePreview,
|
|
358
376
|
});
|
|
359
377
|
}
|
|
378
|
+
if (styledColumn.SparklineStyle) {
|
|
379
|
+
specificTypeItems.push({
|
|
380
|
+
name: 'Style',
|
|
381
|
+
values: getStyledColumnSparklineStyleViewValues(styledColumn),
|
|
382
|
+
});
|
|
383
|
+
specificTypeItems.push({
|
|
384
|
+
name: 'Preview',
|
|
385
|
+
view: StyledColumnSparklinePreview,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
360
388
|
const includedRowKinds = collectIncludedRowKindLabels(styledColumn);
|
|
361
389
|
return {
|
|
362
390
|
abObject: styledColumn,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SummaryOperation } from '../../AdaptableState/Common/Enums';
|
|
2
|
-
import {
|
|
2
|
+
import { SystemThemeEntry } from '../../AdaptableState/ThemeState';
|
|
3
3
|
export declare const CELL_SUMMARY_DEFAULT_OPERATION: SummaryOperation | string;
|
|
4
4
|
export declare const QUICK_SEARCH_DEFAULT_TEXT_BACK_COLOR: string;
|
|
5
5
|
export declare const QUICK_SEARCH_DEFAULT_CELL_BACK_COLOR: string;
|
|
6
6
|
export declare const QUICK_SEARCH_DEFAULT_FORE_COLOR: string;
|
|
7
7
|
export declare const QUICK_SEARCH_DEFAULT_CURRENT_BACK_COLOR: string;
|
|
8
|
-
export declare const SYSTEM_THEMES:
|
|
8
|
+
export declare const SYSTEM_THEMES: SystemThemeEntry[];
|
|
9
9
|
export declare const THEME_DEFAULT_CURRENT_THEME: string;
|
|
@@ -10,18 +10,5 @@ export const QUICK_SEARCH_DEFAULT_FORE_COLOR = getSwatchColorVar(1); // black
|
|
|
10
10
|
export const QUICK_SEARCH_DEFAULT_CURRENT_BACK_COLOR = getSwatchColorVar(20); // orange
|
|
11
11
|
// theme
|
|
12
12
|
// consts for Themes
|
|
13
|
-
export const SYSTEM_THEMES = [
|
|
14
|
-
{
|
|
15
|
-
Name: LIGHT_THEME,
|
|
16
|
-
Description: 'Light Theme',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
Name: DARK_THEME,
|
|
20
|
-
Description: 'Dark Theme',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
Name: OS_THEME,
|
|
24
|
-
Description: 'OS Theme',
|
|
25
|
-
},
|
|
26
|
-
];
|
|
13
|
+
export const SYSTEM_THEMES = [LIGHT_THEME, DARK_THEME, OS_THEME];
|
|
27
14
|
export const THEME_DEFAULT_CURRENT_THEME = LIGHT_THEME;
|
|
@@ -4,6 +4,20 @@ import sentenceCase from '../utils/sentenceCase';
|
|
|
4
4
|
import { DEFAULT_DATE_FORMAT_PATTERN } from '../Constants/GeneralConstants';
|
|
5
5
|
import Helper from './Helper';
|
|
6
6
|
import StringExtensions from '../Extensions/StringExtensions';
|
|
7
|
+
const getInputFractionDigitCount = (input) => {
|
|
8
|
+
const fraction = String(input).split('.')[1];
|
|
9
|
+
return fraction ? fraction.replace(/0+$/, '').length : 0;
|
|
10
|
+
};
|
|
11
|
+
const getFractionDigitsAfterMultiplier = (input, multiplier, explicitFractionDigits) => {
|
|
12
|
+
if (explicitFractionDigits != null) {
|
|
13
|
+
return explicitFractionDigits;
|
|
14
|
+
}
|
|
15
|
+
if (multiplier === 1) {
|
|
16
|
+
return getInputFractionDigitCount(input);
|
|
17
|
+
}
|
|
18
|
+
const multiplierPower = Math.round(Math.log10(Math.abs(multiplier)));
|
|
19
|
+
return Math.max(0, getInputFractionDigitCount(input) - multiplierPower);
|
|
20
|
+
};
|
|
7
21
|
export function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
8
22
|
let preparedInput;
|
|
9
23
|
if (options.Content) {
|
|
@@ -29,9 +43,11 @@ export function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
|
29
43
|
return preparedInput.toString();
|
|
30
44
|
}
|
|
31
45
|
let multiplier = options.Multiplier ? options.Multiplier : 1;
|
|
46
|
+
let multiplierFractionDigits;
|
|
32
47
|
if (options.Multiplier !== undefined) {
|
|
33
48
|
n *= multiplier;
|
|
34
|
-
|
|
49
|
+
multiplierFractionDigits = getFractionDigitsAfterMultiplier(preparedInput, options.Multiplier, options.FractionDigits);
|
|
50
|
+
n = parseFloat(n.toFixed(multiplierFractionDigits));
|
|
35
51
|
}
|
|
36
52
|
// Set Integer and Fraction Digits to a max of 20
|
|
37
53
|
if (options.IntegerDigits > 20) {
|
|
@@ -71,6 +87,9 @@ export function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
|
71
87
|
else if (options.FractionDigits != null) {
|
|
72
88
|
digitsToUse = options.FractionDigits;
|
|
73
89
|
}
|
|
90
|
+
else if (multiplierFractionDigits != null) {
|
|
91
|
+
digitsToUse = multiplierFractionDigits;
|
|
92
|
+
}
|
|
74
93
|
else {
|
|
75
94
|
let decimalCount = Math.floor(n) === n ? 0 : n.toString().split(fractionsSepatator)[1]?.length || 0;
|
|
76
95
|
digitsToUse = decimalCount;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgSparklineOptions } from 'ag-charts-types';
|
|
2
|
+
/**
|
|
3
|
+
* AG Charts sparklines do not resolve Adaptable `var(--ab-color-*)` tokens.
|
|
4
|
+
* Resolve palette / theme CSS variables to concrete colours at render time so
|
|
5
|
+
* wizard previews and grid cells match the chosen Fill / Stroke values.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveSparklineOptionsForRender(options: AgSparklineOptions): AgSparklineOptions;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getVariableColor } from './StyleHelper';
|
|
2
|
+
const resolveCssColor = (color) => {
|
|
3
|
+
if (color == null || color === '') {
|
|
4
|
+
return color;
|
|
5
|
+
}
|
|
6
|
+
const resolved = getVariableColor(color);
|
|
7
|
+
return resolved || color;
|
|
8
|
+
};
|
|
9
|
+
const resolveHighlightStyle = (style) => {
|
|
10
|
+
if (!style) {
|
|
11
|
+
return style;
|
|
12
|
+
}
|
|
13
|
+
const resolved = { ...style };
|
|
14
|
+
if (style.fill != null) {
|
|
15
|
+
resolved.fill = resolveCssColor(style.fill);
|
|
16
|
+
}
|
|
17
|
+
if (style.stroke != null) {
|
|
18
|
+
resolved.stroke = resolveCssColor(style.stroke);
|
|
19
|
+
}
|
|
20
|
+
return resolved;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* AG Charts sparklines do not resolve Adaptable `var(--ab-color-*)` tokens.
|
|
24
|
+
* Resolve palette / theme CSS variables to concrete colours at render time so
|
|
25
|
+
* wizard previews and grid cells match the chosen Fill / Stroke values.
|
|
26
|
+
*/
|
|
27
|
+
export function resolveSparklineOptionsForRender(options) {
|
|
28
|
+
const resolved = { ...options };
|
|
29
|
+
if ('fill' in options && options.fill != null) {
|
|
30
|
+
resolved.fill = resolveCssColor(options.fill);
|
|
31
|
+
}
|
|
32
|
+
if (options.stroke != null) {
|
|
33
|
+
resolved.stroke = resolveCssColor(options.stroke);
|
|
34
|
+
}
|
|
35
|
+
if (options.background?.fill != null) {
|
|
36
|
+
resolved.background = {
|
|
37
|
+
...options.background,
|
|
38
|
+
fill: resolveCssColor(options.background.fill),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if ('marker' in options && options.marker) {
|
|
42
|
+
const marker = { ...options.marker };
|
|
43
|
+
if (marker.fill != null) {
|
|
44
|
+
marker.fill = resolveCssColor(marker.fill);
|
|
45
|
+
}
|
|
46
|
+
if (marker.stroke != null) {
|
|
47
|
+
marker.stroke = resolveCssColor(marker.stroke);
|
|
48
|
+
}
|
|
49
|
+
resolved.marker = marker;
|
|
50
|
+
}
|
|
51
|
+
if (options.highlight) {
|
|
52
|
+
resolved.highlight = {
|
|
53
|
+
...options.highlight,
|
|
54
|
+
highlightedItem: resolveHighlightStyle(options.highlight.highlightedItem),
|
|
55
|
+
highlightedSeries: resolveHighlightStyle(options.highlight.highlightedSeries),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (options.axis && typeof options.axis === 'object' && options.axis.stroke != null) {
|
|
59
|
+
resolved.axis = {
|
|
60
|
+
...options.axis,
|
|
61
|
+
stroke: resolveCssColor(options.axis.stroke),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return resolved;
|
|
65
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { IRowNode } from 'ag-grid-community';
|
|
3
|
+
import { CellColorRange, GradientStyle, NumericStyledColumn, StyledColumn } from '../../AdaptableState/StyledColumnState';
|
|
4
|
+
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
2
5
|
/**
|
|
3
6
|
* Default alpha at the **low** end of a Gradient range when `MinAlpha` is unset.
|
|
4
7
|
* Slightly above zero so the bottom-edge value of every range still shows its
|
|
@@ -9,6 +12,25 @@ export declare const DEFAULT_GRADIENT_MIN_ALPHA = 0.15;
|
|
|
9
12
|
* Default alpha at the **high** end of a Gradient range when `MaxAlpha` is unset.
|
|
10
13
|
*/
|
|
11
14
|
export declare const DEFAULT_GRADIENT_MAX_ALPHA = 1;
|
|
15
|
+
export declare const hasGradientRangesConfigured: (gs: GradientStyle | undefined) => boolean;
|
|
16
|
+
/** Number of sample cells shown in Gradient / Percent Bar style previews. */
|
|
17
|
+
export declare const STYLED_COLUMN_PREVIEW_SAMPLE_COUNT = 6;
|
|
18
|
+
/** Illustrative zero-centred scale endpoints for preview geometry. */
|
|
19
|
+
export declare const ZERO_CENTRED_PREVIEW_SCALE_MIN = -20;
|
|
20
|
+
export declare const ZERO_CENTRED_PREVIEW_SCALE_MAX = 20;
|
|
21
|
+
/** @deprecated Use {@link getZeroCentredGradientPreviewValues} — kept for callers using endpoints. */
|
|
22
|
+
export declare const ZERO_CENTRED_GRADIENT_PREVIEW_VALUES: readonly number[];
|
|
23
|
+
export declare const getZeroCentredGradientPreviewValues: () => number[];
|
|
24
|
+
export declare function isDivergingZeroCellRanges(ranges: CellColorRange[] | undefined): boolean;
|
|
25
|
+
export declare function isZeroCentredGradientStyle(gs: GradientStyle): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Sample cell values for gradient preview strips — spread across the effective scale.
|
|
28
|
+
*/
|
|
29
|
+
export declare const getGradientPreviewSampleValues: (styledColumn: StyledColumn, api: AdaptableApi) => number[];
|
|
30
|
+
/**
|
|
31
|
+
* Cell CSS for gradient preview — mirrors `AgGridColumnAdapter.getStyledColumnStyle` gradient path.
|
|
32
|
+
*/
|
|
33
|
+
export declare const getGradientPreviewCellStyle: (cellValue: number, styledColumn: StyledColumn, api: AdaptableApi, rowNode?: IRowNode | null) => CSSProperties;
|
|
12
34
|
/**
|
|
13
35
|
* Effective cell ranges for gradient rendering / range lookup.
|
|
14
36
|
* When `ZeroCentred` is set, expands to the canonical Col-Min…0 and 0…Col-Max bands.
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import tinycolor from 'tinycolor2';
|
|
2
|
+
import { convertAdaptableStyleToCSS } from './StyleHelper';
|
|
3
|
+
import { getVariableColor } from './StyleHelper';
|
|
4
|
+
import clamp from '../utils/clamp';
|
|
1
5
|
/**
|
|
2
6
|
* Default alpha at the **low** end of a Gradient range when `MinAlpha` is unset.
|
|
3
7
|
* Slightly above zero so the bottom-edge value of every range still shows its
|
|
@@ -8,6 +12,206 @@ export const DEFAULT_GRADIENT_MIN_ALPHA = 0.15;
|
|
|
8
12
|
* Default alpha at the **high** end of a Gradient range when `MaxAlpha` is unset.
|
|
9
13
|
*/
|
|
10
14
|
export const DEFAULT_GRADIENT_MAX_ALPHA = 1;
|
|
15
|
+
export const hasGradientRangesConfigured = (gs) => !!(gs?.ZeroCentred || gs?.CellRanges?.length || gs?.ColumnComparison);
|
|
16
|
+
const evenlySpacedValues = (min, max, count) => {
|
|
17
|
+
if (count <= 1) {
|
|
18
|
+
return [min];
|
|
19
|
+
}
|
|
20
|
+
const step = (max - min) / (count - 1);
|
|
21
|
+
return Array.from({ length: count }, (_, i) => min + step * i);
|
|
22
|
+
};
|
|
23
|
+
/** Number of sample cells shown in Gradient / Percent Bar style previews. */
|
|
24
|
+
export const STYLED_COLUMN_PREVIEW_SAMPLE_COUNT = 6;
|
|
25
|
+
/** Illustrative zero-centred scale endpoints for preview geometry. */
|
|
26
|
+
export const ZERO_CENTRED_PREVIEW_SCALE_MIN = -20;
|
|
27
|
+
export const ZERO_CENTRED_PREVIEW_SCALE_MAX = 20;
|
|
28
|
+
/** @deprecated Use {@link getZeroCentredGradientPreviewValues} — kept for callers using endpoints. */
|
|
29
|
+
export const ZERO_CENTRED_GRADIENT_PREVIEW_VALUES = evenlySpacedValues(ZERO_CENTRED_PREVIEW_SCALE_MIN, ZERO_CENTRED_PREVIEW_SCALE_MAX, STYLED_COLUMN_PREVIEW_SAMPLE_COUNT);
|
|
30
|
+
export const getZeroCentredGradientPreviewValues = () => evenlySpacedValues(ZERO_CENTRED_PREVIEW_SCALE_MIN, ZERO_CENTRED_PREVIEW_SCALE_MAX, STYLED_COLUMN_PREVIEW_SAMPLE_COUNT);
|
|
31
|
+
export function isDivergingZeroCellRanges(ranges) {
|
|
32
|
+
if (!ranges || ranges.length !== 2) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
const [a, b] = ranges;
|
|
36
|
+
return a.Max === 0 && b.Min === 0;
|
|
37
|
+
}
|
|
38
|
+
export function isZeroCentredGradientStyle(gs) {
|
|
39
|
+
return !!(gs.ZeroCentred || isDivergingZeroCellRanges(gs.CellRanges));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Sample cell values for gradient preview strips — spread across the effective scale.
|
|
43
|
+
*/
|
|
44
|
+
export const getGradientPreviewSampleValues = (styledColumn, api) => {
|
|
45
|
+
const gs = styledColumn.GradientStyle;
|
|
46
|
+
if (!gs || !hasGradientRangesConfigured(gs)) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
if (isZeroCentredGradientStyle(gs)) {
|
|
50
|
+
return getZeroCentredGradientPreviewValues();
|
|
51
|
+
}
|
|
52
|
+
if (gs.ColumnComparison) {
|
|
53
|
+
const min = Number(gs.ColumnComparison.MinValue);
|
|
54
|
+
const max = Number(gs.ColumnComparison.MaxValue);
|
|
55
|
+
if (!Number.isNaN(min) && !Number.isNaN(max)) {
|
|
56
|
+
return evenlySpacedValues(min, max, STYLED_COLUMN_PREVIEW_SAMPLE_COUNT);
|
|
57
|
+
}
|
|
58
|
+
return evenlySpacedValues(0, 100, STYLED_COLUMN_PREVIEW_SAMPLE_COUNT);
|
|
59
|
+
}
|
|
60
|
+
const column = styledColumn.ColumnId
|
|
61
|
+
? api.columnApi.getColumnWithColumnId(styledColumn.ColumnId)
|
|
62
|
+
: undefined;
|
|
63
|
+
if (!column) {
|
|
64
|
+
return evenlySpacedValues(0, 100, STYLED_COLUMN_PREVIEW_SAMPLE_COUNT);
|
|
65
|
+
}
|
|
66
|
+
const colMin = api.styledColumnApi.internalApi.getMinValueForNumericColumn(column);
|
|
67
|
+
const colMax = api.styledColumnApi.internalApi.getMaxValueForNumericColumn(column);
|
|
68
|
+
if (colMin === colMax) {
|
|
69
|
+
return [colMin];
|
|
70
|
+
}
|
|
71
|
+
return evenlySpacedValues(colMin, colMax, STYLED_COLUMN_PREVIEW_SAMPLE_COUNT);
|
|
72
|
+
};
|
|
73
|
+
const getZeroCentredPreviewColors = (gradientStyle) => {
|
|
74
|
+
if (gradientStyle.ZeroCentred) {
|
|
75
|
+
return {
|
|
76
|
+
negative: gradientStyle.ZeroCentred.NegativeColor,
|
|
77
|
+
positive: gradientStyle.ZeroCentred.PositiveColor,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const ranges = gradientStyle.CellRanges;
|
|
81
|
+
if (isDivergingZeroCellRanges(ranges)) {
|
|
82
|
+
return {
|
|
83
|
+
negative: ranges[0].Color,
|
|
84
|
+
positive: ranges[1].Color,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Zero-centred preview uses a fixed -20…20 illustrative scale so negative
|
|
91
|
+
* colours always appear — independent of whether the column currently has
|
|
92
|
+
* negative values (Col-Min may be above zero today).
|
|
93
|
+
*/
|
|
94
|
+
const getZeroCentredGradientPreviewCellStyle = (cellValue, gradientStyle) => {
|
|
95
|
+
const colors = getZeroCentredPreviewColors(gradientStyle);
|
|
96
|
+
if (!colors) {
|
|
97
|
+
return {};
|
|
98
|
+
}
|
|
99
|
+
const previewMin = ZERO_CENTRED_PREVIEW_SCALE_MIN;
|
|
100
|
+
const previewMax = ZERO_CENTRED_PREVIEW_SCALE_MAX;
|
|
101
|
+
const syntheticRanges = [
|
|
102
|
+
{ Min: previewMin, Max: 0, Color: colors.negative },
|
|
103
|
+
{ Min: 0, Max: previewMax, Color: colors.positive },
|
|
104
|
+
];
|
|
105
|
+
let matchingRange = null;
|
|
106
|
+
for (const range of syntheticRanges) {
|
|
107
|
+
const min = range.Min;
|
|
108
|
+
const max = range.Max;
|
|
109
|
+
if (cellValue >= min && cellValue <= max) {
|
|
110
|
+
matchingRange = range;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (!matchingRange) {
|
|
115
|
+
return {};
|
|
116
|
+
}
|
|
117
|
+
const min = matchingRange.Min;
|
|
118
|
+
const max = matchingRange.Max;
|
|
119
|
+
const reverseGradient = matchingRange.Min === previewMin && matchingRange.Max === 0;
|
|
120
|
+
const minAlphaBound = gradientStyle.MinAlpha ?? DEFAULT_GRADIENT_MIN_ALPHA;
|
|
121
|
+
const maxAlphaBound = gradientStyle.MaxAlpha ?? DEFAULT_GRADIENT_MAX_ALPHA;
|
|
122
|
+
const lo = Math.min(clamp(minAlphaBound, 0, 1), clamp(maxAlphaBound, 0, 1));
|
|
123
|
+
const hi = Math.max(clamp(minAlphaBound, 0, 1), clamp(maxAlphaBound, 0, 1));
|
|
124
|
+
const span = Math.abs(max - min);
|
|
125
|
+
let t = span === 0 ? 0.5 : (Number(cellValue) - min) / span;
|
|
126
|
+
t = clamp(t, 0, 1);
|
|
127
|
+
if (reverseGradient) {
|
|
128
|
+
t = 1 - t;
|
|
129
|
+
}
|
|
130
|
+
const alpha = Number((lo + t * (hi - lo)).toPrecision(4));
|
|
131
|
+
let style = {};
|
|
132
|
+
const bg = tinycolor(getVariableColor(matchingRange.Color)).setAlpha(alpha);
|
|
133
|
+
style.backgroundColor = bg.toRgbString();
|
|
134
|
+
if (gradientStyle.AutoContrastText) {
|
|
135
|
+
style.color = bg.getLuminance() > 0.45 ? '#111111' : '#ffffff';
|
|
136
|
+
}
|
|
137
|
+
const autoContrastColor = gradientStyle.AutoContrastText && style.color ? style.color : undefined;
|
|
138
|
+
if (gradientStyle.Font) {
|
|
139
|
+
style = { ...style, ...convertAdaptableStyleToCSS(gradientStyle.Font) };
|
|
140
|
+
}
|
|
141
|
+
if (autoContrastColor) {
|
|
142
|
+
style.color = autoContrastColor;
|
|
143
|
+
}
|
|
144
|
+
if (gradientStyle.Font?.Alignment && gradientStyle.Font.Alignment !== 'Default') {
|
|
145
|
+
style.textAlign = gradientStyle.Font.Alignment.toLowerCase();
|
|
146
|
+
}
|
|
147
|
+
return style;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Cell CSS for gradient preview — mirrors `AgGridColumnAdapter.getStyledColumnStyle` gradient path.
|
|
151
|
+
*/
|
|
152
|
+
export const getGradientPreviewCellStyle = (cellValue, styledColumn, api, rowNode) => {
|
|
153
|
+
const gradientStyle = styledColumn.GradientStyle;
|
|
154
|
+
if (!gradientStyle || !hasGradientRangesConfigured(gradientStyle)) {
|
|
155
|
+
return {};
|
|
156
|
+
}
|
|
157
|
+
if (isZeroCentredGradientStyle(gradientStyle)) {
|
|
158
|
+
return getZeroCentredGradientPreviewCellStyle(cellValue, gradientStyle);
|
|
159
|
+
}
|
|
160
|
+
const column = styledColumn.ColumnId
|
|
161
|
+
? api.columnApi.getColumnWithColumnId(styledColumn.ColumnId)
|
|
162
|
+
: undefined;
|
|
163
|
+
if (!column) {
|
|
164
|
+
return {};
|
|
165
|
+
}
|
|
166
|
+
const node = rowNode ?? api.gridApi?.getRowNodeForIndex(0) ?? null;
|
|
167
|
+
const internalApi = api.styledColumnApi.internalApi;
|
|
168
|
+
let style = {};
|
|
169
|
+
const min = internalApi.getNumericStyleMinValue(styledColumn, column, node, cellValue);
|
|
170
|
+
const max = internalApi.getNumericStyleMaxValue(styledColumn, column, node, cellValue);
|
|
171
|
+
let cellBackColor;
|
|
172
|
+
let reverseGradient = false;
|
|
173
|
+
if (gradientStyle.ColumnComparison) {
|
|
174
|
+
cellBackColor = gradientStyle.ColumnComparison.Color;
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
const matchingRange = internalApi.findRangeForColumn(expandGradientCellRanges(gradientStyle), column, gradientStyleRangeLookupValueType(gradientStyle), cellValue);
|
|
178
|
+
if (matchingRange) {
|
|
179
|
+
cellBackColor = matchingRange.Color;
|
|
180
|
+
reverseGradient =
|
|
181
|
+
(!!gradientStyle.ZeroCentred && isNegativeZeroCentredBand(matchingRange)) ||
|
|
182
|
+
!!matchingRange.ReverseGradient;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const minAlphaBound = gradientStyle.MinAlpha ?? DEFAULT_GRADIENT_MIN_ALPHA;
|
|
186
|
+
const maxAlphaBound = gradientStyle.MaxAlpha ?? DEFAULT_GRADIENT_MAX_ALPHA;
|
|
187
|
+
const lo = Math.min(clamp(minAlphaBound, 0, 1), clamp(maxAlphaBound, 0, 1));
|
|
188
|
+
const hi = Math.max(clamp(minAlphaBound, 0, 1), clamp(maxAlphaBound, 0, 1));
|
|
189
|
+
const span = Math.abs(max - min);
|
|
190
|
+
let t = span === 0 ? 0.5 : (Number(cellValue) - min) / span;
|
|
191
|
+
t = clamp(t, 0, 1);
|
|
192
|
+
if (reverseGradient) {
|
|
193
|
+
t = 1 - t;
|
|
194
|
+
}
|
|
195
|
+
const alpha = Number((lo + t * (hi - lo)).toPrecision(4));
|
|
196
|
+
if (cellBackColor) {
|
|
197
|
+
const bg = tinycolor(getVariableColor(cellBackColor)).setAlpha(alpha);
|
|
198
|
+
style.backgroundColor = bg.toRgbString();
|
|
199
|
+
if (gradientStyle.AutoContrastText) {
|
|
200
|
+
style.color = bg.getLuminance() > 0.45 ? '#111111' : '#ffffff';
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
const autoContrastColor = gradientStyle.AutoContrastText && style.color ? style.color : undefined;
|
|
204
|
+
if (gradientStyle.Font) {
|
|
205
|
+
style = { ...style, ...convertAdaptableStyleToCSS(gradientStyle.Font) };
|
|
206
|
+
}
|
|
207
|
+
if (autoContrastColor) {
|
|
208
|
+
style.color = autoContrastColor;
|
|
209
|
+
}
|
|
210
|
+
if (gradientStyle.Font?.Alignment && gradientStyle.Font.Alignment !== 'Default') {
|
|
211
|
+
style.textAlign = gradientStyle.Font.Alignment.toLowerCase();
|
|
212
|
+
}
|
|
213
|
+
return style;
|
|
214
|
+
};
|
|
11
215
|
/**
|
|
12
216
|
* Effective cell ranges for gradient rendering / range lookup.
|
|
13
217
|
* When `ZeroCentred` is set, expands to the canonical Col-Min…0 and 0…Col-Max bands.
|