@adaptabletools/adaptable-cjs 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 +34 -0
- package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
- package/src/AdaptableState/Common/AggregationColumns.js +30 -3
- 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 +5 -11
- 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 +2 -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 +31 -8
- 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 +12 -5
- package/src/Strategy/LayoutModule.js +13 -8
- package/src/Strategy/StyledColumnModule.js +58 -30
- 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 +68 -0
- package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +212 -1
- package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
- package/src/Utilities/Helpers/ThemeHelpers.js +43 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.js +155 -0
- package/src/Utilities/ObjectFactory.d.ts +1 -3
- package/src/Utilities/ObjectFactory.js +0 -9
- 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 +120 -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 +113 -102
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +12 -13
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +54 -54
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +4 -3
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +29 -37
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +2 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +28 -15
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +2 -2
- 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 +26 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +9 -6
- 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 +1 -2
- 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 +5 -4
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +2 -1
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +4 -15
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -27
- package/src/View/Export/Wizard/ReportNameWizardSection.js +8 -11
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +19 -22
- package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
- package/src/View/Export/Wizard/ScheduledReportSettings.js +12 -12
- package/src/View/Export/Wizard/ScheduledReportWizard.js +2 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +22 -21
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +19 -3
- 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 +120 -13
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +78 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +34 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +11 -6
- 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 +64 -13
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -1
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +19 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +60 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +35 -70
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +14 -10
- 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 +116 -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 +10 -10
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -51
- 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 +3 -4
- 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 +7 -12
- 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 +45 -12
- package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +10 -17
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +5 -21
- 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 +10 -17
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +16 -5
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +2 -2
- package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
- package/src/View/Shortcut/shortcutOperations.js +32 -1
- package/src/View/SpecialColumnSettingsWizardStep.js +7 -6
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +26 -16
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +100 -15
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +48 -25
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +109 -33
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +20 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +124 -23
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +35 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +88 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +125 -35
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -74
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +20 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +6 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +11 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +20 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +32 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +64 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +35 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +96 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +57 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +66 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +133 -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 +53 -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 +6 -20
- package/src/View/renderWithAdaptableContext.js +1 -2
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.js +36 -41
- 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 +114 -0
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
- package/src/agGrid/cellRenderers/IconRenderer.js +46 -17
- package/src/agGrid/createAgGridIcon.d.ts +10 -0
- package/src/agGrid/createAgGridIcon.js +19 -0
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +10 -5
- 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 +36 -16
- 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 +1 -5
- 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.cjs.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
- package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -5
- package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
- package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -74
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -58
- package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
- package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -143
- package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
- package/src/Aggregation/parameterizedAggregationHeader.js +0 -65
- package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
- package/src/Aggregation/parameterizedAggregationHelpers.js +0 -121
- package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
- package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -74
- package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
- package/src/Aggregation/validateParameterizedAggregations.js +0 -25
- package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
- package/src/View/AdaptableComputedCSSVarsContext.js +0 -36
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -48
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -32
- package/src/View/Theme/VariantSelector.d.ts +0 -8
- package/src/View/Theme/VariantSelector.js +0 -25
- package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
- package/src/components/Select/CSSNumericVariableWatch.js +0 -51
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StyledColumnWizardRangeBarSection = exports.isValidRangeBarBounds = exports.renderStyledColumnRangeBarSummary = exports.renderStyledColumnRangeBarDisplayStepSummary = exports.renderStyledColumnRangeBarRangeStepSummary = void 0;
|
|
3
|
+
exports.StyledColumnWizardRangeBarSection = exports.isValidRangeBarBounds = exports.renderStyledColumnRangeBarSummary = exports.renderStyledColumnRangeBarDisplayStepSummary = exports.StyledColumnRangeBarRangeView = exports.renderStyledColumnRangeBarRangeStepSummary = exports.getStyledColumnRangeBarDisplayViewValues = exports.getStyledColumnRangeBarRangeViewValues = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
@@ -18,7 +18,8 @@ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Ex
|
|
|
18
18
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
19
19
|
const Flex_1 = require("../../../components/Flex");
|
|
20
20
|
const NewSelect_1 = require("../../../components/NewSelect");
|
|
21
|
-
const
|
|
21
|
+
const RangeBarRangesSummaryPreview_1 = require("./StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview");
|
|
22
|
+
const StyledColumnRangeBarPreview_1 = require("./StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview");
|
|
22
23
|
const Card_1 = require("../../../components/Card");
|
|
23
24
|
const RANGE_STYLE_FORM_SIZES = ['200px', '1fr'];
|
|
24
25
|
const BOUND_MODE_LABELS = {
|
|
@@ -49,41 +50,125 @@ const summarizeBound = (bound) => {
|
|
|
49
50
|
}
|
|
50
51
|
return bound;
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const formatRangeBarCellTextSummary = (cellText) => cellText
|
|
54
|
+
?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value'))
|
|
55
|
+
.join(' + ') ?? '';
|
|
56
|
+
const formatRangeBarToolTipSummary = (toolTipText) => toolTipText
|
|
57
|
+
?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value'))
|
|
58
|
+
.join(' + ') ?? '';
|
|
59
|
+
const getStyledColumnRangeBarRangeViewValues = (data) => {
|
|
60
|
+
const range = data.RangeBarStyle;
|
|
61
|
+
if (!range) {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
const items = [
|
|
65
|
+
`Min: ${summarizeBound(range.Min)}`,
|
|
66
|
+
`Max: ${summarizeBound(range.Max)}`,
|
|
67
|
+
];
|
|
68
|
+
if (range.Reference != undefined) {
|
|
69
|
+
items.push(`Reference: ${summarizeBound(range.Reference)}`);
|
|
70
|
+
}
|
|
71
|
+
const bandCount = range.CellRanges?.length ?? 0;
|
|
72
|
+
if (bandCount > 0) {
|
|
73
|
+
items.push(`Bands: ${bandCount}`);
|
|
74
|
+
}
|
|
75
|
+
if (range.RangeValueType != null) {
|
|
76
|
+
items.push(`Range Value Type: ${range.RangeValueType}`);
|
|
77
|
+
}
|
|
78
|
+
return items;
|
|
79
|
+
};
|
|
80
|
+
exports.getStyledColumnRangeBarRangeViewValues = getStyledColumnRangeBarRangeViewValues;
|
|
81
|
+
const buildStyledColumnRangeBarDisplaySummaryStrings = (range, options) => {
|
|
82
|
+
const items = [];
|
|
83
|
+
const valueMarker = range.Marker;
|
|
84
|
+
const referenceMarker = range.ReferenceMarker;
|
|
85
|
+
items.push(`Value Marker Shape: ${valueMarker?.Shape ?? 'Diamond'}`);
|
|
86
|
+
if (valueMarker?.Color) {
|
|
87
|
+
items.push(`Value Marker Colour: ${valueMarker.Color}`);
|
|
88
|
+
}
|
|
89
|
+
if (valueMarker?.Size != null) {
|
|
90
|
+
items.push(`Value Marker Size: ${valueMarker.Size}px`);
|
|
91
|
+
}
|
|
92
|
+
if (range.Reference != undefined) {
|
|
93
|
+
items.push(`Reference Marker Shape: ${referenceMarker?.Shape ?? 'Line'}`);
|
|
94
|
+
if (referenceMarker?.Color) {
|
|
95
|
+
items.push(`Reference Marker Colour: ${referenceMarker.Color}`);
|
|
96
|
+
}
|
|
97
|
+
if (referenceMarker?.Size != null) {
|
|
98
|
+
items.push(`Reference Marker Size: ${referenceMarker.Size}px`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (range.Orientation === 'Vertical') {
|
|
102
|
+
items.push('Orientation: Vertical');
|
|
103
|
+
}
|
|
104
|
+
const outOfRangeMode = range.OutOfRangeMode ?? 'Clamp';
|
|
105
|
+
if (outOfRangeMode !== 'Clamp') {
|
|
106
|
+
items.push(`Out of Range: ${outOfRangeMode}`);
|
|
107
|
+
}
|
|
108
|
+
if (range.OutOfRangeColor) {
|
|
109
|
+
items.push(`Out of Range Colour: ${range.OutOfRangeColor}`);
|
|
110
|
+
}
|
|
111
|
+
if (range.TrackColor) {
|
|
112
|
+
items.push(`Track Colour: ${range.TrackColor}`);
|
|
113
|
+
}
|
|
114
|
+
if (range.TrackHeight != null) {
|
|
115
|
+
items.push(`Track Height: ${range.TrackHeight}px`);
|
|
116
|
+
}
|
|
117
|
+
if (range.BackColor) {
|
|
118
|
+
items.push(`Back Colour: ${range.BackColor}`);
|
|
119
|
+
}
|
|
120
|
+
if (range.CellText?.length) {
|
|
121
|
+
items.push(`Cell Text: ${formatRangeBarCellTextSummary(range.CellText)}`);
|
|
122
|
+
items.push(`Cell Text Position: ${range.CellTextPosition ?? 'Below'}`);
|
|
123
|
+
}
|
|
124
|
+
else if (options.includeEmptyCellText) {
|
|
125
|
+
items.push('Cell Text: None');
|
|
126
|
+
}
|
|
127
|
+
if (range.ToolTipText?.length) {
|
|
128
|
+
items.push(`Tooltip: ${formatRangeBarToolTipSummary(range.ToolTipText)}`);
|
|
129
|
+
}
|
|
130
|
+
else if (options.includeEmptyTooltip) {
|
|
131
|
+
items.push('Tooltip: No Tooltip');
|
|
132
|
+
}
|
|
133
|
+
return items;
|
|
134
|
+
};
|
|
135
|
+
const getStyledColumnRangeBarDisplayViewValues = (data) => {
|
|
136
|
+
const range = data.RangeBarStyle;
|
|
137
|
+
if (!range) {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
return buildStyledColumnRangeBarDisplaySummaryStrings(range, {
|
|
141
|
+
includeEmptyCellText: false,
|
|
142
|
+
includeEmptyTooltip: false,
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
exports.getStyledColumnRangeBarDisplayViewValues = getStyledColumnRangeBarDisplayViewValues;
|
|
55
146
|
/** Summary line for the Range wizard step (bounds + bands only). */
|
|
56
147
|
const renderStyledColumnRangeBarRangeStepSummary = (data) => {
|
|
57
148
|
const range = data.RangeBarStyle;
|
|
58
149
|
if (!range) {
|
|
59
150
|
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Styling Defined" });
|
|
60
151
|
}
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2 twa:items-start", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["Min: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: summarizeBound(range.Min) })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["\u00B7 Max: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: summarizeBound(range.Max) })] }), hasReference && ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["\u00B7 Ref: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: summarizeBound(range.Reference) })] })), bandCount > 0 && ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["\u00B7 ", bandCount, " ", bandCount === 1 ? 'band' : 'bands'] }))] }), (0, jsx_runtime_1.jsx)(StyledColumnChartListPreviews_1.StyledColumnRangeBarListPreview, { range: range })] }));
|
|
152
|
+
const tagItems = (0, exports.getStyledColumnRangeBarRangeViewValues)(data);
|
|
153
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2 twa:items-start", children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: tagItems.map((item) => ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: item }, item))) }), (0, jsx_runtime_1.jsx)(RangeBarRangesSummaryPreview_1.RangeBarRangesSummaryPreview, { rangeStyle: range })] }));
|
|
64
154
|
};
|
|
65
155
|
exports.renderStyledColumnRangeBarRangeStepSummary = renderStyledColumnRangeBarRangeStepSummary;
|
|
156
|
+
const StyledColumnRangeBarRangeView = ({ data }) => (0, exports.renderStyledColumnRangeBarRangeStepSummary)(data);
|
|
157
|
+
exports.StyledColumnRangeBarRangeView = StyledColumnRangeBarRangeView;
|
|
66
158
|
/** Summary for the Display wizard step (markers, track, text). */
|
|
67
159
|
const renderStyledColumnRangeBarDisplayStepSummary = (data) => {
|
|
68
160
|
const range = data.RangeBarStyle;
|
|
69
161
|
if (!range) {
|
|
70
162
|
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Styling Defined" });
|
|
71
163
|
}
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
if (isVertical) {
|
|
80
|
-
parts.push((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["\u00B7 ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "vertical" })] }, "v"));
|
|
164
|
+
const items = buildStyledColumnRangeBarDisplaySummaryStrings(range, {
|
|
165
|
+
includeEmptyCellText: true,
|
|
166
|
+
includeEmptyTooltip: true,
|
|
167
|
+
});
|
|
168
|
+
if (!items.length) {
|
|
169
|
+
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Display Defined" });
|
|
81
170
|
}
|
|
82
|
-
|
|
83
|
-
if (range.CellText?.length) {
|
|
84
|
-
parts.push((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["\u00B7 Text: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: range.CellText.join(', ') })] }, "ct"));
|
|
85
|
-
}
|
|
86
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2 twa:items-start", children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap", children: parts }), (0, jsx_runtime_1.jsx)(StyledColumnChartListPreviews_1.StyledColumnRangeBarListPreview, { range: range })] }));
|
|
171
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: items.map((item) => ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: item }, item))) }));
|
|
87
172
|
};
|
|
88
173
|
exports.renderStyledColumnRangeBarDisplayStepSummary = renderStyledColumnRangeBarDisplayStepSummary;
|
|
89
174
|
/**
|
|
@@ -94,10 +179,7 @@ const renderStyledColumnRangeBarSummary = (data) => {
|
|
|
94
179
|
if (!range) {
|
|
95
180
|
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Styling Defined" });
|
|
96
181
|
}
|
|
97
|
-
|
|
98
|
-
const isVertical = range.Orientation === 'Vertical';
|
|
99
|
-
const hasReference = range.Reference != undefined;
|
|
100
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2 twa:items-start", children: [(0, jsx_runtime_1.jsx)(StyledColumnChartListPreviews_1.StyledColumnRangeBarListPreview, { range: range }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["Min: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: summarizeBound(range.Min) })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["\u00B7 Max: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: summarizeBound(range.Max) })] }), hasReference && ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["\u00B7 Ref: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: summarizeBound(range.Reference) })] })), bandCount > 0 && ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["\u00B7 ", bandCount, " ", bandCount === 1 ? 'band' : 'bands'] })), isVertical && ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mr-1", children: ["\u00B7 ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "vertical" })] }))] })] }));
|
|
182
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:items-start", children: [(0, exports.renderStyledColumnRangeBarRangeStepSummary)(data), (0, exports.renderStyledColumnRangeBarDisplayStepSummary)(data)] }));
|
|
101
183
|
};
|
|
102
184
|
exports.renderStyledColumnRangeBarSummary = renderStyledColumnRangeBarSummary;
|
|
103
185
|
// ---------------------------------------------------------------------------
|
|
@@ -136,19 +218,25 @@ const MARKER_SHAPES = [
|
|
|
136
218
|
];
|
|
137
219
|
const StyledColumnWizardRangeBarSection = (props) => {
|
|
138
220
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
139
|
-
const
|
|
221
|
+
const column = React.useMemo(() => {
|
|
140
222
|
const columnId = data.ColumnId;
|
|
141
|
-
if (!columnId)
|
|
223
|
+
if (!columnId) {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
return api.columnApi.getColumnWithColumnId(columnId);
|
|
227
|
+
}, [data.ColumnId, api]);
|
|
228
|
+
const minMaxRangeValues = React.useMemo(() => {
|
|
229
|
+
if (!column) {
|
|
142
230
|
return null;
|
|
143
|
-
|
|
231
|
+
}
|
|
144
232
|
return {
|
|
145
233
|
min: api.styledColumnApi.internalApi.getMinValueForNumericColumn(column),
|
|
146
234
|
max: api.styledColumnApi.internalApi.getMaxValueForNumericColumn(column),
|
|
147
235
|
};
|
|
148
|
-
}, [
|
|
236
|
+
}, [column, api]);
|
|
149
237
|
const scope = { ColumnIds: [data.ColumnId] };
|
|
150
238
|
const range = data.RangeBarStyle ?? {};
|
|
151
|
-
const disabled = !data.ColumnId;
|
|
239
|
+
const disabled = !data.ColumnId || !column;
|
|
152
240
|
// -------------------------------------------------------------------------
|
|
153
241
|
// Updaters
|
|
154
242
|
// -------------------------------------------------------------------------
|
|
@@ -278,8 +366,10 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
278
366
|
// -------------------------------------------------------------------------
|
|
279
367
|
// Render
|
|
280
368
|
// -------------------------------------------------------------------------
|
|
281
|
-
if (!data.ColumnId) {
|
|
282
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { children: (0, jsx_runtime_1.jsx)(ErrorBox_1.default, { className: "twa:mt-2", children:
|
|
369
|
+
if (!data.ColumnId || !column) {
|
|
370
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { children: (0, jsx_runtime_1.jsx)(ErrorBox_1.default, { className: "twa:mt-2", children: !data.ColumnId
|
|
371
|
+
? 'You need to select a column before styling.'
|
|
372
|
+
: `Column "${data.ColumnId}" was not found in the grid.` }) }));
|
|
283
373
|
}
|
|
284
374
|
const hasReference = range.Reference != undefined;
|
|
285
375
|
const outOfRangeMode = range.OutOfRangeMode ?? 'Clamp';
|
|
@@ -299,7 +389,7 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
299
389
|
field: 'Reference',
|
|
300
390
|
optional: true,
|
|
301
391
|
fallbackNumber: minMaxRangeValues?.max ?? 0,
|
|
302
|
-
})] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Ranges" }), (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-700px]", children: ["Optional coloured segments drawn ", (0, jsx_runtime_1.jsx)("em", { children: "behind" }), " track to form qualitative scale;leave empty for a plain track"] })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(RangesComponent_1.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 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Value Marker" }), (0, jsx_runtime_1.jsx)(Flex_1.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." })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Shape:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: valueMarker.Shape, onValueChange: (s) => updateValueMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { disabled: disabled, api: api, value: valueMarker.Color || undefined, onChange: (c) => updateValueMarker({ Color: c }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Size:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[100px]", children: (0, jsx_runtime_1.jsx)(AdaptableInput_1.default, { type: "number", min: 1, value: valueMarker.Size, onChange: (e) => updateValueMarker({ Size: Number(e.target.value) }) }) }) })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Reference Marker" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: hasReference
|
|
392
|
+
})] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Ranges" }), (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-700px]", children: ["Optional coloured segments drawn ", (0, jsx_runtime_1.jsx)("em", { children: "behind" }), " track to form qualitative scale;leave empty for a plain track"] })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(RangesComponent_1.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 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Value Marker" }), (0, jsx_runtime_1.jsx)(Flex_1.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." })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Shape:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: valueMarker.Shape, onValueChange: (s) => updateValueMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { disabled: disabled, api: api, value: valueMarker.Color || undefined, onChange: (c) => updateValueMarker({ Color: c }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Size:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[100px]", children: (0, jsx_runtime_1.jsx)(AdaptableInput_1.default, { type: "number", min: 1, value: valueMarker.Size, onChange: (e) => updateValueMarker({ Size: Number(e.target.value) }) }) }) })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Reference Marker" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: hasReference
|
|
303
393
|
? 'Drawn at the Reference value (e.g. previous close, target, midpoint).'
|
|
304
394
|
: 'Optional second marker when a Reference bound is set on the Style step.' })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: hasReference ? ((0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Shape:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: referenceMarker.Shape, onValueChange: (s) => updateReferenceMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { disabled: disabled, api: api, value: referenceMarker.Color || undefined, onChange: (c) => updateReferenceMarker({ Color: c }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Size:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[100px]", children: (0, jsx_runtime_1.jsx)(AdaptableInput_1.default, { type: "number", min: 1, value: referenceMarker.Size, onChange: (e) => updateReferenceMarker({ Size: Number(e.target.value) }) }) }) })] })) : ((0, jsx_runtime_1.jsx)(Flex_1.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)." })) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Track" }), (0, jsx_runtime_1.jsx)(Flex_1.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." })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Orientation:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: range.Orientation ?? 'Horizontal', onValueChange: (v) => update({ Orientation: v }), items: [
|
|
305
395
|
{ value: 'Horizontal', label: 'Horizontal' },
|
|
@@ -314,6 +404,6 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
314
404
|
{ label: 'Above Bar', onClick: () => handleCellTextPositionChange('Above') },
|
|
315
405
|
{ label: 'Below Bar', onClick: () => handleCellTextPositionChange('Below') },
|
|
316
406
|
{ label: 'Merged', onClick: () => handleCellTextPositionChange('Merged') },
|
|
317
|
-
], children: range.CellTextPosition ?? 'Below' }) }), (0, jsx_runtime_1.jsxs)(FormLayout_1.FormRow, { label: "Tooltip Display:", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, checked: range.ToolTipText?.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, className: "twa:ml-3", checked: range.ToolTipText?.includes('PercentageValue'), onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percent Value" })] })] }) })] })] }))] }));
|
|
407
|
+
], children: range.CellTextPosition ?? 'Below' }) }), (0, jsx_runtime_1.jsxs)(FormLayout_1.FormRow, { label: "Tooltip Display:", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, checked: range.ToolTipText?.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, className: "twa:ml-3", checked: range.ToolTipText?.includes('PercentageValue'), onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percent Value" })] })] }) })] }), (0, jsx_runtime_1.jsx)(StyledColumnRangeBarPreview_1.StyledColumnRangeBarPreviewCard, { data: data })] }))] }));
|
|
318
408
|
};
|
|
319
409
|
exports.StyledColumnWizardRangeBarSection = StyledColumnWizardRangeBarSection;
|
|
@@ -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,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StyledColumnWizardRatingSection = exports.isValidRatingStyle = exports.renderStyledColumnRatingSummary = void 0;
|
|
3
|
+
exports.StyledColumnWizardRatingSection = exports.isValidRatingStyle = exports.renderStyledColumnRatingSummary = exports.getStyledColumnRatingStyleViewValues = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const React = tslib_1.__importStar(require("react"));
|
|
7
6
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
8
7
|
const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
|
|
9
8
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
@@ -15,7 +14,7 @@ const NewSelect_1 = require("../../../components/NewSelect");
|
|
|
15
14
|
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
16
15
|
const StyledColumnSliceStyleEditors_1 = require("./StyledColumnSliceStyleEditors");
|
|
17
16
|
const Card_1 = require("../../../components/Card");
|
|
18
|
-
const
|
|
17
|
+
const StyledColumnRatingPreview_1 = require("./StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview");
|
|
19
18
|
const STYLE_FORM_SIZES = ['200px', '1fr'];
|
|
20
19
|
const ICON_CHOICES = [
|
|
21
20
|
{ value: 'Star', label: 'Star' },
|
|
@@ -23,13 +22,49 @@ const ICON_CHOICES = [
|
|
|
23
22
|
{ value: 'Circle', label: 'Circle' },
|
|
24
23
|
{ value: 'Thumb', label: 'Thumb' },
|
|
25
24
|
];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
const formatRatingToolTipSummary = (toolTipText) => toolTipText
|
|
26
|
+
?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percentage Value'))
|
|
27
|
+
.join(' + ') ?? '';
|
|
28
|
+
const buildStyledColumnRatingStyleSummaryStrings = (rating, options) => {
|
|
29
|
+
const items = [
|
|
30
|
+
`Max: ${rating.Max ?? StyledColumnRatingPreview_1.DEFAULT_RATING_MAX}`,
|
|
31
|
+
`Icon: ${rating.Icon ?? StyledColumnRatingPreview_1.DEFAULT_RATING_ICON}`,
|
|
32
|
+
];
|
|
33
|
+
if (rating.FilledColor) {
|
|
34
|
+
items.push(`Filled Colour: ${rating.FilledColor}`);
|
|
35
|
+
}
|
|
36
|
+
if (rating.EmptyColor) {
|
|
37
|
+
items.push(`Empty Colour: ${rating.EmptyColor}`);
|
|
38
|
+
}
|
|
39
|
+
if (rating.Size != null) {
|
|
40
|
+
items.push(`Icon Size: ${rating.Size}px`);
|
|
41
|
+
}
|
|
42
|
+
if (rating.Gap != null) {
|
|
43
|
+
items.push(`Icon Gap: ${rating.Gap}px`);
|
|
44
|
+
}
|
|
45
|
+
items.push(`Allow Half: ${(rating.AllowHalf ?? true) ? 'Yes' : 'No'}`);
|
|
46
|
+
items.push(`Show Value: ${rating.ShowValue ? 'Yes' : 'No'}`);
|
|
47
|
+
if (rating.ToolTipText?.length) {
|
|
48
|
+
items.push(`Tooltip: ${formatRatingToolTipSummary(rating.ToolTipText)}`);
|
|
49
|
+
}
|
|
50
|
+
else if (options.includeEmptyTooltip) {
|
|
51
|
+
items.push('Tooltip: No Tooltip');
|
|
52
|
+
}
|
|
53
|
+
(0, StyledColumnSliceStyleEditors_1.getCellBoxStyleSummaryItems)(rating.Cell).forEach(({ label, value }) => {
|
|
54
|
+
items.push(`${label}: ${value}`);
|
|
55
|
+
});
|
|
56
|
+
return items;
|
|
57
|
+
};
|
|
58
|
+
const getStyledColumnRatingStyleViewValues = (data) => {
|
|
59
|
+
const rating = data.RatingStyle;
|
|
60
|
+
if (!rating) {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
return buildStyledColumnRatingStyleSummaryStrings(rating, {
|
|
64
|
+
includeEmptyTooltip: false,
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
exports.getStyledColumnRatingStyleViewValues = getStyledColumnRatingStyleViewValues;
|
|
33
68
|
/**
|
|
34
69
|
* Resolve a CSS custom property (e.g. `--ab-color-warn`) to its computed
|
|
35
70
|
* value at runtime. Returns the fallback hex on SSR or when the variable
|
|
@@ -53,17 +88,10 @@ const resolveCssVar = (varName, fallbackHex) => {
|
|
|
53
88
|
* the user hasn't chosen one. The renderer uses `var(--ab-color-warn,
|
|
54
89
|
* #f5a623)`, but `ColorPicker` can't parse a `var(...)` with a fallback,
|
|
55
90
|
* so we resolve the variable manually and pass a concrete hex.
|
|
56
|
-
*
|
|
57
|
-
* State remains untouched - the picker only writes to state when the user
|
|
58
|
-
* actively picks a colour, so we never accidentally bake the resolved
|
|
59
|
-
* theme value into the saved styled column.
|
|
60
91
|
*/
|
|
61
92
|
const getDisplayedFilledColor = (rating) => rating.FilledColor || resolveCssVar('--ab-color-warn', '#f5a623');
|
|
62
93
|
/**
|
|
63
|
-
* Best-effort preview colour for the wizard's `Empty Colour` picker.
|
|
64
|
-
* renderer's actual default is `color-mix(in srgb, currentColor 22%,
|
|
65
|
-
* transparent)`, which the picker can't parse either; we approximate it
|
|
66
|
-
* by reading the document foreground colour and setting alpha to 0.22.
|
|
94
|
+
* Best-effort preview colour for the wizard's `Empty Colour` picker.
|
|
67
95
|
*/
|
|
68
96
|
const getDisplayedEmptyColor = (rating) => {
|
|
69
97
|
if (rating.EmptyColor)
|
|
@@ -82,63 +110,17 @@ const getDisplayedEmptyColor = (rating) => {
|
|
|
82
110
|
}
|
|
83
111
|
return 'rgba(127, 127, 127, 0.22)';
|
|
84
112
|
};
|
|
85
|
-
// ---------------------------------------------------------------------------
|
|
86
|
-
// Inline preview (also reused by the wizard summary so the user sees a
|
|
87
|
-
// pixel-accurate idea of the resulting cell at all times).
|
|
88
|
-
// ---------------------------------------------------------------------------
|
|
89
|
-
const ICON_PATHS = {
|
|
90
|
-
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',
|
|
91
|
-
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',
|
|
92
|
-
Circle: 'M12 4 a8 8 0 1 0 0.0001 0 Z',
|
|
93
|
-
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',
|
|
94
|
-
};
|
|
95
|
-
const clamp = (n, lo, hi) => Math.max(lo, Math.min(hi, n));
|
|
96
|
-
function getRatingCellChromeCss(cell) {
|
|
97
|
-
if (!cell || !(0, StyleHelper_1.hasCellBoxStyle)(cell)) {
|
|
98
|
-
return {};
|
|
99
|
-
}
|
|
100
|
-
return (0, StyleHelper_1.convertAdaptableStyleToCSS)(cell);
|
|
101
|
-
}
|
|
102
|
-
const RatingPreview = ({ rating, value, }) => {
|
|
103
|
-
const max = rating.Max ?? DEFAULT_MAX;
|
|
104
|
-
const size = rating.Size ?? DEFAULT_SIZE;
|
|
105
|
-
const gap = rating.Gap ?? DEFAULT_GAP;
|
|
106
|
-
const icon = rating.Icon ?? DEFAULT_ICON;
|
|
107
|
-
const filledColor = rating.FilledColor ?? DEFAULT_FILLED_COLOR;
|
|
108
|
-
const emptyColor = rating.EmptyColor ?? DEFAULT_EMPTY_COLOR;
|
|
109
|
-
const allowHalf = rating.AllowHalf ?? true;
|
|
110
|
-
const previewValue = value ?? Math.max(1, Math.min(max, max * 0.7));
|
|
111
|
-
const effective = allowHalf ? previewValue : Math.round(previewValue);
|
|
112
|
-
const d = ICON_PATHS[icon];
|
|
113
|
-
return ((0, jsx_runtime_1.jsxs)("span", { style: {
|
|
114
|
-
display: 'inline-flex',
|
|
115
|
-
alignItems: 'center',
|
|
116
|
-
gap: `${gap}px`,
|
|
117
|
-
lineHeight: 1,
|
|
118
|
-
}, "aria-hidden": "true", children: [Array.from({ length: max }).map((_, i) => {
|
|
119
|
-
const fill = clamp(effective - i, 0, 1);
|
|
120
|
-
const clipId = `ab-rating-preview-clip-${i}-${icon}-${size}`;
|
|
121
|
-
return ((0, jsx_runtime_1.jsxs)("svg", { width: size, height: size, viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("path", { d: d, fill: emptyColor }), fill > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: clipId, children: (0, jsx_runtime_1.jsx)("rect", { x: 0, y: 0, width: 24 * fill, height: 24 }) }) }), (0, jsx_runtime_1.jsx)("path", { d: d, fill: filledColor, clipPath: `url(#${clipId})` })] }))] }, i));
|
|
122
|
-
}), rating.ShowValue && ((0, jsx_runtime_1.jsx)("span", { style: { marginLeft: 6, fontVariantNumeric: 'tabular-nums' }, children: previewValue }))] }));
|
|
123
|
-
};
|
|
124
|
-
// ---------------------------------------------------------------------------
|
|
125
|
-
// Wizard summary
|
|
126
|
-
// ---------------------------------------------------------------------------
|
|
127
113
|
const renderStyledColumnRatingSummary = (data) => {
|
|
128
114
|
const rating = data.RatingStyle;
|
|
129
115
|
if (!rating) {
|
|
130
116
|
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Styling Defined" });
|
|
131
117
|
}
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-2 twa:flex-wrap", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:inline-flex twa:items-center twa:gap-2 twa:box-border", style: getRatingCellChromeCss(rating.Cell), children: (0, jsx_runtime_1.jsx)(RatingPreview, { rating: rating }) }), (0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: ["Out of ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: max })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: ["Icon: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: icon })] }), toolTipTokens.length > 0 && ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: ["Tooltip: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: toolTipTokens.join(', ') })] })), cellTags && (0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: ["Cell: ", cellTags] })] }));
|
|
118
|
+
const items = buildStyledColumnRatingStyleSummaryStrings(rating, {
|
|
119
|
+
includeEmptyTooltip: true,
|
|
120
|
+
});
|
|
121
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: items.map((item) => ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: item }, item))) }));
|
|
137
122
|
};
|
|
138
123
|
exports.renderStyledColumnRatingSummary = renderStyledColumnRatingSummary;
|
|
139
|
-
// ---------------------------------------------------------------------------
|
|
140
|
-
// Wizard validation
|
|
141
|
-
// ---------------------------------------------------------------------------
|
|
142
124
|
const isValidRatingStyle = (data) => {
|
|
143
125
|
const rating = data.RatingStyle;
|
|
144
126
|
if (!rating) {
|
|
@@ -173,8 +155,7 @@ const StyledColumnWizardRatingSection = (props) => {
|
|
|
173
155
|
: current.filter((t) => t !== token);
|
|
174
156
|
update({ ToolTipText: next });
|
|
175
157
|
};
|
|
176
|
-
|
|
177
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:mb-3 twa:p-3 twa:rounded-standard twa:border twa:border-border twa:gap-3", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-3 twa:font-medium", children: "Preview:" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:inline-flex twa:items-center twa:box-border", style: previewCellChrome, children: (0, jsx_runtime_1.jsx)(RatingPreview, { rating: rating }) }), (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-2 twa:opacity-70", children: ["(sample value ", (rating.Max ?? DEFAULT_MAX) * 0.7, ")"] })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsx)(Card_1.Card.Title, { children: "Icon" }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Max:", children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsx)(Input_1.default, { type: "number", min: 1, step: 1, value: rating.Max ?? '', placeholder: String(DEFAULT_MAX), style: { width: 80 }, onChange: (event) => {
|
|
158
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsx)(Card_1.Card.Title, { children: "Icon" }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Max:", children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsx)(Input_1.default, { type: "number", min: 1, step: 1, value: rating.Max ?? '', placeholder: String(StyledColumnRatingPreview_1.DEFAULT_RATING_MAX), style: { width: 80 }, onChange: (event) => {
|
|
178
159
|
const raw = event.target.value;
|
|
179
160
|
if (raw === '' || raw == null) {
|
|
180
161
|
update({ Max: undefined });
|
|
@@ -184,7 +165,7 @@ const StyledColumnWizardRatingSection = (props) => {
|
|
|
184
165
|
update({
|
|
185
166
|
Max: Number.isFinite(parsed) && parsed >= 1 ? Math.floor(parsed) : undefined,
|
|
186
167
|
});
|
|
187
|
-
} }), (0, jsx_runtime_1.jsx)(Flex_1.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)" })] }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Icon:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: rating.Icon ??
|
|
168
|
+
} }), (0, jsx_runtime_1.jsx)(Flex_1.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)" })] }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Icon:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: rating.Icon ?? StyledColumnRatingPreview_1.DEFAULT_RATING_ICON, onValueChange: (v) => update({ Icon: v }), items: ICON_CHOICES }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Filled Colour:", children: (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { disabled: disabled, api: api, value: getDisplayedFilledColor(rating), onChange: (c) => update({ FilledColor: c }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Empty Colour:", children: (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { disabled: disabled, api: api, value: getDisplayedEmptyColor(rating), onChange: (c) => update({ EmptyColor: c }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Icon Size (px):", children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsx)(Input_1.default, { type: "number", min: 4, step: 1, value: rating.Size ?? '', placeholder: String(StyledColumnRatingPreview_1.DEFAULT_RATING_SIZE), style: { width: 80 }, onChange: (event) => {
|
|
188
169
|
const raw = event.target.value;
|
|
189
170
|
if (raw === '' || raw == null) {
|
|
190
171
|
update({ Size: undefined });
|
|
@@ -194,7 +175,7 @@ const StyledColumnWizardRatingSection = (props) => {
|
|
|
194
175
|
update({
|
|
195
176
|
Size: Number.isFinite(parsed) && parsed >= 4 ? parsed : undefined,
|
|
196
177
|
});
|
|
197
|
-
} }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Square pixel size of each icon" })] }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Icon Gap (px):", children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsx)(Input_1.default, { type: "number", min: 0, step: 1, value: rating.Gap ?? '', placeholder: String(
|
|
178
|
+
} }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Square pixel size of each icon" })] }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Icon Gap (px):", children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsx)(Input_1.default, { type: "number", min: 0, step: 1, value: rating.Gap ?? '', placeholder: String(StyledColumnRatingPreview_1.DEFAULT_RATING_GAP), style: { width: 80 }, onChange: (event) => {
|
|
198
179
|
const raw = event.target.value;
|
|
199
180
|
if (raw === '' || raw == null) {
|
|
200
181
|
update({ Gap: undefined });
|
|
@@ -204,7 +185,7 @@ const StyledColumnWizardRatingSection = (props) => {
|
|
|
204
185
|
update({
|
|
205
186
|
Gap: Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined,
|
|
206
187
|
});
|
|
207
|
-
} }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Pixel space between adjacent icons" })] }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Allow Half Icons:", children: (0, jsx_runtime_1.jsx)(CheckBox_1.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)" }) })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsx)(Card_1.Card.Title, { children: "Text" }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Show Value:", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, className: "twa:ml-2", checked: rating.ShowValue ?? false, onChange: (checked) => update({ ShowValue: checked }), children: "Display the numeric value beside the icons" }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Tooltip:", children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-1 twa:ml-2", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('CellValue') ?? false, onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('PercentageValue') ?? false, onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percentage Value (value \u00F7 Max)" })] }) })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Cell" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[500px]", children: "Optional Cell Style properties overrides Format Column properties)" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(StyledColumnSliceStyleEditors_1.StyledColumnCellStyleEditor, { api: api, disabled: disabled, value: rating.Cell, onChange: (next) => {
|
|
188
|
+
} }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:min-w-0 twa:shrink", children: "Pixel space between adjacent icons" })] }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Allow Half Icons:", children: (0, jsx_runtime_1.jsx)(CheckBox_1.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)" }) })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsx)(Card_1.Card.Title, { children: "Text" }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Show Value:", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, className: "twa:ml-2", checked: rating.ShowValue ?? false, onChange: (checked) => update({ ShowValue: checked }), children: "Display the numeric value beside the icons" }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Tooltip:", children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-1 twa:ml-2", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('CellValue') ?? false, onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, checked: rating.ToolTipText?.includes('PercentageValue') ?? false, onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percentage Value (value \u00F7 Max)" })] }) })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Cell" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[500px]", children: "Optional Cell Style properties overrides Format Column properties)" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(StyledColumnSliceStyleEditors_1.StyledColumnCellStyleEditor, { api: api, disabled: disabled, value: rating.Cell, onChange: (next) => {
|
|
208
189
|
if (next) {
|
|
209
190
|
update({ Cell: next });
|
|
210
191
|
}
|
|
@@ -213,6 +194,6 @@ const StyledColumnWizardRatingSection = (props) => {
|
|
|
213
194
|
delete cleaned.Cell;
|
|
214
195
|
props.onChange({ ...data, RatingStyle: cleaned });
|
|
215
196
|
}
|
|
216
|
-
} }) })] })] }));
|
|
197
|
+
} }) })] }), (0, jsx_runtime_1.jsx)(StyledColumnRatingPreview_1.StyledColumnRatingPreviewCard, { data: data })] }));
|
|
217
198
|
};
|
|
218
199
|
exports.StyledColumnWizardRatingSection = StyledColumnWizardRatingSection;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BulletRangesSummaryPreview = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Flex_1 = require("../../../../../components/Flex");
|
|
6
|
+
const Tag_1 = require("../../../../../components/Tag");
|
|
7
|
+
const StyleHelper_1 = require("../../../../../Utilities/Helpers/StyleHelper");
|
|
8
|
+
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)]';
|
|
9
|
+
const BulletRangesSummaryPreview = ({ bulletStyle }) => {
|
|
10
|
+
const ranges = bulletStyle.CellRanges ?? [];
|
|
11
|
+
if (!ranges.length) {
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No bands defined" });
|
|
13
|
+
}
|
|
14
|
+
let postfix = '';
|
|
15
|
+
if (bulletStyle.RangeValueType === 'Percentage') {
|
|
16
|
+
postfix = '%';
|
|
17
|
+
}
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2", children: ranges.map((range, i) => ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: [range.Min, postfix, " \u2192 ", range.Max, postfix] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: stripClassName, style: { background: (0, StyleHelper_1.getVariableColor)(range.Color) } })] }, i))) }));
|
|
19
|
+
};
|
|
20
|
+
exports.BulletRangesSummaryPreview = BulletRangesSummaryPreview;
|
|
@@ -6,6 +6,7 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const tinycolor2_1 = tslib_1.__importDefault(require("tinycolor2"));
|
|
8
8
|
const Flex_1 = require("../../../../../components/Flex");
|
|
9
|
+
const Tag_1 = require("../../../../../components/Tag");
|
|
9
10
|
const StyleHelper_1 = require("../../../../../Utilities/Helpers/StyleHelper");
|
|
10
11
|
const StyledColumnGradientHelper_1 = require("../../../../../Utilities/Helpers/StyledColumnGradientHelper");
|
|
11
12
|
function clamp01(n) {
|
|
@@ -24,16 +25,9 @@ function gradientRangeStripCss(color, reverseGradient, minAlpha, maxAlpha) {
|
|
|
24
25
|
const c2 = (0, tinycolor2_1.default)(prepared).setAlpha(rightA).toRgbString();
|
|
25
26
|
return `linear-gradient(to right, ${c1}, ${c2})`;
|
|
26
27
|
}
|
|
27
|
-
function isDivergingZeroPair(ranges) {
|
|
28
|
-
if (!ranges || ranges.length !== 2) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
const [a, b] = ranges;
|
|
32
|
-
return a.Max === 0 && b.Min === 0;
|
|
33
|
-
}
|
|
34
28
|
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)]';
|
|
35
29
|
function zeroCentredSplitPreview(negativeColor, positiveColor, postfix, minA, maxA) {
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: ["Col-Min", postfix, " \u2192 0", postfix] }), (0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: ["0", postfix, " \u2192 Col-Max", postfix] })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: `${stripClassName} twa:w-[200px]`, children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1", style: {
|
|
37
31
|
background: gradientRangeStripCss(negativeColor, true, minA, maxA),
|
|
38
32
|
} }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1", style: {
|
|
39
33
|
background: gradientRangeStripCss(positiveColor, false, minA, maxA),
|
|
@@ -52,15 +46,15 @@ const GradientRangesSummaryPreview = (props) => {
|
|
|
52
46
|
return zeroCentredSplitPreview(props.zeroCentred.NegativeColor, props.zeroCentred.PositiveColor, postfix, minA, maxA);
|
|
53
47
|
}
|
|
54
48
|
const ranges = props.ranges ?? [];
|
|
55
|
-
if (
|
|
49
|
+
if ((0, StyledColumnGradientHelper_1.isDivergingZeroCellRanges)(ranges)) {
|
|
56
50
|
const [r0, r1] = ranges;
|
|
57
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: [r0.Min, postfix, " \u2192 ", r0.Max, postfix] }), (0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: [r1.Min, postfix, " \u2192 ", r1.Max, postfix] })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: `${stripClassName} twa:w-[200px]`, children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1", style: {
|
|
58
52
|
background: gradientRangeStripCss(r0.Color, !!r0.ReverseGradient, minA, maxA),
|
|
59
53
|
} }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1", style: {
|
|
60
54
|
background: gradientRangeStripCss(r1.Color, !!r1.ReverseGradient, minA, maxA),
|
|
61
55
|
} })] })] }));
|
|
62
56
|
}
|
|
63
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2", children: ranges.map((r, i) => ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2", children: ranges.map((r, i) => ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: [r.Min, postfix, " \u2192 ", r.Max, postfix] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: stripClassName, style: {
|
|
64
58
|
background: gradientRangeStripCss(r.Color, !!r.ReverseGradient, minA, maxA),
|
|
65
59
|
} })] }, i))) }));
|
|
66
60
|
};
|
|
@@ -71,7 +65,7 @@ const GradientColumnComparisonSummaryPreview = (props) => {
|
|
|
71
65
|
const fmt = (v) => isNaN(Number(v))
|
|
72
66
|
? `[${props.api.columnApi.getFriendlyNameForColumnId(String(v))}]`
|
|
73
67
|
: v;
|
|
74
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: ["Min: ", fmt(props.columnComparison.MinValue), " \u2014 Max: ", fmt(props.columnComparison.MaxValue)] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: `${stripClassName} twa:w-[200px]`, style: {
|
|
75
69
|
background: gradientRangeStripCss(props.columnComparison.Color, false, minA, maxA),
|
|
76
70
|
} })] }));
|
|
77
71
|
};
|
|
@@ -5,13 +5,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const AdaptableContext_1 = require("../../../../AdaptableContext");
|
|
6
6
|
const PercentBarStylePreview_1 = require("./PercentBarStylePreview");
|
|
7
7
|
const Flex_1 = require("../../../../../components/Flex");
|
|
8
|
+
const Tag_1 = require("../../../../../components/Tag");
|
|
8
9
|
const PercentBarColumnComparisonPreview = (props) => {
|
|
9
10
|
const { api } = (0, AdaptableContext_1.useAdaptable)();
|
|
10
11
|
const columnComparison = props.percentBarStyle.ColumnComparison;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
: columnComparison.MaxValue, ' '] }), (0, jsx_runtime_1.jsx)(PercentBarStylePreview_1.PercentBarStylePreview, { backgroundColor: columnComparison.Color, barBackgroundColor: props.percentBarStyle.BackColor, cellText: props.percentBarStyle.CellText, toolTipText: props.percentBarStyle.ToolTipText })] }));
|
|
12
|
+
const fmt = (v) => isNaN(Number(v))
|
|
13
|
+
? `[${api.columnApi.getFriendlyNameForColumnId(String(v))}]`
|
|
14
|
+
: v;
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: ["Min: ", fmt(columnComparison.MinValue), " \u2014 Max: ", fmt(columnComparison.MaxValue)] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[200px]", children: (0, jsx_runtime_1.jsx)(PercentBarStylePreview_1.PercentBarStylePreview, { backgroundColor: props.percentBarStyle.BackColor, barBackgroundColor: columnComparison.Color }) })] }));
|
|
16
16
|
};
|
|
17
17
|
exports.PercentBarColumnComparisonPreview = PercentBarColumnComparisonPreview;
|