@adaptabletools/adaptable 23.0.0-canary.8 → 23.0.0-canary.9
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 +29 -14
- package/package.json +1 -1
- package/src/{Utilities → AdaptableState/Aggregations}/weightedAverage.js +1 -1
- package/src/AdaptableState/Common/Enums.d.ts +0 -12
- package/src/AdaptableState/Common/Enums.js +0 -15
- package/src/{Utilities → AdaptableState/Common}/MenuItem.d.ts +4 -4
- package/src/{Utilities → AdaptableState/Common}/MenuItem.js +1 -1
- package/src/AdaptableState/StyledColumns/BulletChartStyle.d.ts +5 -5
- package/src/AdaptableState/StyledColumns/Common/{BarChartCellText.d.ts → BarStyleProperties.d.ts} +34 -10
- package/src/AdaptableState/StyledColumns/GradientStyle.d.ts +2 -2
- package/src/AdaptableState/StyledColumns/PercentBarStyle.d.ts +2 -2
- package/src/AdaptableState/StyledColumns/RangeBarStyle.d.ts +5 -5
- package/src/Api/Implementation/AlertApiImpl.js +1 -1
- package/src/Api/Implementation/ChartingApiImpl.js +1 -1
- package/src/Api/Implementation/ExportApiImpl.js +1 -1
- package/src/Api/Implementation/LayoutHelpers.js +1 -1
- package/src/Api/Implementation/QuickSearchApiImpl.js +1 -1
- package/src/Api/Implementation/ThemeApiImpl.js +1 -1
- package/src/Api/Internal/ActionColumnInternalApi.js +1 -1
- package/src/Api/Internal/AlertInternalApi.js +1 -1
- package/src/Api/Internal/ChartingInternalApi.js +1 -1
- package/src/Api/Internal/ColumnInternalApi.js +1 -1
- package/src/Api/Internal/EventInternalApi.js +1 -1
- package/src/Api/Internal/ExportInternalApi.js +1 -1
- package/src/Api/Internal/FormatColumnInternalApi.js +1 -1
- package/src/Api/Internal/GridInternalApi.js +1 -1
- package/src/Api/Internal/StyledColumnInternalApi.js +1 -1
- package/src/Redux/ActionsReducers/ExportRedux.js +1 -1
- package/src/Redux/ActionsReducers/InternalRedux.js +1 -1
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +2 -4
- package/src/Redux/Store/AdaptableStore.js +3 -3
- package/src/Strategy/AdaptableModuleBase.d.ts +1 -1
- package/src/Strategy/AdaptableModuleBase.js +1 -1
- package/src/Strategy/AlertModule.d.ts +1 -1
- package/src/Strategy/AlertModule.js +2 -2
- package/src/Strategy/BulkUpdateModule.d.ts +1 -1
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -2
- package/src/Strategy/CellSummaryModule.d.ts +2 -2
- package/src/Strategy/ChartingModule.d.ts +1 -1
- package/src/Strategy/ChartingModule.js +1 -1
- package/src/Strategy/ColumnInfoModule.d.ts +2 -2
- package/src/Strategy/CommentModule.d.ts +1 -1
- package/src/Strategy/CustomSortModule.d.ts +1 -1
- package/src/Strategy/ExportModule.js +2 -2
- package/src/Strategy/FlashingCellModule.d.ts +1 -1
- package/src/Strategy/FreeTextColumnModule.d.ts +1 -1
- package/src/Strategy/GridInfoModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.js +1 -1
- package/src/Strategy/NoteModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/SettingsPanelModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.d.ts +1 -1
- package/src/Strategy/SystemStatusModule.d.ts +2 -2
- package/src/Strategy/TeamSharingModule.js +2 -2
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +32 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +49 -0
- package/src/Utilities/Extensions/NumberExtensions.d.ts +21 -0
- package/src/Utilities/Extensions/NumberExtensions.js +74 -0
- package/src/Utilities/Extensions/ObjectExtensions.d.ts +44 -0
- package/src/Utilities/Extensions/ObjectExtensions.js +271 -0
- package/src/Utilities/Extensions/StringExtensions.d.ts +26 -0
- package/src/Utilities/Extensions/StringExtensions.js +44 -1
- package/src/Utilities/Helpers/AdaptableHelper.js +2 -2
- package/src/Utilities/Helpers/{alertFormHelper.js → AlertHelper.js} +1 -1
- package/src/Utilities/Helpers/DateHelper.js +1 -1
- package/src/Utilities/Helpers/{FormatHelper.js → DisplayFormatHelper.js} +1 -1
- package/src/Utilities/Helpers/Helper.d.ts +0 -6
- package/src/Utilities/Helpers/Helper.js +0 -35
- package/src/Utilities/Helpers/{QuickSearchStyleHelper.js → QuickSearchHelper.js} +1 -1
- package/src/Utilities/Helpers/{ScheduleHelper.d.ts → Scheduling/ScheduleHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduleHelper.js → Scheduling/ScheduleHelper.js} +1 -1
- package/src/Utilities/Helpers/{ScheduleJobManager.d.ts → Scheduling/ScheduleJobManager.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduleJobRunner.d.ts → Scheduling/ScheduleJobRunner.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledAlertHelper.d.ts → Scheduling/ScheduledAlertHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledAlertHelper.js → Scheduling/ScheduledAlertHelper.js} +4 -4
- package/src/Utilities/Helpers/{ScheduledJobsMiddlewareHelper.d.ts → Scheduling/ScheduledJobsMiddlewareHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledJobsMiddlewareHelper.js → Scheduling/ScheduledJobsMiddlewareHelper.js} +1 -1
- package/src/Utilities/Helpers/{ScheduledReportHelper.d.ts → Scheduling/ScheduledReportHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledReportHelper.js → Scheduling/ScheduledReportHelper.js} +1 -1
- package/src/Utilities/Helpers/SettingsPanelHelper.d.ts +5 -0
- package/src/Utilities/{Defaults/DefaultSettingsPanel.js → Helpers/SettingsPanelHelper.js} +14 -0
- package/src/Utilities/Helpers/StyledColumns/BarStylesHelper.d.ts +63 -0
- package/src/Utilities/Helpers/{barChartCellText.js → StyledColumns/BarStylesHelper.js} +33 -32
- package/src/Utilities/Helpers/{StyledColumnGradientHelper.d.ts → StyledColumns/GradientStyleHelper.d.ts} +4 -4
- package/src/Utilities/Helpers/{StyledColumnGradientHelper.js → StyledColumns/GradientStyleHelper.js} +3 -3
- package/src/Utilities/Helpers/{IconStylePresets.d.ts → StyledColumns/IconStyleHelper.d.ts} +6 -1
- package/src/Utilities/Helpers/{IconStylePresets.js → StyledColumns/IconStyleHelper.js} +15 -0
- package/src/Utilities/Helpers/{percentBarPreviewHelper.d.ts → StyledColumns/PercentBarStyleHelper.d.ts} +2 -2
- package/src/Utilities/Helpers/{percentBarPreviewHelper.js → StyledColumns/PercentBarStyleHelper.js} +7 -7
- package/src/Utilities/Helpers/{SparklineOptionsHelper.js → StyledColumns/SparklineStyleHelper.js} +1 -1
- package/src/Utilities/Helpers/StyledColumns/StyledColumnHelper.d.ts +52 -0
- package/src/{agGrid/cellRenderers/shouldRenderStyledColumnOnRow.js → Utilities/Helpers/StyledColumns/StyledColumnHelper.js} +64 -2
- package/src/Utilities/Helpers/TimingHelper.d.ts +34 -0
- package/src/Utilities/{utils/debounce.js → Helpers/TimingHelper.js} +23 -9
- package/src/Utilities/ObjectFactory.js +1 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +2 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +114 -1
- package/src/Utilities/Services/LicenseService/index.js +1 -1
- package/src/Utilities/Services/RowSummaryService.d.ts +1 -1
- package/src/Utilities/Services/RowSummaryService.js +4 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +1 -1
- package/src/View/Alert/Utilities/getAlertType.js +1 -1
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +1 -1
- package/src/View/Alert/Utilities/mapAlertDefinition.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +1 -1
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +2 -2
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertWizard.js +1 -1
- package/src/View/Alert/Wizard/isValidAlertRules.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +1 -1
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +1 -1
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Comments/CommentsPopup.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +1 -1
- package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +1 -1
- package/src/View/Components/Forms/AdaptableFormControlTextClear.js +2 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
- package/src/View/Components/Popups/Utilities.js +1 -1
- package/src/View/Components/RangesComponent.d.ts +3 -3
- package/src/View/Components/RangesComponent.js +3 -7
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Dashboard/CustomDashboardButton.js +1 -1
- package/src/View/Dashboard/Dashboard.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryTable.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +3 -3
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +1 -1
- package/src/View/Note/NoteEditor.js +1 -1
- package/src/View/Note/NotePopup.js +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +1 -1
- package/src/View/QuickSearch/useQuickSearchDebounced.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +1 -1
- package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +16 -20
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +14 -16
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/{BarChartCellTextLayoutEditor.d.ts → BarStyleCellTextLayoutEditor.d.ts} +4 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor.js +33 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/{BarChartCellTextPreview.d.ts → BarStyleCellTextPreview.d.ts} +6 -6
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/{BarChartCellTextPreview.js → BarStyleCellTextPreview.js} +6 -6
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.d.ts +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +2 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +7 -7
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +11 -9
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +7 -7
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +11 -15
- package/src/View/UIHelper.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
- package/src/View/Wizard/OnePageWizards.js +3 -1
- package/src/agGrid/AdaptableAgGrid.js +6 -6
- package/src/agGrid/AgGridColumnAdapter.js +16 -15
- package/src/agGrid/AgGridExportAdapter.js +1 -1
- package/src/agGrid/AgGridMenuAdapter.js +127 -2
- package/src/agGrid/cellRenderers/BadgeRenderer.js +1 -1
- package/src/agGrid/cellRenderers/BulletChartRenderer.js +6 -6
- package/src/agGrid/cellRenderers/IconRenderer.js +2 -3
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +6 -6
- package/src/agGrid/cellRenderers/RangeBarRenderer.js +7 -8
- package/src/agGrid/cellRenderers/RatingRenderer.js +2 -2
- package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
- package/src/components/ColorPicker/ColorPicker.js +1 -1
- package/src/components/Datepicker/index.js +1 -1
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/OverlayTrigger/index.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/isLayoutEqual.js +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +41 -8
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade23.js +2 -2
- package/src/types.d.ts +3 -3
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableState/StyledColumns/Common/BarChartCellText.js +0 -6
- package/src/AdaptableState/StyledColumns/Common/BarChartMarker.d.ts +0 -24
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +0 -3
- package/src/Utilities/Helpers/barChartCellText.d.ts +0 -63
- package/src/Utilities/Helpers/iconStyledColumnColumnSupport.d.ts +0 -5
- package/src/Utilities/Helpers/iconStyledColumnColumnSupport.js +0 -15
- package/src/Utilities/Helpers/resolveSettingsPanelNavigation.d.ts +0 -3
- package/src/Utilities/Helpers/resolveSettingsPanelNavigation.js +0 -15
- package/src/Utilities/Helpers/styledColumnRowKindSupport.d.ts +0 -25
- package/src/Utilities/Helpers/styledColumnRowKindSupport.js +0 -63
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +0 -4
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +0 -115
- package/src/Utilities/utils/chunk.d.ts +0 -6
- package/src/Utilities/utils/chunk.js +0 -17
- package/src/Utilities/utils/clamp.d.ts +0 -5
- package/src/Utilities/utils/clamp.js +0 -7
- package/src/Utilities/utils/cloneDeepWith.d.ts +0 -9
- package/src/Utilities/utils/cloneDeepWith.js +0 -67
- package/src/Utilities/utils/debounce.d.ts +0 -20
- package/src/Utilities/utils/flatten.d.ts +0 -5
- package/src/Utilities/utils/flatten.js +0 -7
- package/src/Utilities/utils/flattenDeep.d.ts +0 -5
- package/src/Utilities/utils/flattenDeep.js +0 -7
- package/src/Utilities/utils/get.d.ts +0 -6
- package/src/Utilities/utils/get.js +0 -35
- package/src/Utilities/utils/index.d.ts +0 -22
- package/src/Utilities/utils/index.js +0 -22
- package/src/Utilities/utils/isArray.d.ts +0 -6
- package/src/Utilities/utils/isArray.js +0 -6
- package/src/Utilities/utils/isEqual.d.ts +0 -5
- package/src/Utilities/utils/isEqual.js +0 -124
- package/src/Utilities/utils/isObject.d.ts +0 -6
- package/src/Utilities/utils/isObject.js +0 -9
- package/src/Utilities/utils/isPlainObject.d.ts +0 -6
- package/src/Utilities/utils/isPlainObject.js +0 -17
- package/src/Utilities/utils/kebabCase.d.ts +0 -5
- package/src/Utilities/utils/kebabCase.js +0 -8
- package/src/Utilities/utils/merge.d.ts +0 -11
- package/src/Utilities/utils/merge.js +0 -40
- package/src/Utilities/utils/mergeWith.d.ts +0 -7
- package/src/Utilities/utils/mergeWith.js +0 -46
- package/src/Utilities/utils/orderBy.d.ts +0 -8
- package/src/Utilities/utils/orderBy.js +0 -30
- package/src/Utilities/utils/parseInt.d.ts +0 -6
- package/src/Utilities/utils/parseInt.js +0 -9
- package/src/Utilities/utils/sentenceCase.d.ts +0 -6
- package/src/Utilities/utils/sentenceCase.js +0 -15
- package/src/Utilities/utils/startCase.d.ts +0 -5
- package/src/Utilities/utils/startCase.js +0 -11
- package/src/Utilities/utils/throttle.d.ts +0 -17
- package/src/Utilities/utils/throttle.js +0 -19
- package/src/Utilities/utils/toNumber.d.ts +0 -5
- package/src/Utilities/utils/toNumber.js +0 -39
- package/src/Utilities/utils/uniq.d.ts +0 -7
- package/src/Utilities/utils/uniq.js +0 -9
- package/src/Utilities/utils/uniqBy.d.ts +0 -8
- package/src/Utilities/utils/uniqBy.js +0 -22
- package/src/Utilities/utils/words.d.ts +0 -7
- package/src/Utilities/utils/words.js +0 -10
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarChartCellTextLayoutEditor.js +0 -35
- package/src/agGrid/buildValueAggregationMenuItem.d.ts +0 -19
- package/src/agGrid/buildValueAggregationMenuItem.js +0 -111
- package/src/agGrid/cellRenderers/shouldRenderStyledColumnOnRow.d.ts +0 -30
- package/src/agGrid/createAgGridIcon.d.ts +0 -10
- package/src/agGrid/createAgGridIcon.js +0 -16
- /package/src/{Utilities → AdaptableState/Aggregations}/only.d.ts +0 -0
- /package/src/{Utilities → AdaptableState/Aggregations}/only.js +0 -0
- /package/src/{Utilities → AdaptableState/Aggregations}/weightedAverage.d.ts +0 -0
- /package/src/AdaptableState/StyledColumns/Common/{BarChartMarker.js → BarStyleProperties.js} +0 -0
- /package/src/Utilities/Helpers/{ActionColumnWidthHelper.d.ts → ActionColumnHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ActionColumnWidthHelper.js → ActionColumnHelper.js} +0 -0
- /package/src/Utilities/Helpers/{alertFormHelper.d.ts → AlertHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{chartingHelper.d.ts → ChartHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{chartingHelper.js → ChartHelper.js} +0 -0
- /package/src/Utilities/Helpers/{FormatHelper.d.ts → DisplayFormatHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{plusMinusTriggerKeys.d.ts → PlusMinusHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{plusMinusTriggerKeys.js → PlusMinusHelper.js} +0 -0
- /package/src/Utilities/Helpers/{QuickSearchStyleHelper.d.ts → QuickSearchHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ScheduleJobManager.js → Scheduling/ScheduleJobManager.js} +0 -0
- /package/src/Utilities/Helpers/{ScheduleJobRunner.js → Scheduling/ScheduleJobRunner.js} +0 -0
- /package/src/Utilities/Helpers/{SparklineOptionsHelper.d.ts → StyledColumns/SparklineStyleHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ThemeHelpers.d.ts → ThemeHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ThemeHelpers.js → ThemeHelper.js} +0 -0
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
|
|
4
4
|
import { connect } from 'react-redux';
|
|
5
|
-
import isEqual from '../../Utilities/
|
|
5
|
+
import { isEqual } from '../../Utilities/Extensions/ObjectExtensions';
|
|
6
6
|
import join from '../../components/utils/join';
|
|
7
7
|
import * as LayoutRedux from '../../Redux/ActionsReducers/LayoutRedux';
|
|
8
8
|
import * as GeneralConstants from '../../Utilities/Constants/GeneralConstants';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import throttle from '../../Utilities/
|
|
2
|
+
import { throttle } from '../../Utilities/Helpers/TimingHelper';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import Textarea from '../../components/Textarea';
|
|
5
5
|
import SimpleButton from '../../components/SimpleButton';
|
|
@@ -7,7 +7,7 @@ import { useAdaptable } from '../AdaptableContext';
|
|
|
7
7
|
import { AdaptableButtonComponent } from '../Components/AdaptableButton';
|
|
8
8
|
import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
|
|
9
9
|
import StringExtensions from '../../Utilities/Extensions/StringExtensions';
|
|
10
|
-
import FormatHelper from '../../Utilities/Helpers/
|
|
10
|
+
import FormatHelper from '../../Utilities/Helpers/DisplayFormatHelper';
|
|
11
11
|
import { ACCESS_LEVEL_READ_ONLY } from '../../Utilities/Constants/GeneralConstants';
|
|
12
12
|
const tableDOMProps = {
|
|
13
13
|
style: {
|
|
@@ -5,7 +5,7 @@ import { SummaryText, useOnePageAdaptableWizardContext, } from '../../Wizard/One
|
|
|
5
5
|
import { Tag } from '../../../components/Tag';
|
|
6
6
|
import { Box, Flex } from '../../../components/Flex';
|
|
7
7
|
import { Card } from '../../../components/Card';
|
|
8
|
-
import { plusMinusDecrementKeyFromOptionsOnly, plusMinusIncrementKeyFromOptionsOnly, plusMinusResolvedKeysConflict, plusMinusTriggerSameAsBaseline, resolvePlusMinusTriggerKeysForNudge, } from '../../../Utilities/Helpers/
|
|
8
|
+
import { plusMinusDecrementKeyFromOptionsOnly, plusMinusIncrementKeyFromOptionsOnly, plusMinusResolvedKeysConflict, plusMinusTriggerSameAsBaseline, resolvePlusMinusTriggerKeysForNudge, } from '../../../Utilities/Helpers/PlusMinusHelper';
|
|
9
9
|
export const PlusMinusSettingsSummary = () => {
|
|
10
10
|
const { data, api } = useOnePageAdaptableWizardContext();
|
|
11
11
|
const { incrementKey, decrementKey } = resolvePlusMinusTriggerKeysForNudge(data, api.optionsApi.getEditOptions().plusMinusOptions ?? {});
|
|
@@ -11,7 +11,7 @@ import StringExtensions from '../../Utilities/Extensions/StringExtensions';
|
|
|
11
11
|
import { useQuickSearchDebounced } from './useQuickSearchDebounced';
|
|
12
12
|
import { QuickSearchInput } from './QuickSearchInput';
|
|
13
13
|
import { Card } from '../../components/Card';
|
|
14
|
-
import { isQuickSearchStyleUnset, resolveQuickSearchCurrentTextMatchStyle, resolveQuickSearchTextMatchStyle, } from '../../Utilities/Helpers/
|
|
14
|
+
import { isQuickSearchStyleUnset, resolveQuickSearchCurrentTextMatchStyle, resolveQuickSearchTextMatchStyle, } from '../../Utilities/Helpers/QuickSearchHelper';
|
|
15
15
|
const QuickSearchStyleEditor = ({ api, helpText, headerText, style, updateStyle }) => (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: headerText }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: helpText })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(StyleComponent, { headless: true, hidePreview: true, className: "twa:h-full twa:flex-1 twa:rounded-none", api: api, Style: style, UpdateStyle: updateStyle }) })] }));
|
|
16
16
|
const QuickSearchPopupComponent = (props) => {
|
|
17
17
|
const [searchText, search] = useQuickSearchDebounced(props);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState, useMemo } from 'react';
|
|
2
|
-
import debounce from '../../Utilities/
|
|
2
|
+
import { debounce } from '../../Utilities/Helpers/TimingHelper';
|
|
3
3
|
import { QUICK_SEARCH_DEBOUNCE_TIME } from '../../Utilities/Constants/GeneralConstants';
|
|
4
4
|
export const useQuickSearchDebounced = (props) => {
|
|
5
5
|
const [searchText, setSearchText] = useState(props.QuickSearchText ?? '');
|
|
@@ -9,7 +9,7 @@ import { Box } from '../../../components/Flex';
|
|
|
9
9
|
import { Card } from '../../../components/Card';
|
|
10
10
|
import { SingleSelect } from '../../../components/NewSelect';
|
|
11
11
|
import ObjectFactory from '../../../Utilities/ObjectFactory';
|
|
12
|
-
import { buildCronExpression, buildRunAtIso, inferPresetFromCron, isScheduleValid as validateSchedule, parseOneOffDateFromRunAt, parseTimeFromSchedule, } from '../../../Utilities/Helpers/ScheduleHelper';
|
|
12
|
+
import { buildCronExpression, buildRunAtIso, inferPresetFromCron, isScheduleValid as validateSchedule, parseOneOffDateFromRunAt, parseTimeFromSchedule, } from '../../../Utilities/Helpers/Scheduling/ScheduleHelper';
|
|
13
13
|
export const isScheduleValid = (holder) => {
|
|
14
14
|
if (!holder?.Schedule) {
|
|
15
15
|
return 'Schedule is not specified';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import chunk from '../Utilities/
|
|
2
|
+
import { chunk } from '../Utilities/Extensions/ArrayExtensions';
|
|
3
3
|
import { CheckBox } from '../components/CheckBox';
|
|
4
4
|
import FormLayout, { FormRow } from '../components/FormLayout';
|
|
5
5
|
import { useAdaptable } from './AdaptableContext';
|
|
@@ -17,8 +17,8 @@ import { SingleSelect } from '../../../components/NewSelect';
|
|
|
17
17
|
import { getCellFontStyleSummaryItems, StyledColumnFontStyleEditor, } from './StyledColumnSliceStyleEditors';
|
|
18
18
|
import { Card } from '../../../components/Card';
|
|
19
19
|
import { renderSummaryStringTags } from '../../Wizard/SummaryColorTag';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
20
|
+
import { formatBarStyleCellTextLayoutSummary, getActiveBarStyleCellTextTokens, hasBarStyleCellTextConfigured, patchBarStyleCellTextPlacement, resolveBarStyleCellTextLayout, toggleBarStyleCellTextToken, } from '../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
21
|
+
import { BarStyleCellTextLayoutEditor } from './StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor';
|
|
22
22
|
const BULLET_STYLE_FORM_SIZES = ['200px', '1fr'];
|
|
23
23
|
const getTargetSummary = (target) => {
|
|
24
24
|
if (target == undefined) {
|
|
@@ -51,12 +51,8 @@ const formatBulletOriginLabel = (origin) => {
|
|
|
51
51
|
}
|
|
52
52
|
return origin;
|
|
53
53
|
};
|
|
54
|
-
const formatBulletCellTextSummary = (cellText) => cellText
|
|
55
|
-
|
|
56
|
-
.join(' + ') ?? '';
|
|
57
|
-
const formatBulletToolTipSummary = (toolTipText) => toolTipText
|
|
58
|
-
?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value'))
|
|
59
|
-
.join(' + ') ?? '';
|
|
54
|
+
const formatBulletCellTextSummary = (cellText) => cellText?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value')).join(' + ') ?? '';
|
|
55
|
+
const formatBulletToolTipSummary = (toolTipText) => toolTipText?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value')).join(' + ') ?? '';
|
|
60
56
|
export const getStyledColumnBulletRangesViewValues = (data) => {
|
|
61
57
|
const bullet = data.BulletChartStyle;
|
|
62
58
|
if (!bullet) {
|
|
@@ -100,10 +96,10 @@ const buildStyledColumnBulletStyleSummaryStrings = (bullet, options) => {
|
|
|
100
96
|
if (bullet.BackColor) {
|
|
101
97
|
items.push(`Back Colour: ${bullet.BackColor}`);
|
|
102
98
|
}
|
|
103
|
-
if (
|
|
104
|
-
const tokens =
|
|
99
|
+
if (hasBarStyleCellTextConfigured(bullet.CellTextProperties)) {
|
|
100
|
+
const tokens = getActiveBarStyleCellTextTokens(bullet.CellTextProperties);
|
|
105
101
|
items.push(`Cell Text: ${formatBulletCellTextSummary(tokens)}`);
|
|
106
|
-
const layoutSummary =
|
|
102
|
+
const layoutSummary = formatBarStyleCellTextLayoutSummary(resolveBarStyleCellTextLayout(bullet.CellTextProperties));
|
|
107
103
|
if (layoutSummary) {
|
|
108
104
|
items.push(`Placement: ${layoutSummary}`);
|
|
109
105
|
}
|
|
@@ -290,9 +286,7 @@ export const StyledColumnWizardBulletSection = (props) => {
|
|
|
290
286
|
}
|
|
291
287
|
if (mode === 'Column') {
|
|
292
288
|
// Use the first available numeric column (excluding the styled column itself)
|
|
293
|
-
const candidate = api.columnApi
|
|
294
|
-
.getNumericColumns()
|
|
295
|
-
.find((c) => c.columnId !== data.ColumnId);
|
|
289
|
+
const candidate = api.columnApi.getNumericColumns().find((c) => c.columnId !== data.ColumnId);
|
|
296
290
|
setTarget(candidate?.columnId ?? '');
|
|
297
291
|
return;
|
|
298
292
|
}
|
|
@@ -324,11 +318,11 @@ export const StyledColumnWizardBulletSection = (props) => {
|
|
|
324
318
|
};
|
|
325
319
|
// -- Cell text -------------------------------------------------------------
|
|
326
320
|
const toggleCellText = (token, show) => {
|
|
327
|
-
update(
|
|
321
|
+
update(toggleBarStyleCellTextToken(bullet.CellTextProperties, token, show));
|
|
328
322
|
};
|
|
329
323
|
const onCellTextPlacementChange = (token, patch) => {
|
|
330
324
|
update({
|
|
331
|
-
CellTextProperties:
|
|
325
|
+
CellTextProperties: patchBarStyleCellTextPlacement(bullet.CellTextProperties, token, patch),
|
|
332
326
|
});
|
|
333
327
|
};
|
|
334
328
|
const toggleToolTipText = (token, checked) => {
|
|
@@ -358,7 +352,9 @@ export const StyledColumnWizardBulletSection = (props) => {
|
|
|
358
352
|
: typeof primaryTarget?.Value === 'number'
|
|
359
353
|
? primaryTarget.Value
|
|
360
354
|
: undefined;
|
|
361
|
-
const columnTargetValue = typeof primaryTarget === 'string' &&
|
|
355
|
+
const columnTargetValue = typeof primaryTarget === 'string' &&
|
|
356
|
+
primaryTarget !== 'Col-Avg' &&
|
|
357
|
+
primaryTarget !== 'Col-Median'
|
|
362
358
|
? primaryTarget
|
|
363
359
|
: typeof primaryTarget?.Value === 'string'
|
|
364
360
|
? primaryTarget.Value
|
|
@@ -370,7 +366,7 @@ export const StyledColumnWizardBulletSection = (props) => {
|
|
|
370
366
|
Size: markerCfg?.Size ?? (markerCfg?.Shape === 'Line' ? 2 : 8),
|
|
371
367
|
};
|
|
372
368
|
const cellTextProperties = bullet.CellTextProperties;
|
|
373
|
-
const cellTextDisabled = !
|
|
369
|
+
const cellTextDisabled = !hasBarStyleCellTextConfigured(cellTextProperties) || disabled;
|
|
374
370
|
return (_jsxs(Box, { children: [_jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Target" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Select a target value for the bullet scale" })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...BULLET_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Target:", children: _jsx(Box, { className: "twa:max-w-[180px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: currentMode, onValueChange: (v) => handleTargetModeChange(v), items: [
|
|
375
371
|
{ value: 'None', label: 'None' },
|
|
376
372
|
{ value: 'Number', label: 'Fixed Number' },
|
|
@@ -382,7 +378,7 @@ export const StyledColumnWizardBulletSection = (props) => {
|
|
|
382
378
|
{ value: 'Vertical', label: 'Vertical' },
|
|
383
379
|
] }) }) }), bullet.Orientation === 'Vertical' && (_jsx(FormRow, { label: "", children: _jsxs(Box, { className: "twa:text-xs twa:text-neutral-500", children: ["Tip: vertical bullet charts need a tall row height to be readable (we recommend at least 60px). Set ", _jsx("code", { children: "rowHeight" }), " on ", _jsx("code", { children: " gridOptions " }), " or use", ' ', _jsx("code", { children: "getRowHeight" }), "."] }) })), _jsx(FormRow, { label: "Bar Colour:", children: _jsx(ColorPicker, { disabled: disabled, api: api, value: bullet.Bar?.Color, onChange: (c) => updateBar({ Color: c }) }) }), _jsx(FormRow, { label: bullet.Orientation === 'Vertical' ? 'Bar Width (px):' : 'Bar Height (px):', children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: bullet.Bar?.Height ?? '', onChange: (e) => updateBar({
|
|
384
380
|
Height: e.target.value === '' ? undefined : Number(e.target.value),
|
|
385
|
-
}), placeholder: "8" }) }) }), _jsx(FormRow, { label: "Origin:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: typeof bullet.Origin === 'number' ? 'Number' :
|
|
381
|
+
}), placeholder: "8" }) }) }), _jsx(FormRow, { label: "Origin:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: typeof bullet.Origin === 'number' ? 'Number' : bullet.Origin ?? 'Auto', onValueChange: (v) => {
|
|
386
382
|
if (v === 'Auto' || v === 'Zero') {
|
|
387
383
|
update({ Origin: v });
|
|
388
384
|
}
|
|
@@ -392,7 +388,7 @@ export const StyledColumnWizardBulletSection = (props) => {
|
|
|
392
388
|
}, items: [
|
|
393
389
|
{ value: 'Auto', label: 'Auto' },
|
|
394
390
|
{ value: 'Zero', label: 'Zero' },
|
|
395
|
-
] }) }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell Text" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Pick which values to display and where each one sits around the bar" })] }), _jsxs(Card.Body, { children: [_jsx(FormLayout, { sizes: [...BULLET_STYLE_FORM_SIZES], children: _jsx(
|
|
391
|
+
] }) }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell Text" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Pick which values to display and where each one sits around the bar" })] }), _jsxs(Card.Body, { children: [_jsx(FormLayout, { sizes: [...BULLET_STYLE_FORM_SIZES], children: _jsx(BarStyleCellTextLayoutEditor, { disabled: disabled, cellTextProperties: cellTextProperties, onToggle: toggleCellText, onPlacementChange: onCellTextPlacementChange }) }), _jsx(Box, { className: `twa:mt-3 twa:pt-3 twa:border-t twa:border-foreground/15 ${cellTextDisabled ? 'twa:opacity-50' : ''}`, children: _jsx(StyledColumnFontStyleEditor, { api: api, disabled: cellTextDisabled, value: bullet.Font, onChange: (next) => {
|
|
396
392
|
if (next) {
|
|
397
393
|
update({ Font: next });
|
|
398
394
|
}
|
|
@@ -7,7 +7,7 @@ import { Tag } from '../../../components/Tag';
|
|
|
7
7
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
8
8
|
import { Box, Flex } from '../../../components/Flex';
|
|
9
9
|
import { NumberInput } from '../../../components/Input/NumberInput';
|
|
10
|
-
import { DEFAULT_GRADIENT_MAX_ALPHA, DEFAULT_GRADIENT_MIN_ALPHA, } from '../../../Utilities/Helpers/
|
|
10
|
+
import { DEFAULT_GRADIENT_MAX_ALPHA, DEFAULT_GRADIENT_MIN_ALPHA, } from '../../../Utilities/Helpers/StyledColumns/GradientStyleHelper';
|
|
11
11
|
import { getCellFontStyleSummaryItems, StyledColumnFontStyleEditor, } from './StyledColumnSliceStyleEditors';
|
|
12
12
|
import { Card } from '../../../components/Card';
|
|
13
13
|
import { renderSummaryStringTags } from '../../Wizard/SummaryColorTag';
|
|
@@ -14,7 +14,7 @@ import { IconSelectorPanel } from '../../../components/IconSelector';
|
|
|
14
14
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
15
15
|
import { useAdaptable } from '../../AdaptableContext';
|
|
16
16
|
import { AdaptableIconComponent } from '../../Components/AdaptableIconComponent';
|
|
17
|
-
import { ICON_STYLE_PRESET_DESCRIPTIONS, ICON_STYLE_PRESET_LABELS, getIconStylePresetMappings, } from '../../../Utilities/Helpers/
|
|
17
|
+
import { ICON_STYLE_PRESET_DESCRIPTIONS, ICON_STYLE_PRESET_LABELS, getIconStylePresetMappings, } from '../../../Utilities/Helpers/StyledColumns/IconStyleHelper';
|
|
18
18
|
import { resolveEffectiveIconStyleMappings, resolveIconStyleMappingsForSummaryPreview } from '../../../agGrid/cellRenderers/IconRenderer';
|
|
19
19
|
import { Card } from '../../../components/Card';
|
|
20
20
|
import { renderSummaryStringTags } from '../../Wizard/SummaryColorTag';
|
|
@@ -17,8 +17,8 @@ import { RangeBarRangesSummaryPreview } from './StyledColumnWizardStyleSection/C
|
|
|
17
17
|
import { StyledColumnRangeBarPreviewCard } from './StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview';
|
|
18
18
|
import { Card } from '../../../components/Card';
|
|
19
19
|
import { renderSummaryStringTags } from '../../Wizard/SummaryColorTag';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
20
|
+
import { formatBarStyleCellTextLayoutSummary, getActiveBarStyleCellTextTokens, hasBarStyleCellTextConfigured, patchBarStyleCellTextPlacement, resolveBarStyleCellTextLayout, toggleBarStyleCellTextToken, } from '../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
21
|
+
import { BarStyleCellTextLayoutEditor } from './StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor';
|
|
22
22
|
const RANGE_STYLE_FORM_SIZES = ['200px', '1fr'];
|
|
23
23
|
const BOUND_MODE_LABELS = {
|
|
24
24
|
Number: 'Fixed Number',
|
|
@@ -106,14 +106,10 @@ const RangeBarBoundInput = ({ api, value, optional, fallbackNumber, excludeColum
|
|
|
106
106
|
'twa:[&_.ab-Input]:w-full twa:[&_.ab-Input]:rounded-l-none!',
|
|
107
107
|
'twa:[&_[data-slot=input-group]]:w-full! twa:[&_[data-slot=input-group]]:rounded-l-none!',
|
|
108
108
|
].join(' ');
|
|
109
|
-
return (_jsxs(InputGroup, { Component: Flex, className: "twa:items-stretch twa:max-w-[22rem]", children: [_jsx(SingleSelect, { className: `twa:w-[150px] twa:max-w-none twa:shrink-0 twa:box-border${hasEditor ? '
|
|
109
|
+
return (_jsxs(InputGroup, { Component: Flex, className: "twa:items-stretch twa:max-w-[22rem]", children: [_jsx(SingleSelect, { className: `twa:w-[150px] twa:max-w-none twa:shrink-0 twa:box-border${hasEditor ? 'twa:rounded-r-none!' : ''}`, disabled: disabled, value: mode, items: items, onValueChange: (v) => handleModeChange(v) }), hasEditor && _jsx(Box, { className: editorWrapperClassName, children: editor })] }));
|
|
110
110
|
};
|
|
111
|
-
const formatRangeBarCellTextSummary = (cellText) => cellText
|
|
112
|
-
|
|
113
|
-
.join(' + ') ?? '';
|
|
114
|
-
const formatRangeBarToolTipSummary = (toolTipText) => toolTipText
|
|
115
|
-
?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value'))
|
|
116
|
-
.join(' + ') ?? '';
|
|
111
|
+
const formatRangeBarCellTextSummary = (cellText) => cellText?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value')).join(' + ') ?? '';
|
|
112
|
+
const formatRangeBarToolTipSummary = (toolTipText) => toolTipText?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value')).join(' + ') ?? '';
|
|
117
113
|
export const getStyledColumnRangeBarRangeViewValues = (data) => {
|
|
118
114
|
const range = data.RangeBarStyle;
|
|
119
115
|
if (!range) {
|
|
@@ -177,10 +173,10 @@ const buildStyledColumnRangeBarDisplaySummaryStrings = (range, options) => {
|
|
|
177
173
|
if (range.BackColor) {
|
|
178
174
|
items.push(`Back Colour: ${range.BackColor}`);
|
|
179
175
|
}
|
|
180
|
-
if (
|
|
181
|
-
const tokens =
|
|
176
|
+
if (hasBarStyleCellTextConfigured(range.CellTextProperties)) {
|
|
177
|
+
const tokens = getActiveBarStyleCellTextTokens(range.CellTextProperties);
|
|
182
178
|
items.push(`Cell Text: ${formatRangeBarCellTextSummary(tokens)}`);
|
|
183
|
-
const layoutSummary =
|
|
179
|
+
const layoutSummary = formatBarStyleCellTextLayoutSummary(resolveBarStyleCellTextLayout(range.CellTextProperties));
|
|
184
180
|
if (layoutSummary) {
|
|
185
181
|
items.push(`Placement: ${layoutSummary}`);
|
|
186
182
|
}
|
|
@@ -370,7 +366,9 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
370
366
|
const resolvedBoundValues = {
|
|
371
367
|
'Col-Min': minMaxRangeValues?.min,
|
|
372
368
|
'Col-Max': minMaxRangeValues?.max,
|
|
373
|
-
'Col-Avg': column
|
|
369
|
+
'Col-Avg': column
|
|
370
|
+
? api.styledColumnApi.internalApi.getAvgValueForNumericColumn(column)
|
|
371
|
+
: undefined,
|
|
374
372
|
'Col-Median': column
|
|
375
373
|
? api.styledColumnApi.internalApi.getMedianValueForNumericColumn(column)
|
|
376
374
|
: undefined,
|
|
@@ -437,11 +435,11 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
437
435
|
};
|
|
438
436
|
// -- Cell text -------------------------------------------------------------
|
|
439
437
|
const toggleCellText = (token, show) => {
|
|
440
|
-
update(
|
|
438
|
+
update(toggleBarStyleCellTextToken(range.CellTextProperties, token, show));
|
|
441
439
|
};
|
|
442
440
|
const onCellTextPlacementChange = (token, patch) => {
|
|
443
441
|
update({
|
|
444
|
-
CellTextProperties:
|
|
442
|
+
CellTextProperties: patchBarStyleCellTextPlacement(range.CellTextProperties, token, patch),
|
|
445
443
|
});
|
|
446
444
|
};
|
|
447
445
|
const toggleToolTipText = (token, checked) => {
|
|
@@ -490,5 +488,5 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
490
488
|
{ value: 'Clamp', label: 'Clamp to edge' },
|
|
491
489
|
{ value: 'Overflow', label: 'Show outside' },
|
|
492
490
|
{ value: 'Hide', label: 'Hide marker' },
|
|
493
|
-
] }) }) }), outOfRangeMode === 'Clamp' && (_jsx(FormRow, { label: `Out-of-range ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(OptionalColorPicker, { disabled: disabled, api: api, value: range.OutOfRange?.Color, defaultColor: "crimson", onChange: (c) => updateOutOfRangeProperties({ Color: c }) }) }))] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Text & Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional cell-text overlay and AG Grid tooltip content." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(
|
|
491
|
+
] }) }) }), outOfRangeMode === 'Clamp' && (_jsx(FormRow, { label: `Out-of-range ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(OptionalColorPicker, { disabled: disabled, api: api, value: range.OutOfRange?.Color, defaultColor: "crimson", onChange: (c) => updateOutOfRangeProperties({ Color: c }) }) }))] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Text & Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional cell-text overlay and AG Grid tooltip content." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(BarStyleCellTextLayoutEditor, { disabled: disabled, cellTextProperties: range.CellTextProperties, onToggle: toggleCellText, onPlacementChange: onCellTextPlacementChange }), _jsxs(FormRow, { label: "Tooltip Display:", children: [_jsx(CheckBox, { disabled: disabled, checked: range.ToolTipText?.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', _jsx(CheckBox, { disabled: disabled, className: "twa:ml-3", checked: range.ToolTipText?.includes('PercentageValue'), onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percent Value" })] })] }) })] }), _jsx(StyledColumnRangeBarPreviewCard, { data: data })] }))] }));
|
|
494
492
|
};
|
|
@@ -6,8 +6,8 @@ import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableW
|
|
|
6
6
|
import { Box, Flex } from '../../../components/Flex';
|
|
7
7
|
import { CheckBox } from '../../../components/CheckBox';
|
|
8
8
|
import { cn } from '../../../lib/utils';
|
|
9
|
-
import { getStyledColumnRowKindDisabledReason, isStyledColumnRowKindSupported, sanitizeStyledColumnRowScope, STYLED_COLUMN_ROW_KIND_EXCLUDE_KEY, STYLED_COLUMN_ROW_KINDS, } from '../../../Utilities/Helpers/
|
|
10
|
-
import { isUnsupportedColumnDataTypeForIconStyle } from '../../../Utilities/Helpers/
|
|
9
|
+
import { getStyledColumnRowKindDisabledReason, isStyledColumnRowKindSupported, sanitizeStyledColumnRowScope, STYLED_COLUMN_ROW_KIND_EXCLUDE_KEY, STYLED_COLUMN_ROW_KINDS, } from '../../../Utilities/Helpers/StyledColumns/StyledColumnHelper';
|
|
10
|
+
import { isUnsupportedColumnDataTypeForIconStyle } from '../../../Utilities/Helpers/StyledColumns/IconStyleHelper';
|
|
11
11
|
import { CollapsibleWizardCard, CollapsibleWizardValueSummary, getWizardAccordionSectionClassName, renderCompactColumnTags, useWizardCardAccordion, } from '../../Wizard/CollapsibleWizardCard';
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
// Row-kind helpers
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BarStyleCellTextPlacement, BarStyleCellTextProperties } from '../../../../../AdaptableState/StyledColumns/Common/BarStyleProperties';
|
|
3
3
|
import { CellTextOption } from '../../../../../AdaptableState/StyledColumns/Common/CellTextOptions';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const BarStyleCellTextLayoutEditor: React.FunctionComponent<{
|
|
5
5
|
disabled?: boolean;
|
|
6
|
-
cellTextProperties?:
|
|
6
|
+
cellTextProperties?: BarStyleCellTextProperties;
|
|
7
7
|
onToggle: (token: CellTextOption, show: boolean) => void;
|
|
8
|
-
onPlacementChange: (token: CellTextOption, patch: Partial<
|
|
8
|
+
onPlacementChange: (token: CellTextOption, patch: Partial<BarStyleCellTextPlacement>) => void;
|
|
9
9
|
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { resolveBarStyleCellTextLayout } from '../../../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
3
|
+
import { CheckBox } from '../../../../../components/CheckBox';
|
|
4
|
+
import { Box, Flex } from '../../../../../components/Flex';
|
|
5
|
+
import { FormRow } from '../../../../../components/FormLayout';
|
|
6
|
+
import { SingleSelect } from '../../../../../components/NewSelect';
|
|
7
|
+
const HORIZONTAL_CHOICES = [
|
|
8
|
+
{ value: 'Left', label: 'Left' },
|
|
9
|
+
{ value: 'Center', label: 'Center' },
|
|
10
|
+
{ value: 'Right', label: 'Right' },
|
|
11
|
+
];
|
|
12
|
+
const VERTICAL_CHOICES = [
|
|
13
|
+
{ value: 'Above', label: 'Above Bar' },
|
|
14
|
+
{ value: 'Below', label: 'Below Bar' },
|
|
15
|
+
{ value: 'Merged', label: 'Merged' },
|
|
16
|
+
];
|
|
17
|
+
const ROWS = [
|
|
18
|
+
{ token: 'CellValue', label: 'Cell Value:', key: 'CellValue' },
|
|
19
|
+
{ token: 'PercentageValue', label: 'Percent Value:', key: 'PercentValue' },
|
|
20
|
+
];
|
|
21
|
+
export const BarStyleCellTextLayoutEditor = ({ disabled, cellTextProperties, onToggle, onPlacementChange }) => {
|
|
22
|
+
const layout = resolveBarStyleCellTextLayout(cellTextProperties);
|
|
23
|
+
return (_jsx(_Fragment, { children: ROWS.map(({ token, label, key }) => {
|
|
24
|
+
const placement = layout[key];
|
|
25
|
+
const isShown = Boolean(placement);
|
|
26
|
+
const rowDisabled = disabled || !isShown;
|
|
27
|
+
return (_jsx(FormRow, { label: label, children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-3", children: [_jsx(CheckBox, { disabled: disabled, checked: isShown, onChange: (checked) => onToggle(token, checked) }), _jsx(Box, { className: "twa:w-[140px]", children: _jsx(SingleSelect, { className: "twa:w-full", disabled: rowDisabled, value: placement?.Horizontal ?? 'Left', onValueChange: (v) => onPlacementChange(token, {
|
|
28
|
+
Horizontal: v,
|
|
29
|
+
}), items: HORIZONTAL_CHOICES }) }), _jsx(Box, { className: "twa:w-[140px]", children: _jsx(SingleSelect, { className: "twa:w-full", disabled: rowDisabled, value: placement?.Vertical ?? 'Below', onValueChange: (v) => onPlacementChange(token, {
|
|
30
|
+
Vertical: v,
|
|
31
|
+
}), items: VERTICAL_CHOICES }) })] }) }, token));
|
|
32
|
+
}) }));
|
|
33
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BarStyleCellTextProperties } from '../../../../../AdaptableState/StyledColumns/Common/BarStyleProperties';
|
|
3
|
+
import { BarStyleCellTextLabels } from '../../../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
4
4
|
/**
|
|
5
5
|
* Preview of the per-value cell-text layout. Renders three potential bands:
|
|
6
6
|
* - `Above` slots (above the bar)
|
|
@@ -11,13 +11,13 @@ import { BarChartCellTextLabels } from '../../../../../Utilities/Helpers/barChar
|
|
|
11
11
|
* stable. When `vertical` is provided, only the band matching that value is
|
|
12
12
|
* rendered (used by the preview cards to position bands around the bar).
|
|
13
13
|
*/
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const BarStyleCellTextPreview: React.FunctionComponent<{
|
|
15
15
|
className?: string;
|
|
16
16
|
style?: React.CSSProperties;
|
|
17
|
-
cellTextProperties?:
|
|
18
|
-
labels:
|
|
17
|
+
cellTextProperties?: BarStyleCellTextProperties;
|
|
18
|
+
labels: BarStyleCellTextLabels;
|
|
19
19
|
mergedOverlayClassName?: string;
|
|
20
20
|
/** Render only the band matching this vertical position. */
|
|
21
21
|
vertical?: 'Above' | 'Below' | 'Merged';
|
|
22
22
|
}>;
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const shouldShowBarStyleCellTextOutsideBar: (cellTextProperties: BarStyleCellTextProperties | undefined, hasCellText: boolean) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { getBarStyleCellTextSlotPresence, hasBarStyleCellTextConfigured, resolveBarStyleCellTextSlots, } from '../../../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
3
3
|
import { Box, Flex } from '../../../../../components/Flex';
|
|
4
4
|
const HORIZONTAL_ORDER = ['Left', 'Center', 'Right'];
|
|
5
5
|
const HORIZONTAL_JUSTIFY = {
|
|
@@ -33,11 +33,11 @@ const CellTextRow = ({ className, style, slots }) => (_jsx(Flex, { className: cl
|
|
|
33
33
|
* stable. When `vertical` is provided, only the band matching that value is
|
|
34
34
|
* rendered (used by the preview cards to position bands around the bar).
|
|
35
35
|
*/
|
|
36
|
-
export const
|
|
36
|
+
export const BarStyleCellTextPreview = ({ className, style, cellTextProperties, labels, mergedOverlayClassName, vertical }) => {
|
|
37
37
|
if (!labels.cellValue && !labels.percentage) {
|
|
38
38
|
return null;
|
|
39
39
|
}
|
|
40
|
-
const slots =
|
|
40
|
+
const slots = resolveBarStyleCellTextSlots(cellTextProperties, labels);
|
|
41
41
|
if (!slots.length) {
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
@@ -48,10 +48,10 @@ export const BarChartCellTextPreview = ({ className, style, cellTextProperties,
|
|
|
48
48
|
const usedClassName = vertical === 'Merged' ? mergedOverlayClassName ?? className : className;
|
|
49
49
|
return (_jsx(CellTextRow, { className: usedClassName, style: style, slots: bandSlots.map((s) => ({ horizontal: s.horizontal, text: s.text })) }));
|
|
50
50
|
};
|
|
51
|
-
export const
|
|
52
|
-
if (!hasCellText || !
|
|
51
|
+
export const shouldShowBarStyleCellTextOutsideBar = (cellTextProperties, hasCellText) => {
|
|
52
|
+
if (!hasCellText || !hasBarStyleCellTextConfigured(cellTextProperties)) {
|
|
53
53
|
return false;
|
|
54
54
|
}
|
|
55
|
-
const { hasAbove, hasBelow } =
|
|
55
|
+
const { hasAbove, hasBelow } = getBarStyleCellTextSlotPresence(cellTextProperties);
|
|
56
56
|
return hasAbove || hasBelow;
|
|
57
57
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { CellColorRange, ColumnComparison, NumericStyledColumn } from '../../../../../AdaptableState/StyledColumns/Common/NumericStyledColumn';
|
|
3
|
-
import { GradientStyle,
|
|
3
|
+
import { GradientStyle, ZeroCentredColors } from '../../../../../AdaptableState/StyledColumns/GradientStyle';
|
|
4
4
|
import { AdaptableApi } from '../../../../../types';
|
|
5
5
|
export declare function gradientRangeStripCss(color: string, reverseGradient: boolean, minAlpha: number, maxAlpha: number): string;
|
|
6
6
|
export interface GradientRangesSummaryPreviewProps {
|
|
7
7
|
ranges?: CellColorRange[];
|
|
8
|
-
zeroCentred?:
|
|
8
|
+
zeroCentred?: ZeroCentredColors;
|
|
9
9
|
rangeValueType: NumericStyledColumn['RangeValueType'];
|
|
10
10
|
gradientStyle?: Pick<GradientStyle, 'MinAlpha' | 'MaxAlpha'>;
|
|
11
11
|
}
|
|
@@ -3,7 +3,7 @@ import tinycolor from 'tinycolor2';
|
|
|
3
3
|
import { Box, Flex } from '../../../../../components/Flex';
|
|
4
4
|
import { Tag } from '../../../../../components/Tag';
|
|
5
5
|
import { getVariableColor } from '../../../../../Utilities/Helpers/StyleHelper';
|
|
6
|
-
import { DEFAULT_GRADIENT_MAX_ALPHA, DEFAULT_GRADIENT_MIN_ALPHA, isDivergingZeroCellRanges, } from '../../../../../Utilities/Helpers/
|
|
6
|
+
import { DEFAULT_GRADIENT_MAX_ALPHA, DEFAULT_GRADIENT_MIN_ALPHA, isDivergingZeroCellRanges, } from '../../../../../Utilities/Helpers/StyledColumns/GradientStyleHelper';
|
|
7
7
|
function clamp01(n) {
|
|
8
8
|
if (Number.isNaN(n)) {
|
|
9
9
|
return 0;
|
|
@@ -56,9 +56,7 @@ export const GradientRangesSummaryPreview = (props) => {
|
|
|
56
56
|
export const GradientColumnComparisonSummaryPreview = (props) => {
|
|
57
57
|
const minA = props.gradientStyle?.MinAlpha ?? DEFAULT_GRADIENT_MIN_ALPHA;
|
|
58
58
|
const maxA = props.gradientStyle?.MaxAlpha ?? DEFAULT_GRADIENT_MAX_ALPHA;
|
|
59
|
-
const fmt = (v) => isNaN(Number(v))
|
|
60
|
-
? `[${props.api.columnApi.getFriendlyNameForColumnId(String(v))}]`
|
|
61
|
-
: v;
|
|
59
|
+
const fmt = (v) => isNaN(Number(v)) ? `[${props.api.columnApi.getFriendlyNameForColumnId(String(v))}]` : v;
|
|
62
60
|
return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-2", children: [_jsxs(Tag, { children: ["Min: ", fmt(props.columnComparison.MinValue), " \u2014 Max: ", fmt(props.columnComparison.MaxValue)] }), _jsx(Box, { className: `${stripClassName} twa:w-[200px]`, style: {
|
|
63
61
|
background: gradientRangeStripCss(props.columnComparison.Color, false, minA, maxA),
|
|
64
62
|
} })] }));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { convertAdaptableStyleToCSS } from '../../../../../Utilities/Helpers/StyleHelper';
|
|
3
|
-
import {
|
|
3
|
+
import { buildBarStyleCellTextLabels, getBarStyleCellTextSlotPresence, hasBarStyleCellTextConfigured, } from '../../../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
4
4
|
import { Box, Flex } from '../../../../../components/Flex';
|
|
5
5
|
import { Card } from '../../../../../components/Card';
|
|
6
6
|
import { Tag } from '../../../../../components/Tag';
|
|
7
7
|
import { StyledColumnBulletChartListPreview } from './StyledColumnChartListPreviews';
|
|
8
|
-
import {
|
|
8
|
+
import { BarStyleCellTextPreview } from './BarStyleCellTextPreview';
|
|
9
9
|
const PREVIEW_CELL_CLASS = 'ab-BulletPreviewCell twa:inline-flex twa:items-center twa:min-w-[180px] twa:min-h-[36px] twa:px-2 twa:py-1 twa:rounded-standard twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]';
|
|
10
10
|
const getBulletPreviewSample = (bullet) => {
|
|
11
11
|
const ranges = bullet.CellRanges ?? [];
|
|
@@ -28,10 +28,10 @@ const getBulletPreviewSample = (bullet) => {
|
|
|
28
28
|
const BulletChartPreviewContent = ({ bullet, }) => {
|
|
29
29
|
const { sampleValue, valueFraction } = getBulletPreviewSample(bullet);
|
|
30
30
|
const cellTextProperties = bullet.CellTextProperties;
|
|
31
|
-
const labels =
|
|
32
|
-
const hasCellText =
|
|
31
|
+
const labels = buildBarStyleCellTextLabels(cellTextProperties, Number.isInteger(sampleValue) ? String(sampleValue) : sampleValue.toFixed(1), `${(valueFraction * 100).toFixed(0)}%`);
|
|
32
|
+
const hasCellText = hasBarStyleCellTextConfigured(cellTextProperties) &&
|
|
33
33
|
Boolean(labels.cellValue || labels.percentage);
|
|
34
|
-
const presence =
|
|
34
|
+
const presence = getBarStyleCellTextSlotPresence(cellTextProperties);
|
|
35
35
|
const fontStyle = bullet.Font ? convertAdaptableStyleToCSS(bullet.Font) : undefined;
|
|
36
36
|
const isVertical = bullet.Orientation === 'Vertical';
|
|
37
37
|
const cellTextClassName = 'ab-BulletChart__text twa:text-2 twa:leading-tight twa:truncate twa:max-w-full';
|
|
@@ -39,9 +39,9 @@ const BulletChartPreviewContent = ({ bullet, }) => {
|
|
|
39
39
|
// Merged-only with no outside bands → relative container so the overlay sits
|
|
40
40
|
// on top of the chart, matching the runtime renderer's behaviour.
|
|
41
41
|
if (hasCellText && presence.hasMerged && !presence.hasAbove && !presence.hasBelow) {
|
|
42
|
-
return (_jsxs(Box, { className: "ab-BulletChart__wrapper twa:relative twa:inline-flex", children: [chartEl, _jsx(
|
|
42
|
+
return (_jsxs(Box, { className: "ab-BulletChart__wrapper twa:relative twa:inline-flex", children: [chartEl, _jsx(BarStyleCellTextPreview, { mergedOverlayClassName: "ab-BulletChart__text twa:absolute twa:inset-x-0 twa:top-1/2 twa:-translate-y-1/2 twa:px-1 twa:text-2 twa:truncate twa:pointer-events-none", style: fontStyle, cellTextProperties: cellTextProperties, labels: labels, vertical: "Merged" })] }));
|
|
43
43
|
}
|
|
44
|
-
return (_jsxs(Flex, { className: "ab-BulletChart__wrapper twa:relative", flexDirection: "column", alignItems: isVertical ? 'center' : 'stretch', style: { justifyContent: 'center', gap: hasCellText ? 2 : 0 }, children: [hasCellText && presence.hasAbove && (_jsx(
|
|
44
|
+
return (_jsxs(Flex, { className: "ab-BulletChart__wrapper twa:relative", flexDirection: "column", alignItems: isVertical ? 'center' : 'stretch', style: { justifyContent: 'center', gap: hasCellText ? 2 : 0 }, children: [hasCellText && presence.hasAbove && (_jsx(BarStyleCellTextPreview, { className: cellTextClassName, style: fontStyle, cellTextProperties: cellTextProperties, labels: labels, vertical: "Above" })), _jsxs(Box, { className: "twa:relative twa:w-full", style: { display: 'inline-flex' }, children: [chartEl, hasCellText && presence.hasMerged && (_jsx(BarStyleCellTextPreview, { mergedOverlayClassName: "ab-BulletChart__text twa:absolute twa:inset-x-0 twa:top-1/2 twa:-translate-y-1/2 twa:px-1 twa:text-2 twa:truncate twa:pointer-events-none", style: fontStyle, cellTextProperties: cellTextProperties, labels: labels, vertical: "Merged" }))] }), hasCellText && presence.hasBelow && (_jsx(BarStyleCellTextPreview, { className: cellTextClassName, style: fontStyle, cellTextProperties: cellTextProperties, labels: labels, vertical: "Below" }))] }));
|
|
45
45
|
};
|
|
46
46
|
export const StyledColumnBulletPreview = ({ data }) => {
|
|
47
47
|
const bullet = data.BulletChartStyle;
|
|
@@ -3,7 +3,7 @@ import { Box, Flex } from '../../../../../components/Flex';
|
|
|
3
3
|
import { Card } from '../../../../../components/Card';
|
|
4
4
|
import { Tag } from '../../../../../components/Tag';
|
|
5
5
|
import { useAdaptable } from '../../../../AdaptableContext';
|
|
6
|
-
import { getGradientPreviewCellStyle, getGradientPreviewSampleValues, hasGradientRangesConfigured, } from '../../../../../Utilities/Helpers/
|
|
6
|
+
import { getGradientPreviewCellStyle, getGradientPreviewSampleValues, hasGradientRangesConfigured, } from '../../../../../Utilities/Helpers/StyledColumns/GradientStyleHelper';
|
|
7
7
|
const formatPreviewValue = (value) => {
|
|
8
8
|
if (Number.isInteger(value)) {
|
|
9
9
|
return value.toLocaleString();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { convertAdaptableStyleToCSS } from '../../../../../Utilities/Helpers/StyleHelper';
|
|
3
|
-
import { getPercentBarPreviewGeometry, getPercentBarPreviewResolvedBarColor, getPercentBarPreviewSampleValues, getPercentBarPreviewScale, getPercentBarPreviewTrackColor, hasPercentBarRangesConfigured, } from '../../../../../Utilities/Helpers/
|
|
4
|
-
import {
|
|
3
|
+
import { getPercentBarPreviewGeometry, getPercentBarPreviewResolvedBarColor, getPercentBarPreviewSampleValues, getPercentBarPreviewScale, getPercentBarPreviewTrackColor, hasPercentBarRangesConfigured, } from '../../../../../Utilities/Helpers/StyledColumns/PercentBarStyleHelper';
|
|
4
|
+
import { buildBarStyleCellTextLabels, getBarStyleCellTextSlotPresence, hasBarStyleCellTextConfigured, } from '../../../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
5
5
|
import { Box, Flex } from '../../../../../components/Flex';
|
|
6
6
|
import { Card } from '../../../../../components/Card';
|
|
7
7
|
import { Tag } from '../../../../../components/Tag';
|
|
8
|
-
import {
|
|
8
|
+
import { BarStyleCellTextPreview, shouldShowBarStyleCellTextOutsideBar, } from './BarStyleCellTextPreview';
|
|
9
9
|
const PREVIEW_CELL_CLASS = 'ab-PercentBarPreviewCell twa:w-[72px] twa:min-h-[32px] twa:px-1 twa:py-1 twa:rounded-standard twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]';
|
|
10
10
|
const PercentBarPreviewCell = ({ styledColumn, value, min, max }) => {
|
|
11
11
|
const pb = styledColumn.PercentBarStyle;
|
|
@@ -13,21 +13,23 @@ const PercentBarPreviewCell = ({ styledColumn, value, min, max }) => {
|
|
|
13
13
|
const trackColor = getPercentBarPreviewTrackColor(pb);
|
|
14
14
|
const fillColor = getPercentBarPreviewResolvedBarColor(barColor);
|
|
15
15
|
const cellTextProperties = pb.CellTextProperties;
|
|
16
|
-
const labels =
|
|
17
|
-
const hasCellText =
|
|
16
|
+
const labels = buildBarStyleCellTextLabels(cellTextProperties, Number.isInteger(value) ? String(value) : value.toFixed(1), `${percentageValue.toFixed(0)}%`);
|
|
17
|
+
const hasCellText = hasBarStyleCellTextConfigured(cellTextProperties) &&
|
|
18
18
|
Boolean(labels.cellValue || labels.percentage);
|
|
19
|
-
const presence =
|
|
19
|
+
const presence = getBarStyleCellTextSlotPresence(cellTextProperties);
|
|
20
20
|
const fontStyle = pb.Font ? convertAdaptableStyleToCSS(pb.Font) : undefined;
|
|
21
21
|
const cellTextClassName = 'ab-PercentBar__text twa:text-2 twa:leading-tight twa:truncate';
|
|
22
22
|
const barEl = (_jsxs(Box, { className: "ab-PercentBar__bar twa:relative twa:flex-1 twa:min-h-[6px]", style: trackColor ? { background: getPercentBarPreviewResolvedBarColor(trackColor) } : undefined, children: [fillColor && (_jsx(Box, { className: "ab-PercentBar__barInside twa:absolute twa:top-0 twa:h-full", style: {
|
|
23
23
|
background: fillColor,
|
|
24
24
|
left: `${barLeftPercent.toFixed(2)}%`,
|
|
25
25
|
width: `${barWidthPercent.toFixed(2)}%`,
|
|
26
|
-
} })), hasCellText && presence.hasMerged && (_jsx(
|
|
26
|
+
} })), hasCellText && presence.hasMerged && (_jsx(BarStyleCellTextPreview, { mergedOverlayClassName: "ab-PercentBar__text twa:absolute twa:inset-x-0 twa:top-1/2 twa:-translate-y-1/2 twa:px-1 twa:text-2 twa:truncate", style: fontStyle, cellTextProperties: cellTextProperties, labels: labels, vertical: "Merged" }))] }));
|
|
27
27
|
return (_jsxs(Flex, { className: `ab-PercentBar__wrapper ${PREVIEW_CELL_CLASS}`, flexDirection: "column", style: {
|
|
28
28
|
justifyContent: 'center',
|
|
29
|
-
height:
|
|
30
|
-
|
|
29
|
+
height: shouldShowBarStyleCellTextOutsideBar(cellTextProperties, hasCellText)
|
|
30
|
+
? '100%'
|
|
31
|
+
: undefined,
|
|
32
|
+
}, children: [hasCellText && presence.hasAbove && (_jsx(BarStyleCellTextPreview, { className: cellTextClassName, style: fontStyle, cellTextProperties: cellTextProperties, labels: labels, vertical: "Above" })), barEl, hasCellText && presence.hasBelow && (_jsx(BarStyleCellTextPreview, { className: cellTextClassName, style: fontStyle, cellTextProperties: cellTextProperties, labels: labels, vertical: "Below" }))] }));
|
|
31
33
|
};
|
|
32
34
|
export const StyledColumnPercentBarPreview = ({ data }) => {
|
|
33
35
|
const pb = data.PercentBarStyle;
|