@adaptabletools/adaptable 23.0.0-canary.7 → 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 +98 -17
- 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/StyledColumnState.d.ts +8 -850
- package/src/AdaptableState/StyledColumnState.js +1 -9
- package/src/AdaptableState/StyledColumns/BadgeStyle.d.ts +143 -0
- package/src/AdaptableState/StyledColumns/BadgeStyle.js +9 -0
- package/src/AdaptableState/StyledColumns/BulletChartStyle.d.ts +147 -0
- package/src/AdaptableState/StyledColumns/BulletChartStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/Common/BarStyleProperties.d.ts +84 -0
- package/src/AdaptableState/StyledColumns/Common/BarStyleProperties.js +5 -0
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.d.ts +13 -0
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.js +6 -0
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.d.ts +79 -0
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.js +9 -0
- package/src/AdaptableState/StyledColumns/GradientStyle.d.ts +48 -0
- package/src/AdaptableState/StyledColumns/GradientStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/IconStyle.d.ts +158 -0
- package/src/AdaptableState/StyledColumns/IconStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/PercentBarStyle.d.ts +32 -0
- package/src/AdaptableState/StyledColumns/PercentBarStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/RangeBarStyle.d.ts +155 -0
- package/src/AdaptableState/StyledColumns/RangeBarStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/RatingStyle.d.ts +111 -0
- package/src/AdaptableState/StyledColumns/RatingStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/SparklineStyle.d.ts +21 -0
- package/src/AdaptableState/StyledColumns/SparklineStyle.js +1 -0
- package/src/Api/ColumnScopeApi.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +1 -1
- package/src/Api/Implementation/ChartingApiImpl.js +1 -1
- package/src/Api/Implementation/ColumnScopeApiImpl.d.ts +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.d.ts +3 -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/StyledColumns/BarStylesHelper.js +317 -0
- package/src/Utilities/Helpers/{StyledColumnGradientHelper.d.ts → StyledColumns/GradientStyleHelper.d.ts} +4 -2
- 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 -1
- package/src/Utilities/Helpers/{percentBarPreviewHelper.js → StyledColumns/PercentBarStyleHelper.js} +7 -12
- 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 +160 -127
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +3 -3
- 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 +10 -2
- 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/AdaptableObjectList/AdaptableObjectCompactList.js +3 -2
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +3 -2
- package/src/View/Components/AdaptableObjectList/objectListActionButtonStyles.d.ts +2 -0
- package/src/View/Components/AdaptableObjectList/objectListActionButtonStyles.js +2 -0
- package/src/View/Components/Buttons/EntityListActionButtons.js +1 -1
- package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.d.ts +1 -0
- package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.js +8 -8
- package/src/View/Components/ColumnFilter/ColumnFilter.js +14 -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/AdaptablePopupModuleView.js +1 -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 +4 -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/Export/ExportSchedulesTab.js +3 -4
- package/src/View/Filter/FilterViewPanel.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/Layout/Wizard/sections/RowSummarySection.js +129 -103
- 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/BadgePillStyleEditor.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +36 -30
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +1 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +79 -68
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +39 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +92 -52
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor.js +33 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextPreview.d.ts +23 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextPreview.js +57 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.d.ts +3 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +2 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +3 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +13 -17
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews.d.ts +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +16 -7
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +11 -17
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +20 -60
- 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 -14
- package/src/agGrid/AgGridExportAdapter.js +1 -1
- package/src/agGrid/AgGridMenuAdapter.js +127 -2
- package/src/agGrid/cellRenderers/BadgeRenderer.js +8 -6
- package/src/agGrid/cellRenderers/BulletChartRenderer.js +45 -44
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +2 -1
- package/src/agGrid/cellRenderers/IconRenderer.js +15 -14
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +26 -98
- package/src/agGrid/cellRenderers/RangeBarRenderer.js +52 -50
- 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 +118 -19
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade23.d.ts +27 -31
- package/src/migration/VersionUpgrade23.js +110 -29
- package/src/types.d.ts +12 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +0 -3
- 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/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/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
|
@@ -10,7 +10,6 @@ import { RangesComponent } from '../../Components/RangesComponent';
|
|
|
10
10
|
import { ColumnSelector } from '../../Components/Selectors/ColumnSelector';
|
|
11
11
|
import { getGraySwatchColor } from '../../UIHelper';
|
|
12
12
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
13
|
-
import ArrayExtensions from '../../../Utilities/Extensions/ArrayExtensions';
|
|
14
13
|
import AdaptableInput from '../../Components/AdaptableInput';
|
|
15
14
|
import { Box, Flex } from '../../../components/Flex';
|
|
16
15
|
import { SingleSelect } from '../../../components/NewSelect';
|
|
@@ -18,6 +17,8 @@ import { RangeBarRangesSummaryPreview } from './StyledColumnWizardStyleSection/C
|
|
|
18
17
|
import { StyledColumnRangeBarPreviewCard } from './StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview';
|
|
19
18
|
import { Card } from '../../../components/Card';
|
|
20
19
|
import { renderSummaryStringTags } from '../../Wizard/SummaryColorTag';
|
|
20
|
+
import { formatBarStyleCellTextLayoutSummary, getActiveBarStyleCellTextTokens, hasBarStyleCellTextConfigured, patchBarStyleCellTextPlacement, resolveBarStyleCellTextLayout, toggleBarStyleCellTextToken, } from '../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
21
|
+
import { BarStyleCellTextLayoutEditor } from './StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor';
|
|
21
22
|
const RANGE_STYLE_FORM_SIZES = ['200px', '1fr'];
|
|
22
23
|
const BOUND_MODE_LABELS = {
|
|
23
24
|
Number: 'Fixed Number',
|
|
@@ -105,14 +106,10 @@ const RangeBarBoundInput = ({ api, value, optional, fallbackNumber, excludeColum
|
|
|
105
106
|
'twa:[&_.ab-Input]:w-full twa:[&_.ab-Input]:rounded-l-none!',
|
|
106
107
|
'twa:[&_[data-slot=input-group]]:w-full! twa:[&_[data-slot=input-group]]:rounded-l-none!',
|
|
107
108
|
].join(' ');
|
|
108
|
-
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 })] }));
|
|
109
110
|
};
|
|
110
|
-
const formatRangeBarCellTextSummary = (cellText) => cellText
|
|
111
|
-
|
|
112
|
-
.join(' + ') ?? '';
|
|
113
|
-
const formatRangeBarToolTipSummary = (toolTipText) => toolTipText
|
|
114
|
-
?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value'))
|
|
115
|
-
.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(' + ') ?? '';
|
|
116
113
|
export const getStyledColumnRangeBarRangeViewValues = (data) => {
|
|
117
114
|
const range = data.RangeBarStyle;
|
|
118
115
|
if (!range) {
|
|
@@ -122,8 +119,8 @@ export const getStyledColumnRangeBarRangeViewValues = (data) => {
|
|
|
122
119
|
`Min: ${summarizeBound(range.Min)}`,
|
|
123
120
|
`Max: ${summarizeBound(range.Max)}`,
|
|
124
121
|
];
|
|
125
|
-
if (range.Reference != undefined) {
|
|
126
|
-
items.push(`Reference: ${summarizeBound(range.Reference)}`);
|
|
122
|
+
if (range.Reference?.Value != undefined) {
|
|
123
|
+
items.push(`Reference: ${summarizeBound(range.Reference.Value)}`);
|
|
127
124
|
}
|
|
128
125
|
const bandCount = range.CellRanges?.length ?? 0;
|
|
129
126
|
if (bandCount > 0) {
|
|
@@ -137,7 +134,8 @@ export const getStyledColumnRangeBarRangeViewValues = (data) => {
|
|
|
137
134
|
const buildStyledColumnRangeBarDisplaySummaryStrings = (range, options) => {
|
|
138
135
|
const items = [];
|
|
139
136
|
const valueMarker = range.Marker;
|
|
140
|
-
const
|
|
137
|
+
const referenceProperties = range.Reference;
|
|
138
|
+
const referenceMarker = referenceProperties?.Marker;
|
|
141
139
|
items.push(`Value Marker Shape: ${valueMarker?.Shape ?? 'Diamond'}`);
|
|
142
140
|
if (valueMarker?.Color) {
|
|
143
141
|
items.push(`Value Marker Colour: ${valueMarker.Color}`);
|
|
@@ -145,7 +143,7 @@ const buildStyledColumnRangeBarDisplaySummaryStrings = (range, options) => {
|
|
|
145
143
|
if (valueMarker?.Size != null) {
|
|
146
144
|
items.push(`Value Marker Size: ${valueMarker.Size}px`);
|
|
147
145
|
}
|
|
148
|
-
if (
|
|
146
|
+
if (referenceProperties?.Value != undefined) {
|
|
149
147
|
items.push(`Reference Marker Shape: ${referenceMarker?.Shape ?? 'Line'}`);
|
|
150
148
|
if (referenceMarker?.Color) {
|
|
151
149
|
items.push(`Reference Marker Colour: ${referenceMarker.Color}`);
|
|
@@ -157,25 +155,31 @@ const buildStyledColumnRangeBarDisplaySummaryStrings = (range, options) => {
|
|
|
157
155
|
if (range.Orientation === 'Vertical') {
|
|
158
156
|
items.push('Orientation: Vertical');
|
|
159
157
|
}
|
|
160
|
-
const
|
|
158
|
+
const outOfRangeProperties = range.OutOfRange;
|
|
159
|
+
const outOfRangeMode = outOfRangeProperties?.Mode ?? 'Clamp';
|
|
161
160
|
if (outOfRangeMode !== 'Clamp') {
|
|
162
161
|
items.push(`Out of Range: ${outOfRangeMode}`);
|
|
163
162
|
}
|
|
164
|
-
if (
|
|
165
|
-
items.push(`Out of Range Colour: ${
|
|
163
|
+
if (outOfRangeProperties?.Color) {
|
|
164
|
+
items.push(`Out of Range Colour: ${outOfRangeProperties.Color}`);
|
|
166
165
|
}
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
const trackProperties = range.Track;
|
|
167
|
+
if (trackProperties?.Color) {
|
|
168
|
+
items.push(`Track Colour: ${trackProperties.Color}`);
|
|
169
169
|
}
|
|
170
|
-
if (
|
|
171
|
-
items.push(`Track Height: ${
|
|
170
|
+
if (trackProperties?.Height != null) {
|
|
171
|
+
items.push(`Track Height: ${trackProperties.Height}px`);
|
|
172
172
|
}
|
|
173
173
|
if (range.BackColor) {
|
|
174
174
|
items.push(`Back Colour: ${range.BackColor}`);
|
|
175
175
|
}
|
|
176
|
-
if (range.
|
|
177
|
-
|
|
178
|
-
items.push(`Cell Text
|
|
176
|
+
if (hasBarStyleCellTextConfigured(range.CellTextProperties)) {
|
|
177
|
+
const tokens = getActiveBarStyleCellTextTokens(range.CellTextProperties);
|
|
178
|
+
items.push(`Cell Text: ${formatRangeBarCellTextSummary(tokens)}`);
|
|
179
|
+
const layoutSummary = formatBarStyleCellTextLayoutSummary(resolveBarStyleCellTextLayout(range.CellTextProperties));
|
|
180
|
+
if (layoutSummary) {
|
|
181
|
+
items.push(`Placement: ${layoutSummary}`);
|
|
182
|
+
}
|
|
179
183
|
}
|
|
180
184
|
else if (options.includeEmptyCellText) {
|
|
181
185
|
items.push('Cell Text: None');
|
|
@@ -321,22 +325,50 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
321
325
|
},
|
|
322
326
|
});
|
|
323
327
|
}, [data, range]);
|
|
324
|
-
const
|
|
328
|
+
const updateBackColor = (color) => {
|
|
325
329
|
if (color) {
|
|
326
|
-
update({
|
|
330
|
+
update({ BackColor: color });
|
|
327
331
|
return;
|
|
328
332
|
}
|
|
329
333
|
const next = { ...range };
|
|
330
|
-
delete next
|
|
334
|
+
delete next.BackColor;
|
|
331
335
|
props.onChange({ ...data, RangeBarStyle: next });
|
|
332
336
|
};
|
|
337
|
+
const updateTrackProperties = (patch) => {
|
|
338
|
+
const merged = {
|
|
339
|
+
...range.Track,
|
|
340
|
+
...patch,
|
|
341
|
+
};
|
|
342
|
+
const isEmpty = merged.Color == undefined && merged.Height == undefined;
|
|
343
|
+
update({ Track: isEmpty ? undefined : merged });
|
|
344
|
+
};
|
|
345
|
+
const updateOutOfRangeProperties = (patch) => {
|
|
346
|
+
const merged = {
|
|
347
|
+
...range.OutOfRange,
|
|
348
|
+
...patch,
|
|
349
|
+
};
|
|
350
|
+
// Default mode is `Clamp` with no override colour; drop the wrapper in
|
|
351
|
+
// that case so empty state serialises cleanly.
|
|
352
|
+
const isEmpty = (merged.Mode == undefined || merged.Mode === 'Clamp') && merged.Color == undefined;
|
|
353
|
+
update({ OutOfRange: isEmpty ? undefined : merged });
|
|
354
|
+
};
|
|
355
|
+
const updateReferenceProperties = (patch) => {
|
|
356
|
+
const merged = {
|
|
357
|
+
Value: range.Reference?.Value,
|
|
358
|
+
...range.Reference,
|
|
359
|
+
...patch,
|
|
360
|
+
};
|
|
361
|
+
update({ Reference: merged });
|
|
362
|
+
};
|
|
333
363
|
// -- Bound editors ---------------------------------------------------------
|
|
334
364
|
// Resolved values for the column-wide aggregate bound modes, shown read-only
|
|
335
365
|
// in the bound editor so the user sees the underlying number.
|
|
336
366
|
const resolvedBoundValues = {
|
|
337
367
|
'Col-Min': minMaxRangeValues?.min,
|
|
338
368
|
'Col-Max': minMaxRangeValues?.max,
|
|
339
|
-
'Col-Avg': column
|
|
369
|
+
'Col-Avg': column
|
|
370
|
+
? api.styledColumnApi.internalApi.getAvgValueForNumericColumn(column)
|
|
371
|
+
: undefined,
|
|
340
372
|
'Col-Median': column
|
|
341
373
|
? api.styledColumnApi.internalApi.getMedianValueForNumericColumn(column)
|
|
342
374
|
: undefined,
|
|
@@ -348,6 +380,16 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
348
380
|
*/
|
|
349
381
|
const renderBoundEditor = (opts) => {
|
|
350
382
|
const setBound = (next) => {
|
|
383
|
+
if (opts.field === 'Reference') {
|
|
384
|
+
if (next === undefined) {
|
|
385
|
+
const cleaned = { ...range };
|
|
386
|
+
delete cleaned.Reference;
|
|
387
|
+
props.onChange({ ...data, RangeBarStyle: cleaned });
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
updateReferenceProperties({ Value: next });
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
351
393
|
if (next === undefined) {
|
|
352
394
|
const cleaned = { ...range };
|
|
353
395
|
delete cleaned[opts.field];
|
|
@@ -356,7 +398,8 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
356
398
|
}
|
|
357
399
|
update({ [opts.field]: next });
|
|
358
400
|
};
|
|
359
|
-
|
|
401
|
+
const value = opts.field === 'Reference' ? range.Reference?.Value : range[opts.field];
|
|
402
|
+
return (_jsx(FormRow, { label: `${opts.label}:`, children: _jsx(RangeBarBoundInput, { api: api, value: value, optional: opts.optional, fallbackNumber: opts.fallbackNumber, excludeColumnId: data.ColumnId, resolved: resolvedBoundValues, disabled: disabled, onChange: setBound }) }));
|
|
360
403
|
};
|
|
361
404
|
// -- Marker editors --------------------------------------------------------
|
|
362
405
|
const updateValueMarker = (patch) => {
|
|
@@ -369,10 +412,10 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
369
412
|
});
|
|
370
413
|
};
|
|
371
414
|
const updateReferenceMarker = (patch) => {
|
|
372
|
-
|
|
373
|
-
|
|
415
|
+
updateReferenceProperties({
|
|
416
|
+
Marker: {
|
|
374
417
|
Shape: 'Line',
|
|
375
|
-
...range.
|
|
418
|
+
...range.Reference?.Marker,
|
|
376
419
|
...patch,
|
|
377
420
|
},
|
|
378
421
|
});
|
|
@@ -384,18 +427,20 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
384
427
|
Color: range.Marker?.Color ?? '',
|
|
385
428
|
Size: range.Marker?.Size ?? (range.Marker?.Shape === 'Line' ? 2 : 10),
|
|
386
429
|
};
|
|
430
|
+
const referenceMarkerCfg = range.Reference?.Marker;
|
|
387
431
|
const referenceMarker = {
|
|
388
|
-
Shape:
|
|
389
|
-
Color:
|
|
390
|
-
Size:
|
|
432
|
+
Shape: referenceMarkerCfg?.Shape ?? 'Line',
|
|
433
|
+
Color: referenceMarkerCfg?.Color ?? '',
|
|
434
|
+
Size: referenceMarkerCfg?.Size ?? (referenceMarkerCfg?.Shape === 'Line' ? 2 : 8),
|
|
391
435
|
};
|
|
392
436
|
// -- Cell text -------------------------------------------------------------
|
|
393
|
-
const toggleCellText = (token,
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
437
|
+
const toggleCellText = (token, show) => {
|
|
438
|
+
update(toggleBarStyleCellTextToken(range.CellTextProperties, token, show));
|
|
439
|
+
};
|
|
440
|
+
const onCellTextPlacementChange = (token, patch) => {
|
|
441
|
+
update({
|
|
442
|
+
CellTextProperties: patchBarStyleCellTextPlacement(range.CellTextProperties, token, patch),
|
|
443
|
+
});
|
|
399
444
|
};
|
|
400
445
|
const toggleToolTipText = (token, checked) => {
|
|
401
446
|
const current = range.ToolTipText ?? [];
|
|
@@ -404,9 +449,6 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
404
449
|
: current.filter((t) => t !== token);
|
|
405
450
|
update({ ToolTipText: next });
|
|
406
451
|
};
|
|
407
|
-
const handleCellTextPositionChange = (pos) => {
|
|
408
|
-
update({ CellTextPosition: pos });
|
|
409
|
-
};
|
|
410
452
|
// -------------------------------------------------------------------------
|
|
411
453
|
// Render
|
|
412
454
|
// -------------------------------------------------------------------------
|
|
@@ -415,8 +457,8 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
415
457
|
? 'You need to select a column before styling.'
|
|
416
458
|
: `Column "${data.ColumnId}" was not found in the grid.` }) }));
|
|
417
459
|
}
|
|
418
|
-
const hasReference = range.Reference != undefined;
|
|
419
|
-
const outOfRangeMode = range.
|
|
460
|
+
const hasReference = range.Reference?.Value != undefined;
|
|
461
|
+
const outOfRangeMode = range.OutOfRange?.Mode ?? 'Clamp';
|
|
420
462
|
const isRangeVariant = props.variant === 'range';
|
|
421
463
|
return (_jsxs(Box, { children: [isRangeVariant && (_jsxs(_Fragment, { children: [_jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Bounds" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set each row's track scale. A bound can be a fixed number, another column's value (read per row), or a column-wide aggregate (min, max, average, median). Reference is an optional second marker." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [renderBoundEditor({
|
|
422
464
|
label: 'Min',
|
|
@@ -438,15 +480,13 @@ export const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
438
480
|
: 'Optional second marker when a Reference bound is set on the Style step.' })] }), _jsx(Card.Body, { children: hasReference ? (_jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Shape:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: referenceMarker.Shape, onValueChange: (s) => updateReferenceMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), _jsx(FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(ColorPicker, { disabled: disabled, api: api, value: referenceMarker.Color || undefined, onChange: (c) => updateReferenceMarker({ Color: c }) }) }), _jsx(FormRow, { label: "Size:", children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: referenceMarker.Size, onChange: (e) => updateReferenceMarker({ Size: Number(e.target.value) }) }) }) })] })) : (_jsx(Box, { className: "twa:text-xs twa:opacity-60 twa:max-w-[520px]", children: "Add a Reference value on the Style step (Bounds section) to enable this marker (e.g. previous close, target, midpoint)." })) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Track" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "The line representing the [Min, Max] interval, plus optional cell background." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Orientation:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: range.Orientation ?? 'Horizontal', onValueChange: (v) => update({ Orientation: v }), items: [
|
|
439
481
|
{ value: 'Horizontal', label: 'Horizontal' },
|
|
440
482
|
{ value: 'Vertical', label: 'Vertical' },
|
|
441
|
-
] }) }) }), range.Orientation === 'Vertical' && (_jsx(FormRow, { label: "", children: _jsxs(Box, { className: "twa:text-xs twa:text-neutral-500 twa:max-w-[520px]", children: ["Tip: vertical Range Bars 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: `Track ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(OptionalColorPicker, { disabled: disabled, api: api, value: range.
|
|
442
|
-
|
|
443
|
-
}), placeholder: "4" }) }) }), _jsx(FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(OptionalColorPicker, { disabled: disabled, api: api, value: range.BackColor ?? undefined, defaultColor: getGraySwatchColor(), onChange: (c) =>
|
|
483
|
+
] }) }) }), range.Orientation === 'Vertical' && (_jsx(FormRow, { label: "", children: _jsxs(Box, { className: "twa:text-xs twa:text-neutral-500 twa:max-w-[520px]", children: ["Tip: vertical Range Bars 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: `Track ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(OptionalColorPicker, { disabled: disabled, api: api, value: range.Track?.Color, defaultColor: getGraySwatchColor(), onChange: (c) => updateTrackProperties({ Color: c }) }) }), _jsx(FormRow, { label: range.Orientation === 'Vertical' ? 'Track Width (px):' : 'Track Height (px):', children: _jsx(Box, { className: "twa:max-w-[100px]", children: _jsx(AdaptableInput, { type: "number", min: 1, value: range.Track?.Height ?? '', onChange: (e) => updateTrackProperties({
|
|
484
|
+
Height: e.target.value === '' ? undefined : Number(e.target.value),
|
|
485
|
+
}), placeholder: "4" }) }) }), _jsx(FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(OptionalColorPicker, { disabled: disabled, api: api, value: range.BackColor ?? undefined, defaultColor: getGraySwatchColor(), onChange: (c) => updateBackColor(c) }) })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:mb-3", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Out of Range" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "How to draw the value marker when the cell value falls outside [Min, Max]." })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [_jsx(FormRow, { label: "Behaviour:", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { className: "twa:w-full", value: outOfRangeMode, onValueChange: (v) => updateOutOfRangeProperties({
|
|
486
|
+
Mode: v,
|
|
487
|
+
}), items: [
|
|
444
488
|
{ value: 'Clamp', label: 'Clamp to edge' },
|
|
445
489
|
{ value: 'Overflow', label: 'Show outside' },
|
|
446
490
|
{ value: 'Hide', label: 'Hide marker' },
|
|
447
|
-
] }) }) }), outOfRangeMode === 'Clamp' && (_jsx(FormRow, { label: `Out-of-range ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: _jsx(OptionalColorPicker, { disabled: disabled, api: api, value: range.
|
|
448
|
-
{ value: 'Above', label: 'Above Bar' },
|
|
449
|
-
{ value: 'Below', label: 'Below Bar' },
|
|
450
|
-
{ value: 'Merged', label: 'Merged' },
|
|
451
|
-
] }) }) }), _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 })] }))] }));
|
|
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 })] }))] }));
|
|
452
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
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BarStyleCellTextPlacement, BarStyleCellTextProperties } from '../../../../../AdaptableState/StyledColumns/Common/BarStyleProperties';
|
|
3
|
+
import { CellTextOption } from '../../../../../AdaptableState/StyledColumns/Common/CellTextOptions';
|
|
4
|
+
export declare const BarStyleCellTextLayoutEditor: React.FunctionComponent<{
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
cellTextProperties?: BarStyleCellTextProperties;
|
|
7
|
+
onToggle: (token: CellTextOption, show: boolean) => void;
|
|
8
|
+
onPlacementChange: (token: CellTextOption, patch: Partial<BarStyleCellTextPlacement>) => void;
|
|
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
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BarStyleCellTextProperties } from '../../../../../AdaptableState/StyledColumns/Common/BarStyleProperties';
|
|
3
|
+
import { BarStyleCellTextLabels } from '../../../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
4
|
+
/**
|
|
5
|
+
* Preview of the per-value cell-text layout. Renders three potential bands:
|
|
6
|
+
* - `Above` slots (above the bar)
|
|
7
|
+
* - `Merged` slots (overlay on top of the bar — uses `mergedOverlayClassName`)
|
|
8
|
+
* - `Below` slots (below the bar)
|
|
9
|
+
*
|
|
10
|
+
* Each band has three horizontal slots (Left/Center/Right) so the spacing is
|
|
11
|
+
* stable. When `vertical` is provided, only the band matching that value is
|
|
12
|
+
* rendered (used by the preview cards to position bands around the bar).
|
|
13
|
+
*/
|
|
14
|
+
export declare const BarStyleCellTextPreview: React.FunctionComponent<{
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
cellTextProperties?: BarStyleCellTextProperties;
|
|
18
|
+
labels: BarStyleCellTextLabels;
|
|
19
|
+
mergedOverlayClassName?: string;
|
|
20
|
+
/** Render only the band matching this vertical position. */
|
|
21
|
+
vertical?: 'Above' | 'Below' | 'Merged';
|
|
22
|
+
}>;
|
|
23
|
+
export declare const shouldShowBarStyleCellTextOutsideBar: (cellTextProperties: BarStyleCellTextProperties | undefined, hasCellText: boolean) => boolean;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getBarStyleCellTextSlotPresence, hasBarStyleCellTextConfigured, resolveBarStyleCellTextSlots, } from '../../../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
3
|
+
import { Box, Flex } from '../../../../../components/Flex';
|
|
4
|
+
const HORIZONTAL_ORDER = ['Left', 'Center', 'Right'];
|
|
5
|
+
const HORIZONTAL_JUSTIFY = {
|
|
6
|
+
Left: 'flex-start',
|
|
7
|
+
Center: 'center',
|
|
8
|
+
Right: 'flex-end',
|
|
9
|
+
};
|
|
10
|
+
const HORIZONTAL_TEXT_ALIGN = {
|
|
11
|
+
Left: 'left',
|
|
12
|
+
Center: 'center',
|
|
13
|
+
Right: 'right',
|
|
14
|
+
};
|
|
15
|
+
const CellTextRow = ({ className, style, slots }) => (_jsx(Flex, { className: className, alignItems: "center", style: { ...style, width: '100%', gap: 4 }, children: HORIZONTAL_ORDER.map((horizontal) => {
|
|
16
|
+
const slot = slots.find((s) => s.horizontal === horizontal);
|
|
17
|
+
return (_jsx(Box, { className: "twa:truncate", style: {
|
|
18
|
+
flex: 1,
|
|
19
|
+
minWidth: 0,
|
|
20
|
+
display: 'flex',
|
|
21
|
+
justifyContent: HORIZONTAL_JUSTIFY[horizontal],
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
textAlign: HORIZONTAL_TEXT_ALIGN[horizontal],
|
|
24
|
+
}, children: slot?.text ?? '' }, horizontal));
|
|
25
|
+
}) }));
|
|
26
|
+
/**
|
|
27
|
+
* Preview of the per-value cell-text layout. Renders three potential bands:
|
|
28
|
+
* - `Above` slots (above the bar)
|
|
29
|
+
* - `Merged` slots (overlay on top of the bar — uses `mergedOverlayClassName`)
|
|
30
|
+
* - `Below` slots (below the bar)
|
|
31
|
+
*
|
|
32
|
+
* Each band has three horizontal slots (Left/Center/Right) so the spacing is
|
|
33
|
+
* stable. When `vertical` is provided, only the band matching that value is
|
|
34
|
+
* rendered (used by the preview cards to position bands around the bar).
|
|
35
|
+
*/
|
|
36
|
+
export const BarStyleCellTextPreview = ({ className, style, cellTextProperties, labels, mergedOverlayClassName, vertical }) => {
|
|
37
|
+
if (!labels.cellValue && !labels.percentage) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const slots = resolveBarStyleCellTextSlots(cellTextProperties, labels);
|
|
41
|
+
if (!slots.length) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const bandSlots = vertical ? slots.filter((s) => s.vertical === vertical) : slots;
|
|
45
|
+
if (!bandSlots.length) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const usedClassName = vertical === 'Merged' ? mergedOverlayClassName ?? className : className;
|
|
49
|
+
return (_jsx(CellTextRow, { className: usedClassName, style: style, slots: bandSlots.map((s) => ({ horizontal: s.horizontal, text: s.text })) }));
|
|
50
|
+
};
|
|
51
|
+
export const shouldShowBarStyleCellTextOutsideBar = (cellTextProperties, hasCellText) => {
|
|
52
|
+
if (!hasCellText || !hasBarStyleCellTextConfigured(cellTextProperties)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
const { hasAbove, hasBelow } = getBarStyleCellTextSlotPresence(cellTextProperties);
|
|
56
|
+
return hasAbove || hasBelow;
|
|
57
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BulletChartStyle } from '../../../../../AdaptableState/
|
|
2
|
+
import { BulletChartStyle } from '../../../../../AdaptableState/StyledColumns/BulletChartStyle';
|
|
3
3
|
export declare const BulletRangesSummaryPreview: React.FunctionComponent<{
|
|
4
4
|
bulletStyle: BulletChartStyle;
|
|
5
5
|
}>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { CellColorRange, ColumnComparison,
|
|
2
|
+
import { CellColorRange, ColumnComparison, NumericStyledColumn } from '../../../../../AdaptableState/StyledColumns/Common/NumericStyledColumn';
|
|
3
|
+
import { GradientStyle, ZeroCentredColors } from '../../../../../AdaptableState/StyledColumns/GradientStyle';
|
|
3
4
|
import { AdaptableApi } from '../../../../../types';
|
|
4
5
|
export declare function gradientRangeStripCss(color: string, reverseGradient: boolean, minAlpha: number, maxAlpha: number): string;
|
|
5
6
|
export interface GradientRangesSummaryPreviewProps {
|
|
6
7
|
ranges?: CellColorRange[];
|
|
7
|
-
zeroCentred?:
|
|
8
|
+
zeroCentred?: ZeroCentredColors;
|
|
8
9
|
rangeValueType: NumericStyledColumn['RangeValueType'];
|
|
9
10
|
gradientStyle?: Pick<GradientStyle, 'MinAlpha' | 'MaxAlpha'>;
|
|
10
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,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RangeBarStyle } from '../../../../../AdaptableState/
|
|
2
|
+
import { RangeBarStyle } from '../../../../../AdaptableState/StyledColumns/RangeBarStyle';
|
|
3
3
|
export declare const RangeBarRangesSummaryPreview: React.FunctionComponent<{
|
|
4
4
|
rangeStyle: RangeBarStyle;
|
|
5
5
|
}>;
|
|
@@ -51,12 +51,13 @@ export const StyledColumnBadgePreview = ({ data }) => {
|
|
|
51
51
|
: {}),
|
|
52
52
|
};
|
|
53
53
|
return (_jsx(Box, { className: PREVIEW_CELL_CLASS, style: cellStyle, children: _jsx("div", { className: wrapperClassName, style: wrapperStyle, children: badgeStyle.Badges.map((badge, index) => {
|
|
54
|
-
const
|
|
54
|
+
const iconProps = badge.IconProperties;
|
|
55
|
+
const badgeValue = iconProps?.IconOnly
|
|
55
56
|
? ''
|
|
56
57
|
: dataType === 'number'
|
|
57
58
|
? DEFAULT_INTEGER_DISPLAY_VALUE
|
|
58
59
|
: DEFAULT_STRING_DISPLAY_VALUE;
|
|
59
|
-
return (_jsx(Badge, { icon:
|
|
60
|
+
return (_jsx(Badge, { icon: iconProps?.Icon, pillStyle: badge.PillStyle, iconPosition: iconProps?.Position, shape: badge.Shape, density: badgeStyle.Density ?? 'Normal', iconGap: iconProps?.Gap, children: badgeValue }, index));
|
|
60
61
|
}) }) }));
|
|
61
62
|
};
|
|
62
63
|
export const StyledColumnBadgePreviewCard = ({ data }) => (_jsxs(Card, { shadow: false, children: [_jsx(Card.Title, { children: _jsx(Box, { className: "twa:font-medium", children: "Preview" }) }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(StyledColumnBadgePreview, { data: data }) })] }));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { StyledColumn } from '../../../../../AdaptableState/StyledColumnState';
|
|
3
|
+
import { BulletChartStyle } from '../../../../../AdaptableState/StyledColumns/BulletChartStyle';
|
|
3
4
|
export declare const StyledColumnBulletPreview: React.FunctionComponent<React.PropsWithChildren<{
|
|
4
5
|
data: StyledColumn;
|
|
5
6
|
}>>;
|
|
@@ -1,9 +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 { buildBarStyleCellTextLabels, getBarStyleCellTextSlotPresence, hasBarStyleCellTextConfigured, } from '../../../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
3
4
|
import { Box, Flex } from '../../../../../components/Flex';
|
|
4
5
|
import { Card } from '../../../../../components/Card';
|
|
5
6
|
import { Tag } from '../../../../../components/Tag';
|
|
6
7
|
import { StyledColumnBulletChartListPreview } from './StyledColumnChartListPreviews';
|
|
8
|
+
import { BarStyleCellTextPreview } from './BarStyleCellTextPreview';
|
|
7
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)]';
|
|
8
10
|
const getBulletPreviewSample = (bullet) => {
|
|
9
11
|
const ranges = bullet.CellRanges ?? [];
|
|
@@ -23,29 +25,23 @@ const getBulletPreviewSample = (bullet) => {
|
|
|
23
25
|
valueFraction: Math.max(0, Math.min(1, valueFraction)),
|
|
24
26
|
};
|
|
25
27
|
};
|
|
26
|
-
const formatBulletPreviewCellText = (sampleValue, valueFraction, bullet) => {
|
|
27
|
-
const parts = [];
|
|
28
|
-
if (bullet.CellText?.includes('CellValue')) {
|
|
29
|
-
parts.push(Number.isInteger(sampleValue) ? String(sampleValue) : sampleValue.toFixed(1));
|
|
30
|
-
}
|
|
31
|
-
if (bullet.CellText?.includes('PercentageValue')) {
|
|
32
|
-
parts.push(`${(valueFraction * 100).toFixed(0)}%`);
|
|
33
|
-
}
|
|
34
|
-
return parts.join(' ');
|
|
35
|
-
};
|
|
36
28
|
const BulletChartPreviewContent = ({ bullet, }) => {
|
|
37
29
|
const { sampleValue, valueFraction } = getBulletPreviewSample(bullet);
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
30
|
+
const cellTextProperties = bullet.CellTextProperties;
|
|
31
|
+
const labels = buildBarStyleCellTextLabels(cellTextProperties, Number.isInteger(sampleValue) ? String(sampleValue) : sampleValue.toFixed(1), `${(valueFraction * 100).toFixed(0)}%`);
|
|
32
|
+
const hasCellText = hasBarStyleCellTextConfigured(cellTextProperties) &&
|
|
33
|
+
Boolean(labels.cellValue || labels.percentage);
|
|
34
|
+
const presence = getBarStyleCellTextSlotPresence(cellTextProperties);
|
|
41
35
|
const fontStyle = bullet.Font ? convertAdaptableStyleToCSS(bullet.Font) : undefined;
|
|
42
36
|
const isVertical = bullet.Orientation === 'Vertical';
|
|
37
|
+
const cellTextClassName = 'ab-BulletChart__text twa:text-2 twa:leading-tight twa:truncate twa:max-w-full';
|
|
43
38
|
const chartEl = _jsx(StyledColumnBulletChartListPreview, { bullet: bullet });
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
// Merged-only with no outside bands → relative container so the overlay sits
|
|
40
|
+
// on top of the chart, matching the runtime renderer's behaviour.
|
|
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(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" })] }));
|
|
47
43
|
}
|
|
48
|
-
return (_jsxs(Flex, { className: "ab-BulletChart__wrapper", flexDirection: "column", alignItems: isVertical ? 'center' : 'stretch', style: { justifyContent: 'center', gap: hasCellText ? 2 : 0 }, children: [hasCellText &&
|
|
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" }))] }));
|
|
49
45
|
};
|
|
50
46
|
export const StyledColumnBulletPreview = ({ data }) => {
|
|
51
47
|
const bullet = data.BulletChartStyle;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BulletChartStyle
|
|
2
|
+
import { BulletChartStyle } from '../../../../../AdaptableState/StyledColumns/BulletChartStyle';
|
|
3
|
+
import { RangeBarStyle } from '../../../../../AdaptableState/StyledColumns/RangeBarStyle';
|
|
3
4
|
/**
|
|
4
5
|
* Compact schematic of a Range Bar (bands + track + value / reference markers)
|
|
5
6
|
* for the Styled Columns object list and wizard step summaries.
|
|
@@ -41,10 +41,10 @@ const DEFAULT_MARKER = 'var(--ab-color-foreground, #333)';
|
|
|
41
41
|
export const StyledColumnRangeBarListPreview = (props) => {
|
|
42
42
|
const { range } = props;
|
|
43
43
|
const segments = bandSegmentsForPreview(range.CellRanges);
|
|
44
|
-
const trackFill = range.
|
|
44
|
+
const trackFill = range.Track?.Color ?? DEFAULT_TRACK;
|
|
45
45
|
const valueColor = range.Marker?.Color || DEFAULT_BAR;
|
|
46
|
-
const refColor = range.
|
|
47
|
-
const hasRef = range.Reference != undefined;
|
|
46
|
+
const refColor = range.Reference?.Marker?.Color || DEFAULT_MARKER;
|
|
47
|
+
const hasRef = range.Reference?.Value != undefined;
|
|
48
48
|
const isVertical = range.Orientation === 'Vertical';
|
|
49
49
|
return (_jsx(Box, { className: "twa:rounded twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_12%,transparent)] twa:bg-[color-mix(in_srgb,var(--ab-color-primary)_40%,transparent)] twa:px-1 twa:py-0.5", style: { width: PREVIEW_WIDTH, height: PREVIEW_HEIGHT }, children: _jsxs("svg", { width: "100%", height: "100%", viewBox: `0 0 ${VB_W} ${VB_H}`, preserveAspectRatio: "none", "aria-hidden": true, children: [segments.length === 0 ? (_jsx("rect", { x: "0", y: "0", width: VB_W, height: VB_H, fill: range.BackColor ?? 'transparent' })) : (segments.map((s, i) => (_jsx("rect", { x: s.x0 * VB_W, y: "0", width: (s.x1 - s.x0) * VB_W, height: VB_H, fill: s.color, opacity: 0.55 }, i)))), isVertical ? (_jsxs(_Fragment, { children: [_jsx("rect", { x: VB_W * 0.42, y: "2", width: "5", height: VB_H - 4, rx: "1", fill: trackFill }), hasRef && (_jsx("line", { x1: VB_W * 0.46, y1: "3", x2: VB_W * 0.46, y2: VB_H - 3, stroke: refColor, strokeWidth: "2", vectorEffect: "non-scaling-stroke" })), _jsx("polygon", { points: `${VB_W * 0.52},${VB_H * 0.35} ${VB_W * 0.62},${VB_H * 0.5} ${VB_W * 0.52},${VB_H * 0.65}`, fill: valueColor })] })) : (_jsxs(_Fragment, { children: [_jsx("rect", { x: "2", y: VB_H * 0.38, width: VB_W - 4, height: "5", rx: "1", fill: trackFill }), hasRef && (_jsx("line", { x1: VB_W * 0.38, y1: VB_H * 0.2, x2: VB_W * 0.38, y2: VB_H * 0.8, stroke: refColor, strokeWidth: "2", vectorEffect: "non-scaling-stroke" })), _jsx("polygon", { points: `${VB_W * 0.72},${VB_H * 0.2} ${VB_W * 0.82},${VB_H * 0.5} ${VB_W * 0.72},${VB_H * 0.8}`, fill: valueColor })] }))] }) }));
|
|
50
50
|
};
|
|
@@ -55,7 +55,7 @@ export const StyledColumnRangeBarListPreview = (props) => {
|
|
|
55
55
|
export const StyledColumnBulletChartListPreview = (props) => {
|
|
56
56
|
const { bullet } = props;
|
|
57
57
|
const segments = bandSegmentsForPreview(bullet.CellRanges);
|
|
58
|
-
const barColor = bullet.
|
|
59
|
-
const markerColor = bullet.
|
|
58
|
+
const barColor = bullet.Bar?.Color ?? DEFAULT_BAR;
|
|
59
|
+
const markerColor = bullet.TargetProperties?.Marker?.Color || DEFAULT_MARKER;
|
|
60
60
|
return (_jsx(Box, { className: "twa:rounded twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_12%,transparent)] twa:bg-[color-mix(in_srgb,var(--ab-color-primary)_40%,transparent)] twa:px-1 twa:py-0.5", style: { width: PREVIEW_WIDTH, height: PREVIEW_HEIGHT }, children: _jsxs("svg", { width: "100%", height: "100%", viewBox: `0 0 ${VB_W} ${VB_H}`, preserveAspectRatio: "none", "aria-hidden": true, children: [segments.length === 0 ? (_jsx("rect", { x: "0", y: "0", width: VB_W, height: VB_H, fill: bullet.BackColor ?? 'transparent' })) : (segments.map((s, i) => (_jsx("rect", { x: s.x0 * VB_W, y: "2", width: (s.x1 - s.x0) * VB_W, height: VB_H - 4, fill: s.color, opacity: 0.5 }, i)))), _jsx("rect", { x: VB_W * 0.04, y: VB_H * 0.35, width: VB_W * 0.58, height: VB_H * 0.3, rx: "1", fill: barColor }), _jsx("line", { x1: VB_W * 0.78, y1: VB_H * 0.12, x2: VB_W * 0.78, y2: VB_H * 0.88, stroke: markerColor, strokeWidth: "2.5", vectorEffect: "non-scaling-stroke" })] }) }));
|
|
61
61
|
};
|