@adaptabletools/adaptable 23.0.4 → 23.0.5-canary.1
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/agGrid.js +0 -31
- package/index.css +0 -64
- package/index.js +0 -31
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -2
- package/src/AdaptableOptions/AdaptablePlugin.js +1 -9
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +3 -39
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +44 -16
- package/src/AdaptableState/Aggregations/only.js +0 -11
- package/src/AdaptableState/Aggregations/weightedAverage.d.ts +0 -1
- package/src/AdaptableState/Aggregations/weightedAverage.js +1 -27
- package/src/AdaptableState/Common/AdaptableColumn.js +0 -1
- package/src/AdaptableState/Common/AdaptableForm.js +0 -49
- package/src/AdaptableState/Common/AdaptableFormatPresets.js +0 -13
- package/src/AdaptableState/Common/AdaptablePredicate.js +3 -125
- package/src/AdaptableState/Common/AggregationColumns.js +0 -10
- package/src/AdaptableState/Common/Enums.js +0 -3
- package/src/AdaptableState/Common/Menu.js +1 -7
- package/src/AdaptableState/Common/MenuItem.js +0 -2
- package/src/AdaptableState/Common/Types.js +2 -5
- package/src/AdaptableState/StatusBarState.js +0 -3
- package/src/AdaptableState/StyledColumns/BadgeStyle.js +0 -1
- package/src/AdaptableState/StyledColumns/Common/BarStyleProperties.js +0 -4
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.js +0 -5
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.js +0 -8
- package/src/AdaptableState/Uuid.js +0 -1
- package/src/Api/Implementation/AdaptableApiImpl.js +0 -4
- package/src/Api/Implementation/AlertApiImpl.js +0 -21
- package/src/Api/Implementation/ApiBase.js +0 -24
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +0 -1
- package/src/Api/Implementation/ChartingApiImpl.js +0 -3
- package/src/Api/Implementation/ColumnApiImpl.js +1 -15
- package/src/Api/Implementation/ColumnFilterApiImpl.js +0 -9
- package/src/Api/Implementation/ColumnScopeApiImpl.js +0 -21
- package/src/Api/Implementation/DashboardApiImpl.js +0 -1
- package/src/Api/Implementation/EntitlementApiImpl.js +0 -1
- package/src/Api/Implementation/ExportApiImpl.js +0 -10
- package/src/Api/Implementation/ExpressionApiImpl.js +0 -1
- package/src/Api/Implementation/FormatColumnApiImpl.js +0 -3
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +0 -2
- package/src/Api/Implementation/GridApiImpl.js +1 -22
- package/src/Api/Implementation/GridFilterApiImpl.js +0 -2
- package/src/Api/Implementation/LayoutApiImpl.js +0 -18
- package/src/Api/Implementation/LayoutHelpers.js +0 -16
- package/src/Api/Implementation/NamedQueryApiImpl.js +0 -1
- package/src/Api/Implementation/PredicateApiImpl.js +0 -5
- package/src/Api/Implementation/RowFormApiImpl.js +0 -2
- package/src/Api/Implementation/StateApiImpl.js +0 -7
- package/src/Api/Implementation/SystemStatusApiImpl.js +0 -2
- package/src/Api/Implementation/TeamSharingApiImpl.js +0 -3
- package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -1
- package/src/Api/Internal/ActionColumnInternalApi.js +0 -1
- package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -2
- package/src/Api/Internal/AdaptableInternalApi.js +1 -39
- package/src/Api/Internal/AlertInternalApi.js +1 -102
- package/src/Api/Internal/CalculatedColumnInternalApi.js +0 -17
- package/src/Api/Internal/ChartingInternalApi.js +0 -1
- package/src/Api/Internal/ColumnFilterInternalApi.js +0 -52
- package/src/Api/Internal/ColumnInternalApi.js +0 -32
- package/src/Api/Internal/CustomSortInternalApi.js +0 -5
- package/src/Api/Internal/DashboardInternalApi.js +0 -23
- package/src/Api/Internal/DataImportInternalApi.js +0 -1
- package/src/Api/Internal/EventInternalApi.js +0 -2
- package/src/Api/Internal/ExportInternalApi.js +1 -16
- package/src/Api/Internal/ExpressionInternalApi.js +0 -23
- package/src/Api/Internal/Fdc3InternalApi.js +0 -9
- package/src/Api/Internal/FlashingCellInternalApi.js +0 -5
- package/src/Api/Internal/FormatColumnInternalApi.js +5 -107
- package/src/Api/Internal/FreeTextColumnInternalApi.js +0 -8
- package/src/Api/Internal/GridFilterInternalApi.js +0 -3
- package/src/Api/Internal/GridInternalApi.js +0 -37
- package/src/Api/Internal/LayoutInternalApi.js +0 -18
- package/src/Api/Internal/NamedQueryInternalApi.js +0 -9
- package/src/Api/Internal/PredicateInternalApi.js +0 -23
- package/src/Api/Internal/RowFormInternalApi.js +0 -18
- package/src/Api/Internal/StateInternalApi.js +0 -25
- package/src/Api/Internal/StyledColumnInternalApi.js +0 -62
- package/src/Api/Internal/TeamSharingInternalApi.js +0 -9
- package/src/Redux/ActionsReducers/AlertRedux.js +0 -24
- package/src/Redux/ActionsReducers/ApplicationRedux.js +0 -9
- package/src/Redux/ActionsReducers/BulkUpdateRedux.js +0 -6
- package/src/Redux/ActionsReducers/CalculatedColumnRedux.js +1 -16
- package/src/Redux/ActionsReducers/ChartingRedux.js +0 -24
- package/src/Redux/ActionsReducers/CommentsRedux.js +0 -24
- package/src/Redux/ActionsReducers/CustomSortRedux.js +0 -24
- package/src/Redux/ActionsReducers/DashboardRedux.js +0 -33
- package/src/Redux/ActionsReducers/ExportRedux.js +0 -36
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +0 -24
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +0 -36
- package/src/Redux/ActionsReducers/FreeTextColumnRedux.js +1 -20
- package/src/Redux/ActionsReducers/InternalRedux.js +0 -42
- package/src/Redux/ActionsReducers/LayoutRedux.js +1 -67
- package/src/Redux/ActionsReducers/NamedQueryRedux.js +0 -15
- package/src/Redux/ActionsReducers/NoteRedux.js +0 -14
- package/src/Redux/ActionsReducers/PluginsRedux.js +0 -3
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +0 -34
- package/src/Redux/ActionsReducers/PopupRedux.js +2 -6
- package/src/Redux/ActionsReducers/QuickSearchRedux.js +0 -15
- package/src/Redux/ActionsReducers/ShortcutRedux.js +0 -24
- package/src/Redux/ActionsReducers/SmartEditRedux.js +0 -6
- package/src/Redux/ActionsReducers/StatusBarRedux.js +0 -6
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +0 -27
- package/src/Redux/ActionsReducers/SystemStatusRedux.js +0 -6
- package/src/Redux/ActionsReducers/TeamSharingRedux.js +0 -1
- package/src/Redux/ActionsReducers/ThemeRedux.js +0 -26
- package/src/Redux/ActionsReducers/ToolPanelRedux.js +0 -22
- package/src/Redux/ActionsReducers/UserInterfaceRedux.js +0 -3
- package/src/Redux/ActionsReducers/utils.js +0 -6
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +0 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +0 -25
- package/src/Redux/Store/AdaptableStore.js +5 -301
- package/src/Strategy/AdaptableModuleBase.js +0 -35
- package/src/Strategy/AlertModule.js +0 -9
- package/src/Strategy/CellSummaryModule.js +0 -12
- package/src/Strategy/ChartingModule.js +0 -1
- package/src/Strategy/ColumnFilterModule.js +1 -11
- package/src/Strategy/CommentModule.js +0 -2
- package/src/Strategy/DashboardModule.js +0 -4
- package/src/Strategy/ExportModule.js +0 -1
- package/src/Strategy/FlashingCellModule.js +0 -8
- package/src/Strategy/FormatColumnModule.js +0 -3
- package/src/Strategy/FreeTextColumnModule.js +0 -3
- package/src/Strategy/LayoutModule.js +0 -26
- package/src/Strategy/NoteModule.js +0 -3
- package/src/Strategy/PlusMinusModule.js +0 -3
- package/src/Strategy/SettingsPanelModule.js +0 -1
- package/src/Strategy/ShortcutModule.js +0 -1
- package/src/Strategy/SmartEditModule.js +0 -5
- package/src/Strategy/StatusBarModule.js +0 -7
- package/src/Strategy/StyledColumnModule.js +1 -16
- package/src/Strategy/TeamSharingModule.js +0 -9
- package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.js +0 -5
- package/src/Utilities/Constants/DocumentationLinkConstants.js +0 -1
- package/src/Utilities/Constants/GeneralConstants.js +0 -10
- package/src/Utilities/Constants/ObjectDefaultConstants.js +0 -3
- package/src/Utilities/Constants/ReduxConstants.js +4 -8
- package/src/Utilities/Emitter.js +0 -9
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +0 -8
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +0 -15
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +0 -3
- package/src/Utilities/ExpressionFunctions/deepMap.js +0 -16
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +0 -9
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +7 -78
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +0 -9
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +2 -16
- package/src/Utilities/Extensions/ArrayExtensions.js +1 -63
- package/src/Utilities/Extensions/NumberExtensions.js +0 -27
- package/src/Utilities/Extensions/ObjectExtensions.js +0 -36
- package/src/Utilities/Extensions/StringExtensions.js +0 -27
- package/src/Utilities/Helpers/ActionColumnHelper.js +0 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +0 -8
- package/src/Utilities/Helpers/DateHelper.js +0 -10
- package/src/Utilities/Helpers/DisplayFormatHelper.js +0 -8
- package/src/Utilities/Helpers/Helper.js +3 -9
- package/src/Utilities/Helpers/PlusMinusHelper.js +0 -20
- package/src/Utilities/Helpers/QuickSearchHelper.js +0 -5
- package/src/Utilities/Helpers/Scheduling/CronExpression.js +0 -43
- package/src/Utilities/Helpers/Scheduling/ScheduledReportHelper.js +0 -4
- package/src/Utilities/Helpers/SettingsPanelHelper.js +40 -4
- package/src/Utilities/Helpers/StyleHelper.js +0 -56
- package/src/Utilities/Helpers/StyledColumns/BarStylesHelper.js +0 -46
- package/src/Utilities/Helpers/StyledColumns/GradientStyleHelper.js +0 -38
- package/src/Utilities/Helpers/StyledColumns/IconStyleHelper.js +0 -39
- package/src/Utilities/Helpers/StyledColumns/PercentBarStyleHelper.js +0 -1
- package/src/Utilities/Helpers/StyledColumns/SparklineStyleHelper.js +0 -5
- package/src/Utilities/Helpers/StyledColumns/StyledColumnHelper.js +0 -37
- package/src/Utilities/Helpers/TimingHelper.js +0 -13
- package/src/Utilities/ObjectFactory.js +2 -4
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +0 -7
- package/src/Utilities/Services/AlertService.js +0 -1
- package/src/Utilities/Services/AnnotationsService.js +0 -22
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +0 -8
- package/src/Utilities/Services/ChartingService.js +0 -9
- package/src/Utilities/Services/DataService.js +0 -11
- package/src/Utilities/Services/Fdc3Service.js +0 -3
- package/src/Utilities/Services/FlashingCellService.js +0 -6
- package/src/Utilities/Services/ModuleService.js +0 -8
- package/src/Utilities/Services/QueryLanguageService.js +2 -25
- package/src/Utilities/Services/RowFormService.js +0 -1
- package/src/Utilities/Services/RowSummaryService.js +1 -20
- package/src/Utilities/Services/TeamSharingService.js +0 -15
- package/src/Utilities/Services/ThemeService.js +0 -7
- package/src/Utilities/Services/ValidationService.js +0 -21
- package/src/Utilities/createAgStatusPanelComponent.js +0 -3
- package/src/Utilities/getExpressionViewItems.js +0 -2
- package/src/Utilities/getObjectTagsViewItems.js +0 -1
- package/src/Utilities/getScrollbarSize.js +0 -1
- package/src/Utilities/logDeprecation.js +0 -3
- package/src/Utilities/resolveContainerElement.js +0 -21
- package/src/Utilities/runIfNotResolvedIn.js +0 -7
- package/src/Utilities/sortColumnStateForVisibleColumns.js +2 -12
- package/src/Utilities/waitForTimeout.js +0 -1
- package/src/Utilities/wizardSelection.js +0 -2
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/AdaptableView.js +1 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +0 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +0 -23
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +0 -2
- package/src/View/AdaptableWizardView/Wizard.js +0 -12
- package/src/View/AdaptableWizardView/helper.js +0 -11
- package/src/View/Alert/ActiveAlertsPanel.js +0 -2
- package/src/View/Alert/AlertStatusSubPanel.js +0 -8
- package/src/View/Alert/Utilities/getAlertType.js +0 -7
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +0 -5
- package/src/View/Alert/Utilities/mapAlertDefinition.js +0 -3
- package/src/View/Alert/Wizard/AlertWizard.js +0 -2
- package/src/View/Alert/Wizard/isValidAlertRules.js +0 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +0 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +0 -1
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +0 -3
- package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -7
- package/src/View/Charting/EditChartButton.js +1 -4
- package/src/View/Charting/ShowChartButton.js +0 -3
- package/src/View/Charting/useAgChartState.js +0 -5
- package/src/View/Charting/useChartingElements.js +0 -4
- package/src/View/Charting/useExternalChartState.js +0 -6
- package/src/View/ColumnInfo/ColumnInfo.js +7 -17
- package/src/View/Comments/CommentsEditor.js +1 -16
- package/src/View/Components/AdaptableButton/AdaptableButtonComponent.js +0 -1
- package/src/View/Components/AdaptableButton/AdaptableButtonView.js +0 -3
- package/src/View/Components/AdaptableDateInput/index.js +2 -9
- package/src/View/Components/AdaptableIconComponent/index.js +0 -4
- package/src/View/Components/AdaptableIconSelector/index.js +0 -3
- package/src/View/Components/AdaptableInput/index.js +0 -2
- package/src/View/Components/Badge/index.js +0 -8
- package/src/View/Components/Buttons/ButtonNewPage.js +1 -2
- package/src/View/Components/CellPopup/index.js +1 -2
- package/src/View/Components/ColumnFilter/AdaptableColumnFilter.js +0 -4
- package/src/View/Components/ColumnFilter/AdaptableFloatingFilter.js +0 -4
- package/src/View/Components/ColumnFilter/ColumnFilter.js +3 -46
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +0 -2
- package/src/View/Components/ColumnFilter/FloatingFilter.js +1 -20
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +2 -16
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +1 -4
- package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +1 -6
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +0 -20
- package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +0 -5
- package/src/View/Components/ColumnFilter/utils.js +2 -9
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicateEditor.js +0 -2
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.js +0 -1
- package/src/View/Components/EntityRulesEditor/index.js +1 -11
- package/src/View/Components/ExternalRenderer.js +1 -3
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -52
- package/src/View/Components/ModuleValueSelector/index.js +0 -2
- package/src/View/Components/Panels/PanelWithImage.js +1 -5
- package/src/View/Components/Panels/PanelWithRow.js +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +0 -6
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +0 -6
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +1 -2
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +0 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +0 -3
- package/src/View/Components/Popups/AdaptableToaster.js +0 -2
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +0 -8
- package/src/View/Components/RangesComponent.js +0 -57
- package/src/View/Components/Selectors/BulkUpdateValueSelector.js +0 -3
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -6
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -18
- package/src/View/Components/ToolPanel/ToolPanelPopupSections.js +0 -4
- package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -4
- package/src/View/Components/ValueSelector/index.js +0 -4
- package/src/View/Components/wizardColumnListStyles.js +0 -5
- package/src/View/Dashboard/CustomToolbar.js +1 -25
- package/src/View/Dashboard/PinnedToolbarsSelector.js +0 -1
- package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -22
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +0 -1
- package/src/View/DataImport/systemFileHandlers.js +1 -1
- package/src/View/FlashingCell/Wizard/isValidFlashingCellRules.js +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +0 -27
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +0 -7
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -12
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +0 -10
- package/src/View/GridFilter/GridFilterPopup.js +0 -1
- package/src/View/GridFilter/useGridFilterExpressionEditor.js +0 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +1 -31
- package/src/View/Layout/LayoutViewPanel.js +0 -2
- package/src/View/Layout/PivotDetailsPopoup.js +0 -2
- package/src/View/Layout/TransposedPopup.js +0 -7
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -6
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +0 -2
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -32
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +0 -3
- package/src/View/Layout/Wizard/sections/columnLayoutHelpers.js +0 -2
- package/src/View/Layout/Wizard/sections/layoutWizardColumns.js +0 -4
- package/src/View/Note/NotePopup.js +0 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +0 -1
- package/src/View/StatusBar/AdaptableStatusBar.js +0 -4
- package/src/View/StatusBar/StatusBarPanel.js +0 -8
- package/src/View/StatusBar/StatusBarPopup.js +0 -2
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +0 -11
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +0 -28
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -25
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +0 -26
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +0 -40
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +0 -55
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +0 -15
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +0 -21
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextPreview.js +0 -10
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +0 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +0 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +0 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +1 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +0 -21
- package/src/View/SystemStatus/SystemStatusPopup.js +0 -1
- package/src/View/TeamSharing/SharedEntityObjectView.js +0 -1
- package/src/View/Theme/ThemeSelector.js +0 -1
- package/src/View/UIHelper.js +0 -6
- package/src/View/UIInterfaces.js +0 -1
- package/src/View/Wizard/CollapsibleWizardCard.js +1 -8
- package/src/View/Wizard/OnePageWizards.js +2 -9
- package/src/View/Wizard/SummaryColorTag.js +0 -1
- package/src/View/Wizard/useKeyboardNavigation.js +1 -3
- package/src/agGrid/Adaptable.js +0 -12
- package/src/agGrid/AdaptableAgGrid.d.ts +0 -2
- package/src/agGrid/AdaptableAgGrid.js +3 -482
- package/src/agGrid/AdaptableFilterHandler.js +0 -5
- package/src/agGrid/AdaptableLogger.js +0 -6
- package/src/agGrid/AgGridAdapter.js +3 -90
- package/src/agGrid/AgGridColumnAdapter.js +6 -168
- package/src/agGrid/AgGridExportAdapter.js +4 -106
- package/src/agGrid/AgGridFilterAdapter.js +0 -5
- package/src/agGrid/AgGridFloatingFilterAdapter.js +0 -10
- package/src/agGrid/AgGridMenuAdapter.js +0 -143
- package/src/agGrid/AgGridModulesAdapter.js +0 -2
- package/src/agGrid/AgGridOptionsService.js +0 -2
- package/src/agGrid/AgGridThemeAdapter.js +0 -7
- package/src/agGrid/agGridDataTypeDefinitions.js +0 -8
- package/src/agGrid/cellRenderers/BadgeRenderer.js +0 -10
- package/src/agGrid/cellRenderers/BulletChartRenderer.js +1 -96
- package/src/agGrid/cellRenderers/IconRenderer.js +0 -55
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +0 -51
- package/src/agGrid/cellRenderers/RangeBarRenderer.js +1 -50
- package/src/agGrid/cellRenderers/RatingRenderer.js +0 -40
- package/src/agGrid/editors/AdaptableDateEditor/index.js +0 -18
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +0 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +0 -11
- package/src/agGrid/editors/AdaptablePercentageEditor/index.js +0 -9
- package/src/agGrid/index.js +1 -9
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +1 -73
- package/src/components/CodeBlock/index.d.ts +0 -1
- package/src/components/CodeBlock/index.js +1 -2
- package/src/components/ColorPicker/ColorPicker.js +0 -6
- package/src/components/Combobox/VirtualizedList.js +0 -5
- package/src/components/Combobox/index.js +5 -63
- package/src/components/Dashboard/Dashboard.js +1 -4
- package/src/components/Datepicker/index.js +2 -97
- package/src/components/DragAndDropContext/TabList.js +2 -6
- package/src/components/Drawer/index.js +0 -7
- package/src/components/Dropdown/index.js +0 -1
- package/src/components/DropdownButton/index.js +0 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -16
- package/src/components/ExpressionEditor/EditorButton.js +0 -1
- package/src/components/ExpressionEditor/EditorInput.js +1 -7
- package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +0 -1
- package/src/components/ExpressionEditor/ExpressionPreview.js +4 -14
- package/src/components/ExpressionEditor/NamedQueryContext.js +0 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +1 -6
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +0 -12
- package/src/components/ExpressionEditor/QueryBuilder/utils.js +0 -4
- package/src/components/ExpressionEditor/index.js +5 -14
- package/src/components/Icon/index.js +0 -2
- package/src/components/Input/NumberInput.js +0 -10
- package/src/components/Modal/Backdrop.js +0 -1
- package/src/components/OverlayTrigger/Overlay.js +0 -1
- package/src/components/OverlayTrigger/index.js +3 -15
- package/src/components/ProgressIndicator/ProgressIndicator.js +3 -16
- package/src/components/ResizeObserver/index.js +0 -7
- package/src/components/SimpleButton/index.js +2 -16
- package/src/components/Tabs/index.js +0 -3
- package/src/components/Tag/Tag.js +0 -1
- package/src/components/Tag/columnScopeTagHelpers.js +0 -2
- package/src/components/Textarea/index.js +1 -8
- package/src/components/Toggle/Toggle.js +1 -5
- package/src/components/Toggle/ToggleGroup.js +1 -3
- package/src/components/ToggleButton/index.js +1 -3
- package/src/components/Tree/TreeDropdown/index.js +2 -130
- package/src/components/Tree/treeUtils.js +0 -4
- package/src/components/WindowModal/WindowModal.js +1 -14
- package/src/components/WindowModal/useStacking.js +0 -7
- package/src/components/icons/bullet-chart.js +0 -4
- package/src/components/icons/icon-style.js +0 -4
- package/src/components/icons/index.js +26 -36
- package/src/components/icons/range-bar.js +0 -5
- package/src/components/icons/star.js +0 -1
- package/src/components/twUtils.js +3 -12
- package/src/components/ui/calendar.js +1 -9
- package/src/components/ui/combobox.js +0 -4
- package/src/components/utils/captureTabNavigation/getFocusableChildren.js +0 -1
- package/src/components/utils/useDraggable.js +0 -4
- package/src/components/utils/useProperty.js +0 -18
- package/src/devTools/index.js +0 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/LMEmitter.js +0 -5
- package/src/layout-manager/src/destructurePivotColumnId.js +0 -19
- package/src/layout-manager/src/index.js +2 -182
- package/src/layout-manager/src/isLayoutEqual.js +0 -1
- package/src/layout-manager/src/isPivotColumnTotal.js +0 -2
- package/src/layout-manager/src/normalizeLayoutModel.js +0 -27
- package/src/layout-manager/src/simplifyLayoutModel.js +0 -11
- package/src/layout-manager/src/sortColumnIdsByOrder.js +2 -12
- package/src/lib/utils.js +0 -1
- package/src/migration/AdaptableUpgradeHelper.js +0 -2
- package/src/migration/VersionUpgrade17.js +0 -33
- package/src/migration/VersionUpgrade20.js +1 -21
- package/src/migration/VersionUpgrade21.js +0 -3
- package/src/migration/VersionUpgrade22.js +0 -11
- package/src/migration/VersionUpgrade23.js +0 -73
- package/src/parser/src/evaluator.js +0 -1
- package/src/parser/src/index.js +0 -1
- package/src/parser/src/parser.js +4 -103
- package/src/parser/src/predicate/mapExpressionToQlPredicate.js +0 -5
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +0 -2
- package/src/parser/src/tokenizer.js +0 -2
- package/src/parser/src/utils.js +0 -1
- package/src/renderReactRoot.js +0 -12
- package/src/setupDevTools.js +0 -6
- package/src/twMerge.js +0 -1
- package/src/types.d.ts +1 -1
- package/src/types.js +0 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/NamedObject.d.ts +0 -10
- package/src/AdaptableState/Common/NamedObject.js +0 -1
- package/src/Utilities/ExpressionFunctions/groupingMap.d.ts +0 -35
- package/src/Utilities/ExpressionFunctions/groupingMap.js +0 -100
- package/src/Utilities/Interface/AdaptableToolPanelContext.d.ts +0 -4
- package/src/Utilities/Interface/AdaptableToolPanelContext.js +0 -1
- package/src/Utilities/Services/Interface/IMetamodelService.d.ts +0 -20
- package/src/Utilities/Services/Interface/IMetamodelService.js +0 -1
- package/src/Utilities/Services/MetamodelService.d.ts +0 -17
- package/src/Utilities/Services/MetamodelService.js +0 -162
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.d.ts +0 -6
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +0 -99
- package/src/View/Components/Buttons/EntityListActionButtons.d.ts +0 -38
- package/src/View/Components/Buttons/EntityListActionButtons.js +0 -42
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.d.ts +0 -12
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.js +0 -67
- package/src/View/Components/EntityRowItem.d.ts +0 -7
- package/src/View/Components/EntityRowItem.js +0 -7
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +0 -3
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +0 -5
- package/src/View/Components/ModuleProfile.d.ts +0 -8
- package/src/View/Components/ModuleProfile.js +0 -10
- package/src/View/Components/ModuleSummary/ModuleDetail.d.ts +0 -23
- package/src/View/Components/ModuleSummary/ModuleDetail.js +0 -15
- package/src/View/Components/ModuleSummary/ModuleHeader.d.ts +0 -15
- package/src/View/Components/ModuleSummary/ModuleHeader.js +0 -15
- package/src/View/Components/ModuleSummary/SummaryRowItem.d.ts +0 -7
- package/src/View/Components/ModuleSummary/SummaryRowItem.js +0 -12
- package/src/View/Components/SharedProps/ModuleSummaryProps.d.ts +0 -9
- package/src/View/Components/SharedProps/ModuleSummaryProps.js +0 -1
- package/src/View/Components/SharedProps/ToolPanelModuleViewPopupProps.d.ts +0 -13
- package/src/View/Components/SharedProps/ToolPanelModuleViewPopupProps.js +0 -1
- package/src/View/Components/SharedProps/ToolbarModuleViewPopupProps.d.ts +0 -14
- package/src/View/Components/SharedProps/ToolbarModuleViewPopupProps.js +0 -1
- package/src/View/Components/StyleVisualItem.d.ts +0 -9
- package/src/View/Components/StyleVisualItem.js +0 -40
- package/src/View/Components/WizardSummaryPage.d.ts +0 -7
- package/src/View/Components/WizardSummaryPage.js +0 -17
- package/src/components/Accordion.d.ts +0 -7
- package/src/components/Accordion.js +0 -33
- package/src/components/FlexWithFooter.d.ts +0 -9
- package/src/components/FlexWithFooter.js +0 -13
- package/src/components/NotifyResize/index.d.ts +0 -9
- package/src/components/NotifyResize/index.js +0 -35
- package/src/components/PopupWithFooter.d.ts +0 -14
- package/src/components/PopupWithFooter.js +0 -11
- package/src/components/SelectableList/index.d.ts +0 -15
- package/src/components/SelectableList/index.js +0 -95
- package/src/components/SizedContainer/index.d.ts +0 -17
- package/src/components/SizedContainer/index.js +0 -20
- package/src/components/Table/index.d.ts +0 -4
- package/src/components/Table/index.js +0 -6
- package/src/components/WizardPanel/index.d.ts +0 -9
- package/src/components/WizardPanel/index.js +0 -7
- package/src/components/icons/align-justify.d.ts +0 -3
- package/src/components/icons/align-justify.js +0 -3
- package/src/components/icons/column-info.d.ts +0 -3
- package/src/components/icons/column-info.js +0 -3
- package/src/components/icons/gradient-column.d.ts +0 -3
- package/src/components/icons/gradient-column.js +0 -3
- package/src/components/icons/invalid.d.ts +0 -3
- package/src/components/icons/invalid.js +0 -3
- package/src/components/icons/logout copy.d.ts +0 -3
- package/src/components/icons/logout copy.js +0 -3
- package/src/components/icons/smart-edit.d.ts +0 -3
- package/src/components/icons/smart-edit.js +0 -3
- package/src/components/icons/team-share.d.ts +0 -3
- package/src/components/icons/team-share.js +0 -3
- package/src/components/icons/unchecked.d.ts +0 -3
- package/src/components/icons/unchecked.js +0 -3
- package/src/components/icons/user-filter.d.ts +0 -3
- package/src/components/icons/user-filter.js +0 -3
- package/src/components/utils/useContainerScrollObserver/index.d.ts +0 -6
- package/src/components/utils/useContainerScrollObserver/index.js +0 -79
- package/src/components/utils/useGlobalEvent.d.ts +0 -1
- package/src/components/utils/useGlobalEvent.js +0 -7
- package/src/components/utils/useLatest.d.ts +0 -1
- package/src/components/utils/useLatest.js +0 -6
- package/src/components/utils/usePropState.d.ts +0 -2
- package/src/components/utils/usePropState.js +0 -8
- package/src/metamodel/adaptable-metamodel-model.d.ts +0 -26
- package/src/metamodel/adaptable-metamodel-model.js +0 -1
- package/src/metamodel/adaptable.metamodel.d.ts +0 -6244
- package/src/metamodel/adaptable.metamodel.js +0 -1
|
@@ -7,20 +7,10 @@ const DEFAULT_BAR_HEIGHT = 8;
|
|
|
7
7
|
const DEFAULT_BAND_HEIGHT = 14;
|
|
8
8
|
const DEFAULT_MARKER_LINE_THICKNESS = 2;
|
|
9
9
|
const DEFAULT_MARKER_SHAPE_SIZE = 8;
|
|
10
|
-
// AdapTable's `--ab-color-primary` is a *background* tone (near-white in the
|
|
11
|
-
// light theme, near-black in the dark theme), so it would make the bar
|
|
12
|
-
// invisible. `--ab-color-accent` is the canonical brand colour (a saturated
|
|
13
|
-
// blue by default) and reads well on both themes.
|
|
14
10
|
const DEFAULT_BAR_COLOR = 'var(--ab-color-accent, #07c)';
|
|
15
|
-
// `--ab-color-foreground` is theme-aware (dark on light theme, light on dark
|
|
16
|
-
// theme) and is the right pick for marker contrast against the cell.
|
|
17
11
|
const DEFAULT_MARKER_COLOR = 'var(--ab-color-foreground, #111)';
|
|
18
12
|
const DEFAULT_BACK_COLOR = 'transparent';
|
|
19
13
|
const isTargetDefinition = (t) => !!t && typeof t === 'object' && 'Value' in t;
|
|
20
|
-
/**
|
|
21
|
-
* Returns the resolved numeric value for a single Target. Returns `undefined`
|
|
22
|
-
* if the target cannot be resolved (e.g. a column id that's not in the grid).
|
|
23
|
-
*/
|
|
24
14
|
const resolveTargetValue = (target, styledColumn, abColumn, rowNode, api) => {
|
|
25
15
|
const internalApi = api.styledColumnApi.internalApi;
|
|
26
16
|
const value = isTargetDefinition(target) ? target.Value : target;
|
|
@@ -73,14 +63,6 @@ const resolveTargets = (bulletStyle, styledColumn, abColumn, rowNode, api) => {
|
|
|
73
63
|
}
|
|
74
64
|
return resolved;
|
|
75
65
|
};
|
|
76
|
-
/**
|
|
77
|
-
* Decide where the actual bar starts.
|
|
78
|
-
*
|
|
79
|
-
* - `'Auto'` - origin is `min` unless any negative value/range endpoint is in
|
|
80
|
-
* play, in which case origin is `0` (centred axis)
|
|
81
|
-
* - `'Zero'` - origin is always `0`
|
|
82
|
-
* - any number - explicit origin
|
|
83
|
-
*/
|
|
84
66
|
const resolveOrigin = (bulletStyle, cellValue, min, max) => {
|
|
85
67
|
const origin = bulletStyle.Origin ?? 'Auto';
|
|
86
68
|
if (typeof origin === 'number') {
|
|
@@ -89,15 +71,11 @@ const resolveOrigin = (bulletStyle, cellValue, min, max) => {
|
|
|
89
71
|
if (origin === 'Zero') {
|
|
90
72
|
return 0;
|
|
91
73
|
}
|
|
92
|
-
// Auto - flip to 0 origin if any negatives are involved
|
|
93
74
|
if (min < 0 || max < 0 || cellValue < 0) {
|
|
94
75
|
return 0;
|
|
95
76
|
}
|
|
96
77
|
return min;
|
|
97
78
|
};
|
|
98
|
-
/**
|
|
99
|
-
* Convert a numeric value into a 0..1 fraction along the chart axis.
|
|
100
|
-
*/
|
|
101
79
|
const toFraction = (value, min, max) => {
|
|
102
80
|
if (max === min) {
|
|
103
81
|
return 0;
|
|
@@ -112,7 +90,6 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
112
90
|
return class BulletChartRenderer {
|
|
113
91
|
eGui;
|
|
114
92
|
init(params) {
|
|
115
|
-
// Defer to the shared row-scope helper.
|
|
116
93
|
if (!shouldRenderStyledColumnOnRow(styledColumn, params.node, api)) {
|
|
117
94
|
if (params.value != undefined) {
|
|
118
95
|
this.eGui = document.createElement('div');
|
|
@@ -121,14 +98,11 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
121
98
|
return;
|
|
122
99
|
}
|
|
123
100
|
const rawCellValue = params.value;
|
|
124
|
-
// Empty / null cells render as nothing - drawing bands + marker without
|
|
125
|
-
// a bar would falsely suggest the cell value is at the origin (0 / min).
|
|
126
101
|
if (Helper.objectNotExists(rawCellValue)) {
|
|
127
102
|
this.eGui = document.createElement('div');
|
|
128
103
|
return;
|
|
129
104
|
}
|
|
130
105
|
const numericValue = typeof rawCellValue === 'number' ? rawCellValue : Number(rawCellValue);
|
|
131
|
-
// Non-numeric strings ('—', 'N/A', etc.) get the same empty treatment.
|
|
132
106
|
if (isNaN(numericValue)) {
|
|
133
107
|
this.eGui = document.createElement('div');
|
|
134
108
|
this.eGui.append(params.formatValue?.(rawCellValue) ?? String(rawCellValue));
|
|
@@ -136,9 +110,6 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
136
110
|
}
|
|
137
111
|
const min = api.styledColumnApi.internalApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, rawCellValue);
|
|
138
112
|
const max = api.styledColumnApi.internalApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, rawCellValue);
|
|
139
|
-
// Without a usable scale we can't draw anything meaningful (e.g. when
|
|
140
|
-
// every cell in the column has the same value, or when there are no
|
|
141
|
-
// bands and no numeric range can be derived).
|
|
142
113
|
if (min == undefined || max == undefined || max <= min) {
|
|
143
114
|
this.eGui = document.createElement('div');
|
|
144
115
|
this.eGui.append(params.formatValue?.(rawCellValue) ?? String(rawCellValue));
|
|
@@ -147,43 +118,23 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
147
118
|
const cellValue = numericValue;
|
|
148
119
|
const targets = resolveTargets(bulletStyle, styledColumn, abColumn, params.node, api);
|
|
149
120
|
const origin = resolveOrigin(bulletStyle, numericValue, min, max);
|
|
150
|
-
// Layout
|
|
151
121
|
const isVertical = bulletStyle.Orientation === 'Vertical';
|
|
152
|
-
// `BarThickness` is the bar's *short* axis (height in horizontal,
|
|
153
|
-
// width in vertical). `BandThickness` is the matching short-axis
|
|
154
|
-
// size of the surrounding bands.
|
|
155
122
|
const barThickness = bulletStyle.Bar?.Height ?? DEFAULT_BAR_HEIGHT;
|
|
156
123
|
const bandThickness = Math.max(barThickness + 6, DEFAULT_BAND_HEIGHT);
|
|
157
124
|
const cellTextProperties = bulletStyle.CellTextProperties;
|
|
158
125
|
const hasCellText = hasBarStyleCellTextConfigured(cellTextProperties);
|
|
159
|
-
// Map a 0..1 value fraction onto the long-axis viewBox (0..100).
|
|
160
|
-
// In horizontal: 0 -> left, 1 -> right.
|
|
161
|
-
// In vertical: 0 -> bottom, 1 -> top (SVG y origin is at the top so
|
|
162
|
-
// we invert; lower values appear at the bottom of the
|
|
163
|
-
// cell which matches user expectation).
|
|
164
126
|
const valueAxisCoord = (fraction) => isVertical ? (1 - fraction) * 100 : fraction * 100;
|
|
165
|
-
// Wrapper
|
|
166
127
|
this.eGui = document.createElement('div');
|
|
167
128
|
this.eGui.className = 'ab-BulletChart__wrapper';
|
|
168
129
|
this.eGui.style.display = 'flex';
|
|
169
130
|
this.eGui.style.flexDirection = 'column';
|
|
170
|
-
// In vertical mode we centre horizontally so the chart sits in the
|
|
171
|
-
// middle of the cell rather than hugging the left edge.
|
|
172
131
|
this.eGui.style.alignItems = isVertical ? 'center' : 'stretch';
|
|
173
132
|
this.eGui.style.justifyContent = 'center';
|
|
174
133
|
this.eGui.style.position = 'relative';
|
|
175
134
|
this.eGui.style.height = '100%';
|
|
176
|
-
// SVG chart - we let `preserveAspectRatio="none"` stretch the long axis
|
|
177
|
-
// (viewBox 0..100) to fill the cell while the short axis stays fixed
|
|
178
|
-
// in pixels.
|
|
179
135
|
const svg = document.createElementNS(SVG_NS, 'svg');
|
|
180
136
|
svg.setAttribute('class', 'ab-BulletChart__svg');
|
|
181
137
|
svg.setAttribute('preserveAspectRatio', 'none');
|
|
182
|
-
// Snap rect edges to whole pixels so adjacent bands meet flush. Without
|
|
183
|
-
// this, sub-pixel anti-aliasing on the rect edges shows through as a
|
|
184
|
-
// hairline seam where bands meet (especially when band colours are
|
|
185
|
-
// semi-transparent, since each edge anti-aliases against the row
|
|
186
|
-
// background rather than the neighbouring band).
|
|
187
138
|
svg.setAttribute('shape-rendering', 'crispEdges');
|
|
188
139
|
if (isVertical) {
|
|
189
140
|
svg.setAttribute('width', String(bandThickness));
|
|
@@ -195,8 +146,6 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
195
146
|
svg.setAttribute('height', String(bandThickness));
|
|
196
147
|
svg.setAttribute('viewBox', `0 0 100 ${bandThickness}`);
|
|
197
148
|
}
|
|
198
|
-
// Helper - apply rect attributes given primary-axis (along value) and
|
|
199
|
-
// cross-axis (across the bar) coords/lengths.
|
|
200
149
|
const setRectAxes = (rect, primaryStart, primaryLen, crossStart, crossLen) => {
|
|
201
150
|
if (isVertical) {
|
|
202
151
|
rect.setAttribute('x', String(crossStart));
|
|
@@ -211,10 +160,8 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
211
160
|
rect.setAttribute('height', String(crossLen));
|
|
212
161
|
}
|
|
213
162
|
};
|
|
214
|
-
// Bands (qualitative scale) - drawn behind everything else
|
|
215
163
|
const ranges = bulletStyle.CellRanges ?? [];
|
|
216
164
|
if (ranges.length === 0) {
|
|
217
|
-
// No bands defined - draw a back-fill so the chart area is visible.
|
|
218
165
|
const back = document.createElementNS(SVG_NS, 'rect');
|
|
219
166
|
setRectAxes(back, 0, 100, 0, bandThickness);
|
|
220
167
|
back.setAttribute('fill', bulletStyle.BackColor ?? DEFAULT_BACK_COLOR);
|
|
@@ -235,7 +182,6 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
235
182
|
svg.appendChild(bandRect);
|
|
236
183
|
}
|
|
237
184
|
}
|
|
238
|
-
// Actual bar
|
|
239
185
|
const valueFraction = toFraction(numericValue, min, max);
|
|
240
186
|
const originFraction = toFraction(origin, min, max);
|
|
241
187
|
const valueCoord = valueAxisCoord(valueFraction);
|
|
@@ -246,7 +192,6 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
246
192
|
bar.setAttribute('fill', bulletStyle.Bar?.Color ?? DEFAULT_BAR_COLOR);
|
|
247
193
|
bar.setAttribute('class', 'ab-BulletChart__bar');
|
|
248
194
|
svg.appendChild(bar);
|
|
249
|
-
// Target markers
|
|
250
195
|
for (const target of targets) {
|
|
251
196
|
const tCoord = valueAxisCoord(toFraction(target.value, min, max));
|
|
252
197
|
const marker = createMarkerElement(target.marker, tCoord, bandThickness, isVertical);
|
|
@@ -255,18 +200,11 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
255
200
|
svg.appendChild(marker);
|
|
256
201
|
}
|
|
257
202
|
}
|
|
258
|
-
// Wrap the SVG in a positioned container so a `Merged` text row can
|
|
259
|
-
// be absolute-positioned to the centre of the *bar* (matching Percent
|
|
260
|
-
// Bar's behaviour) instead of falling through to the wrapper centre,
|
|
261
|
-
// which would otherwise overlap an `Above` / `Below` band.
|
|
262
203
|
const svgContainer = document.createElement('div');
|
|
263
204
|
svgContainer.style.position = 'relative';
|
|
264
205
|
svgContainer.style.display = 'flex';
|
|
265
206
|
svgContainer.style.alignItems = 'center';
|
|
266
207
|
svgContainer.style.justifyContent = 'center';
|
|
267
|
-
// Horizontal: take the SVG's natural (bandThickness) height.
|
|
268
|
-
// Vertical: stretch to fill the wrapper so the SVG's `height: 100%`
|
|
269
|
-
// resolves against a real size.
|
|
270
208
|
if (isVertical) {
|
|
271
209
|
svgContainer.style.flex = '1 1 auto';
|
|
272
210
|
svgContainer.style.minHeight = '0';
|
|
@@ -277,9 +215,6 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
277
215
|
svgContainer.appendChild(svg);
|
|
278
216
|
this.eGui.appendChild(svgContainer);
|
|
279
217
|
if (hasCellText) {
|
|
280
|
-
// See PercentBarRenderer: `params.formatValue` on a column without a
|
|
281
|
-
// `valueFormatter` returns the raw value (a number here), so coerce
|
|
282
|
-
// to string before it flows into the helpers.
|
|
283
218
|
const formattedCellValue = String(params.formatValue?.(cellValue) ?? cellValue);
|
|
284
219
|
const labels = buildBarStyleCellTextLabels(cellTextProperties, formattedCellValue, `${(valueFraction * 100).toFixed(0)}%`);
|
|
285
220
|
mountBarStyleCellText({
|
|
@@ -295,30 +230,14 @@ export const getBulletChartRendererForColumn = (styledColumn, abColumn, api) =>
|
|
|
295
230
|
return this.eGui;
|
|
296
231
|
}
|
|
297
232
|
refresh(_params) {
|
|
298
|
-
// by returning FALSE we force a re-render every time the cell value changes
|
|
299
233
|
return false;
|
|
300
234
|
}
|
|
301
235
|
};
|
|
302
236
|
};
|
|
303
|
-
const createMarkerElement = (marker,
|
|
304
|
-
/**
|
|
305
|
-
* Coordinate along the value (long) axis in viewBox units (0..100).
|
|
306
|
-
* For horizontal charts this is X; for vertical charts this is Y.
|
|
307
|
-
*/
|
|
308
|
-
valueCoord,
|
|
309
|
-
/**
|
|
310
|
-
* Length of the cross (short) axis in viewBox units = px.
|
|
311
|
-
* For horizontal charts this is the band height; for vertical charts the
|
|
312
|
-
* band width. The marker is centred on this axis at `crossLen / 2`.
|
|
313
|
-
*/
|
|
314
|
-
crossLen, isVertical) => {
|
|
315
|
-
// Helper: given a primary (along-value) coord and a cross coord, return the
|
|
316
|
-
// (x, y) pair appropriate for the orientation. In horizontal mode primary
|
|
317
|
-
// is x; in vertical mode primary is y.
|
|
237
|
+
const createMarkerElement = (marker, valueCoord, crossLen, isVertical) => {
|
|
318
238
|
const xy = (primary, cross) => isVertical ? [cross, primary] : [primary, cross];
|
|
319
239
|
switch (marker.Shape) {
|
|
320
240
|
case 'Line': {
|
|
321
|
-
// A target line spans 80% of the cross axis, centred.
|
|
322
241
|
const crossA = crossLen * 0.1;
|
|
323
242
|
const crossB = crossLen * 0.9;
|
|
324
243
|
const [x1, y1] = xy(valueCoord, crossA);
|
|
@@ -330,10 +249,6 @@ crossLen, isVertical) => {
|
|
|
330
249
|
line.setAttribute('y2', String(y2));
|
|
331
250
|
line.setAttribute('stroke', marker.Color);
|
|
332
251
|
line.setAttribute('stroke-width', String(marker.Size));
|
|
333
|
-
// The long axis of the viewBox stretches to fit the cell, so without
|
|
334
|
-
// non-scaling-stroke the line thickness would distort. (For Line markers
|
|
335
|
-
// the stroke is along the cross axis which doesn't stretch, but we keep
|
|
336
|
-
// this for safety in case a future change introduces a diagonal.)
|
|
337
252
|
line.setAttribute('vector-effect', 'non-scaling-stroke');
|
|
338
253
|
return line;
|
|
339
254
|
}
|
|
@@ -342,21 +257,14 @@ crossLen, isVertical) => {
|
|
|
342
257
|
const circle = document.createElementNS(SVG_NS, 'circle');
|
|
343
258
|
circle.setAttribute('cx', String(cx));
|
|
344
259
|
circle.setAttribute('cy', String(cy));
|
|
345
|
-
// r is in viewBox units; size is in px - approximate by using a small
|
|
346
|
-
// viewBox-relative radius but rely on vector-effect for the stroke.
|
|
347
260
|
circle.setAttribute('r', String(marker.Size / 2));
|
|
348
261
|
circle.setAttribute('fill', marker.Color);
|
|
349
|
-
// Re-enable anti-aliasing for curved/diagonal markers - the SVG itself
|
|
350
|
-
// sets shape-rendering="crispEdges" so band rects meet flush, but that
|
|
351
|
-
// makes circles/polygons look jagged.
|
|
352
262
|
circle.setAttribute('shape-rendering', 'geometricPrecision');
|
|
353
263
|
return circle;
|
|
354
264
|
}
|
|
355
265
|
case 'Diamond': {
|
|
356
266
|
const half = marker.Size / 2;
|
|
357
267
|
const crossMid = crossLen / 2;
|
|
358
|
-
// Diamond is rotationally symmetric so we can use the same point set
|
|
359
|
-
// in both orientations - just thread coords through `xy`.
|
|
360
268
|
const ptList = [
|
|
361
269
|
xy(valueCoord, crossMid - half),
|
|
362
270
|
xy(valueCoord + half, crossMid),
|
|
@@ -372,9 +280,6 @@ crossLen, isVertical) => {
|
|
|
372
280
|
case 'Triangle': {
|
|
373
281
|
const half = marker.Size / 2;
|
|
374
282
|
const crossMid = crossLen / 2;
|
|
375
|
-
// Horizontal: triangle points up (apex at top of band, base at bottom).
|
|
376
|
-
// Vertical: rotate 90deg counter-clockwise so the apex points right
|
|
377
|
-
// (into the cell rather than against the bar's growth direction).
|
|
378
283
|
const ptList = [
|
|
379
284
|
xy(valueCoord - half, crossMid + half),
|
|
380
285
|
xy(valueCoord + half, crossMid + half),
|
|
@@ -26,22 +26,6 @@ const resolveIconStyleMappingParts = (iconStyle) => {
|
|
|
26
26
|
const filteredPreset = presetMappings.filter((p) => !overrideKeys.has(normaliseIconMappingKey(p.Key, matchMode)));
|
|
27
27
|
return { presetMappings: filteredPreset, userMappings };
|
|
28
28
|
};
|
|
29
|
-
/**
|
|
30
|
-
* Resolve the **effective** mapping list for an `IconStyle`:
|
|
31
|
-
*
|
|
32
|
-
* `[ ...presetMappings filtered by overrides, ...userMappings ]`
|
|
33
|
-
*
|
|
34
|
-
* Authoring contract:
|
|
35
|
-
* - `Preset` alone is enough — the renderer pulls the shipped mappings.
|
|
36
|
-
* - `Mappings` are *additions and overrides on top of the preset*. Any
|
|
37
|
-
* user mapping whose `Key` matches a preset entry replaces the preset
|
|
38
|
-
* entry; remaining preset entries pass through as-is.
|
|
39
|
-
* - `Mappings` alone (no Preset) behaves exactly as before.
|
|
40
|
-
*
|
|
41
|
-
* Equality respects `IconStyle.MatchMode` so a user override with
|
|
42
|
-
* `Key: 'gbp'` correctly shadows the preset's `'GBP'` when the column
|
|
43
|
-
* is configured for case-insensitive matching.
|
|
44
|
-
*/
|
|
45
29
|
export const resolveEffectiveIconStyleMappings = (iconStyle) => {
|
|
46
30
|
if (!iconStyle)
|
|
47
31
|
return [];
|
|
@@ -53,11 +37,6 @@ export const resolveEffectiveIconStyleMappings = (iconStyle) => {
|
|
|
53
37
|
}
|
|
54
38
|
return [...presetMappings, ...userMappings];
|
|
55
39
|
};
|
|
56
|
-
/**
|
|
57
|
-
* Mapping list for wizard / settings summaries: custom mappings first so
|
|
58
|
-
* user-authored entries are always visible, then any remaining preset
|
|
59
|
-
* entries (after override filtering).
|
|
60
|
-
*/
|
|
61
40
|
export const resolveIconStyleMappingsForSummaryPreview = (iconStyle) => {
|
|
62
41
|
if (!iconStyle)
|
|
63
42
|
return [];
|
|
@@ -73,13 +52,6 @@ export const resolveIconStyleMappingsForSummaryPreview = (iconStyle) => {
|
|
|
73
52
|
}
|
|
74
53
|
return [...userMappings, ...presetMappings];
|
|
75
54
|
};
|
|
76
|
-
/**
|
|
77
|
-
* Look up `cellValue` in the mapping list using the configured match mode.
|
|
78
|
-
*
|
|
79
|
-
* Strict equality covers the typed case (numeric / boolean keys) — string
|
|
80
|
-
* comparison falls back to a case-insensitive match when configured so the
|
|
81
|
-
* same preset works for `'GBP'` and `'gbp'` etc.
|
|
82
|
-
*/
|
|
83
55
|
const findMapping = (mappings, cellValue, matchMode) => {
|
|
84
56
|
if (!mappings || mappings.length === 0)
|
|
85
57
|
return undefined;
|
|
@@ -88,17 +60,11 @@ const findMapping = (mappings, cellValue, matchMode) => {
|
|
|
88
60
|
return mappings.find((m) => {
|
|
89
61
|
if (typeof m.Key === 'string')
|
|
90
62
|
return m.Key.toLowerCase() === needle;
|
|
91
|
-
// For non-string keys (number / boolean) compare textually so e.g.
|
|
92
|
-
// `Key: 1` matches the string `'1'`.
|
|
93
63
|
return String(m.Key) === cellValue;
|
|
94
64
|
});
|
|
95
65
|
}
|
|
96
66
|
return mappings.find((m) => m.Key === cellValue);
|
|
97
67
|
};
|
|
98
|
-
/**
|
|
99
|
-
* Returns true when the spec is a plain string (emoji / glyph) — anything
|
|
100
|
-
* else is an `AdaptableIcon` and goes through `IconComponent`.
|
|
101
|
-
*/
|
|
102
68
|
const isInlineGlyph = (spec) => {
|
|
103
69
|
return typeof spec === 'string';
|
|
104
70
|
};
|
|
@@ -108,11 +74,6 @@ const isAdaptableIconSpec = (spec) => {
|
|
|
108
74
|
isAdaptableCustomIcon(spec) ||
|
|
109
75
|
isAdaptableElementIcon(spec)));
|
|
110
76
|
};
|
|
111
|
-
/**
|
|
112
|
-
* Renders the icon side of the cell. Strings are rendered as inline
|
|
113
|
-
* glyphs (emoji-friendly); `AdaptableIcon` specs go through the existing
|
|
114
|
-
* `IconComponent` so URL / system / element icons all "just work".
|
|
115
|
-
*/
|
|
116
77
|
const renderIconSpec = (spec, size, className) => {
|
|
117
78
|
if (isInlineGlyph(spec)) {
|
|
118
79
|
return React.createElement('span', {
|
|
@@ -196,8 +157,6 @@ export const getIconRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
196
157
|
const textPosition = cellTextProperties?.CellTextPosition ?? 'After';
|
|
197
158
|
const cellTextTokens = cellTextProperties?.CellText ?? [];
|
|
198
159
|
const matchMode = iconStyle.MatchMode ?? 'Exact';
|
|
199
|
-
// Resolve once at column-setup time. Cheap; recomputed when the column
|
|
200
|
-
// is reconfigured (which is when this factory is re-invoked anyway).
|
|
201
160
|
const effectiveMappings = resolveEffectiveIconStyleMappings(iconStyle);
|
|
202
161
|
return class IconCellRenderer {
|
|
203
162
|
eGui;
|
|
@@ -214,9 +173,6 @@ export const getIconRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
214
173
|
this.eGui.style.alignItems = 'center';
|
|
215
174
|
this.eGui.style.height = '100%';
|
|
216
175
|
this.eGui.style.width = '100%';
|
|
217
|
-
// Defer to the shared row-scope helper so behaviour is uniform
|
|
218
|
-
// across every Styled Column type and `StyledColumn.RowScope` can
|
|
219
|
-
// override the default ("leaf rows only" for Icon).
|
|
220
176
|
if (!shouldRenderStyledColumnOnRow(styledColumn, params.node, adaptableApi)) {
|
|
221
177
|
if (params.value != undefined) {
|
|
222
178
|
this.eGui.append(String(params.value));
|
|
@@ -230,10 +186,6 @@ export const getIconRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
230
186
|
: findMapping(effectiveMappings, cellValue, matchMode);
|
|
231
187
|
const formatted = params.formatValue?.(cellValue) ??
|
|
232
188
|
(cellValue != undefined ? String(cellValue) : '');
|
|
233
|
-
// `CellText` describes the *companion text alongside a matched icon*.
|
|
234
|
-
// `FallbackProperties.Mode` describes *what to do when no mapping matches*.
|
|
235
|
-
// They are independent: when there is no match, the fallback decides
|
|
236
|
-
// on its own — `CellText` does not get to override `Mode: 'Hide'`.
|
|
237
189
|
let iconSpec;
|
|
238
190
|
let text;
|
|
239
191
|
let descriptionForTooltip;
|
|
@@ -250,7 +202,6 @@ export const getIconRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
250
202
|
text = textParts.length > 0 ? textParts.join(' · ') : undefined;
|
|
251
203
|
}
|
|
252
204
|
else if (!cellValueIsEmpty) {
|
|
253
|
-
// Unmatched, non-empty cell: defer entirely to the fallback config.
|
|
254
205
|
const fallbackMode = iconStyle.FallbackProperties?.Mode ?? 'Hide';
|
|
255
206
|
const fallbackIcon = iconStyle.FallbackProperties?.Icon;
|
|
256
207
|
if (fallbackMode === 'ShowText') {
|
|
@@ -259,11 +210,7 @@ export const getIconRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
259
210
|
else if (fallbackMode === 'Icon' && fallbackIcon) {
|
|
260
211
|
iconSpec = fallbackIcon;
|
|
261
212
|
}
|
|
262
|
-
// 'Hide' (and the unsupported permutations) render nothing.
|
|
263
213
|
}
|
|
264
|
-
// else: empty cell → render nothing, regardless of fallback config.
|
|
265
|
-
// If we have nothing to draw, leave the cell empty (and skip mounting
|
|
266
|
-
// a React root for this row).
|
|
267
214
|
if (!iconSpec && !text) {
|
|
268
215
|
return;
|
|
269
216
|
}
|
|
@@ -289,12 +236,10 @@ export const getIconRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
289
236
|
this.unmountReactRoot?.();
|
|
290
237
|
}
|
|
291
238
|
refresh(_params) {
|
|
292
|
-
// Force a re-init on every value change so the matched icon is fresh.
|
|
293
239
|
return false;
|
|
294
240
|
}
|
|
295
241
|
};
|
|
296
242
|
};
|
|
297
|
-
/** Helper exposed for the tooltip getter in `AgGridColumnAdapter`. */
|
|
298
243
|
export const findIconStyleMappingForValue = (iconStyle, cellValue) => {
|
|
299
244
|
if (!iconStyle)
|
|
300
245
|
return undefined;
|
|
@@ -2,15 +2,6 @@ import Helper from '../../Utilities/Helpers/Helper';
|
|
|
2
2
|
import { clamp } from '../../Utilities/Extensions/NumberExtensions';
|
|
3
3
|
import { shouldRenderStyledColumnOnRow } from '../../Utilities/Helpers/StyledColumns/StyledColumnHelper';
|
|
4
4
|
import { buildBarStyleCellTextLabels, hasBarStyleCellTextConfigured, mountBarStyleCellText, } from '../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
5
|
-
/**
|
|
6
|
-
* Resolve the origin value (in the same numeric space as `min`/`max`) the bar
|
|
7
|
-
* should grow from.
|
|
8
|
-
*
|
|
9
|
-
* - `'Min'` - left edge (legacy behaviour: bar always anchored at min)
|
|
10
|
-
* - `'Zero'` - always 0 (centred axis)
|
|
11
|
-
* - `'Auto'` - 0 if any negatives are involved, otherwise min
|
|
12
|
-
* - `number` - explicit origin
|
|
13
|
-
*/
|
|
14
5
|
const resolveOrigin = (percentBarStyle, cellValue, min, max) => {
|
|
15
6
|
const origin = percentBarStyle.Origin ?? 'Auto';
|
|
16
7
|
if (typeof origin === 'number') {
|
|
@@ -22,7 +13,6 @@ const resolveOrigin = (percentBarStyle, cellValue, min, max) => {
|
|
|
22
13
|
if (origin === 'Min') {
|
|
23
14
|
return min;
|
|
24
15
|
}
|
|
25
|
-
// Auto - centred axis only when negatives are in play.
|
|
26
16
|
if (min < 0 || max < 0 || cellValue < 0) {
|
|
27
17
|
return 0;
|
|
28
18
|
}
|
|
@@ -34,7 +24,6 @@ const toFraction = (value, min, max) => {
|
|
|
34
24
|
}
|
|
35
25
|
return clamp((value - min) / (max - min), 0, 1);
|
|
36
26
|
};
|
|
37
|
-
/** Column-comparison mode: centred 50% axis when Origin is Auto or Zero. */
|
|
38
27
|
const columnComparisonUsesCentredAxis = (origin) => {
|
|
39
28
|
const o = origin ?? 'Auto';
|
|
40
29
|
if (typeof o === 'number') {
|
|
@@ -49,9 +38,6 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
49
38
|
return class PercentBarRenderer {
|
|
50
39
|
eGui;
|
|
51
40
|
init(params) {
|
|
52
|
-
// Defer to the shared row-scope helper. Default behaviour
|
|
53
|
-
// ("group rows fall back to plain text") is preserved when
|
|
54
|
-
// `RowScope` is unset.
|
|
55
41
|
if (!shouldRenderStyledColumnOnRow(styledColumn, params.node, api)) {
|
|
56
42
|
if (params.value != undefined) {
|
|
57
43
|
this.eGui = document.createElement('div');
|
|
@@ -60,15 +46,11 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
60
46
|
return;
|
|
61
47
|
}
|
|
62
48
|
const rawCellValue = params.value;
|
|
63
|
-
// Empty / null cells render as nothing - drawing a 0%-wide bar would
|
|
64
|
-
// misleadingly suggest the cell value is at the origin.
|
|
65
49
|
if (Helper.objectNotExists(rawCellValue)) {
|
|
66
50
|
this.eGui = document.createElement('div');
|
|
67
51
|
return;
|
|
68
52
|
}
|
|
69
53
|
const numericValue = typeof rawCellValue === 'number' ? rawCellValue : Number(rawCellValue);
|
|
70
|
-
// Non-numeric strings ('—', 'N/A', etc.) get the same plain-text
|
|
71
|
-
// treatment as group rows.
|
|
72
54
|
if (isNaN(numericValue)) {
|
|
73
55
|
this.eGui = document.createElement('div');
|
|
74
56
|
this.eGui.append(params.formatValue?.(rawCellValue) ?? String(rawCellValue));
|
|
@@ -77,23 +59,16 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
77
59
|
const min = api.styledColumnApi.internalApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, rawCellValue);
|
|
78
60
|
const max = api.styledColumnApi.internalApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, rawCellValue);
|
|
79
61
|
const percentBarStyle = styledColumn.PercentBarStyle;
|
|
80
|
-
// ----- Compute the bar geometry --------------------------------------
|
|
81
|
-
// We always lay out the bar with `left%` and `width%` (instead of just
|
|
82
|
-
// `width%`) so that the bar can be anchored to any origin between min
|
|
83
|
-
// and max - including a centred 0 axis for columns with negatives.
|
|
84
62
|
let percentageValue;
|
|
85
63
|
let barLeftPercent;
|
|
86
64
|
let barWidthPercent;
|
|
87
65
|
if (percentBarStyle.ColumnComparison) {
|
|
88
|
-
// Finance convention: (difference / |base|) * 100 - signed %.
|
|
89
66
|
const absMax = Math.abs(max);
|
|
90
67
|
percentageValue = absMax === 0 ? 0 : (numericValue / absMax) * 100;
|
|
91
68
|
const magnitude = Math.min(100, Math.abs(percentageValue));
|
|
92
69
|
const origin = percentBarStyle.Origin ?? 'Auto';
|
|
93
70
|
const isCentred = columnComparisonUsesCentredAxis(origin);
|
|
94
71
|
if (isCentred) {
|
|
95
|
-
// Centred at 50%: positive bars grow right from the centre, negative
|
|
96
|
-
// bars grow left. Width is half the magnitude (50 = full half-width).
|
|
97
72
|
const halfWidth = magnitude / 2;
|
|
98
73
|
if (percentageValue >= 0) {
|
|
99
74
|
barLeftPercent = 50;
|
|
@@ -105,20 +80,16 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
105
80
|
}
|
|
106
81
|
}
|
|
107
82
|
else {
|
|
108
|
-
// Legacy behaviour: anchored at left, bar width = |percentage|.
|
|
109
83
|
barLeftPercent = 0;
|
|
110
84
|
barWidthPercent = magnitude;
|
|
111
85
|
}
|
|
112
86
|
}
|
|
113
87
|
else if (max === min) {
|
|
114
|
-
// No usable scale - bar is invisible but we still want to fall through
|
|
115
|
-
// and render the cell text below.
|
|
116
88
|
percentageValue = 0;
|
|
117
89
|
barLeftPercent = 0;
|
|
118
90
|
barWidthPercent = 0;
|
|
119
91
|
}
|
|
120
92
|
else {
|
|
121
|
-
// Linear value-on-scale.
|
|
122
93
|
percentageValue = ((clamp(numericValue, min, max) - min) / (max - min)) * 100;
|
|
123
94
|
const origin = resolveOrigin(percentBarStyle, numericValue, min, max);
|
|
124
95
|
const valueFrac = toFraction(numericValue, min, max);
|
|
@@ -128,7 +99,6 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
128
99
|
barLeftPercent = start * 100;
|
|
129
100
|
barWidthPercent = (end - start) * 100;
|
|
130
101
|
}
|
|
131
|
-
// ----- Resolve bar colour -------------------------------------------
|
|
132
102
|
let cellBackColor;
|
|
133
103
|
if (percentBarStyle.ColumnComparison) {
|
|
134
104
|
cellBackColor = percentBarStyle.ColumnComparison.Color;
|
|
@@ -139,21 +109,14 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
139
109
|
cellBackColor = matchingRange.Color;
|
|
140
110
|
}
|
|
141
111
|
}
|
|
142
|
-
// ----- Build the DOM -------------------------------------------------
|
|
143
112
|
const cellTextProperties = percentBarStyle.CellTextProperties;
|
|
144
113
|
const hasCellText = hasBarStyleCellTextConfigured(cellTextProperties);
|
|
145
|
-
// Wrapper always fills the cell. The bar is the flex-grow child so it
|
|
146
|
-
// claims whatever space the (compact) text rows leave, with a small
|
|
147
|
-
// floor to stay visible even on short rows.
|
|
148
114
|
this.eGui = document.createElement('div');
|
|
149
115
|
this.eGui.className = 'ab-PercentBar__wrapper';
|
|
150
116
|
this.eGui.style.height = '100%';
|
|
151
117
|
this.eGui.style.display = 'flex';
|
|
152
118
|
this.eGui.style.flexDirection = 'column';
|
|
153
119
|
this.eGui.style.justifyContent = 'center';
|
|
154
|
-
// Even when no range matches we still draw the bar track (with its
|
|
155
|
-
// back colour) so the cell isn't blank - this used to be a silent
|
|
156
|
-
// failure mode where the entire cell rendered nothing.
|
|
157
120
|
const barEl = document.createElement('div');
|
|
158
121
|
barEl.className = 'ab-PercentBar__bar';
|
|
159
122
|
barEl.style.position = 'relative';
|
|
@@ -161,22 +124,13 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
161
124
|
barEl.style.background = percentBarStyle.BackColor;
|
|
162
125
|
}
|
|
163
126
|
barEl.style.flex = '1 1 0';
|
|
164
|
-
// Floor so the bar can't be squeezed out of existence when both
|
|
165
|
-
// `Above` and `Below` bands are populated on a short row.
|
|
166
127
|
barEl.style.minHeight = '6px';
|
|
167
|
-
// Render the inside bar whenever a colour has been resolved, even at
|
|
168
|
-
// 0% width. A zero-width div is visually identical to skipping the
|
|
169
|
-
// element but keeps the DOM consistent so tests / tooling can still
|
|
170
|
-
// read the bar's reported width when a cell sits exactly at the origin
|
|
171
|
-
// (e.g. a value equal to Col-Min, or a 0 against a `MaxValue` column).
|
|
172
128
|
if (cellBackColor) {
|
|
173
129
|
const barInsideEl = document.createElement('div');
|
|
174
130
|
barInsideEl.className = 'ab-PercentBar__barInside';
|
|
175
131
|
barInsideEl.style.background = cellBackColor;
|
|
176
132
|
barInsideEl.style.height = '100%';
|
|
177
133
|
barInsideEl.style.position = 'absolute';
|
|
178
|
-
// Sub-pixel precision avoids rounding 0.4% values down to 0
|
|
179
|
-
// (invisible) or making ticking data jump in 1% steps.
|
|
180
134
|
barInsideEl.style.left = `${barLeftPercent.toFixed(2)}%`;
|
|
181
135
|
barInsideEl.style.width = `${barWidthPercent.toFixed(2)}%`;
|
|
182
136
|
barInsideEl.style.top = '0';
|
|
@@ -184,10 +138,6 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
184
138
|
}
|
|
185
139
|
this.eGui.append(barEl);
|
|
186
140
|
if (hasCellText) {
|
|
187
|
-
// Coerce to string: when no `valueFormatter` is set on the column,
|
|
188
|
-
// `params.formatValue` returns the raw value (a number for numeric
|
|
189
|
-
// columns), which then propagates through the helpers as a non-string
|
|
190
|
-
// and breaks string-only operations (e.g. `.length` checks).
|
|
191
141
|
const formattedCellValue = String(params.formatValue?.(rawCellValue) ?? rawCellValue);
|
|
192
142
|
const labels = buildBarStyleCellTextLabels(cellTextProperties, formattedCellValue, `${percentageValue.toFixed(0)}%`);
|
|
193
143
|
mountBarStyleCellText({
|
|
@@ -204,7 +154,6 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
204
154
|
return this.eGui;
|
|
205
155
|
}
|
|
206
156
|
refresh(_params) {
|
|
207
|
-
// by returning FALSE we force a re-render every time the cell value changes
|
|
208
157
|
return false;
|
|
209
158
|
}
|
|
210
159
|
};
|