@adaptabletools/adaptable 23.0.0-canary.3 → 23.0.0-canary.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +116 -61
- package/package.json +9 -4
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -4
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +0 -7
- package/src/AdaptableState/Common/AdaptableForm.d.ts +18 -1
- package/src/AdaptableState/Common/AdaptableForm.js +31 -0
- package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
- package/src/AdaptableState/Common/AggregationColumns.js +27 -2
- package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +3 -2
- package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
- package/src/AdaptableState/Common/Enums.d.ts +5 -10
- package/src/AdaptableState/Common/Enums.js +4 -10
- package/src/AdaptableState/PlusMinusState.d.ts +3 -3
- package/src/AdaptableState/ShortcutState.d.ts +2 -6
- package/src/AdaptableState/StyledColumnState.d.ts +3 -5
- package/src/AdaptableState/ThemeState.d.ts +33 -28
- package/src/Api/EventApi.d.ts +14 -1
- package/src/Api/Events/ThemeChanged.d.ts +6 -0
- package/src/Api/Events/ThemeSelected.d.ts +11 -0
- package/src/Api/Events/ThemeSelected.js +1 -0
- package/src/Api/Implementation/EventApiImpl.js +4 -0
- package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -2
- package/src/Api/Implementation/LayoutApiImpl.js +0 -14
- package/src/Api/Implementation/LayoutHelpers.d.ts +2 -0
- package/src/Api/Implementation/LayoutHelpers.js +29 -7
- package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
- package/src/Api/Implementation/ThemeApiImpl.js +19 -15
- package/src/Api/Internal/EventInternalApi.d.ts +2 -0
- package/src/Api/Internal/EventInternalApi.js +8 -1
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
- package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
- package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
- package/src/Api/Internal/ThemeInternalApi.js +0 -10
- package/src/Api/LayoutApi.d.ts +1 -8
- package/src/Api/ThemeApi.d.ts +6 -2
- package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
- package/src/Strategy/CalculatedColumnModule.js +3 -1
- package/src/Strategy/FormatColumnModule.js +14 -7
- package/src/Strategy/LayoutModule.js +13 -8
- package/src/Strategy/StyledColumnModule.js +64 -36
- package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
- package/src/Utilities/Constants/ReduxConstants.js +1 -14
- package/src/Utilities/Helpers/FormatHelper.js +20 -1
- package/src/Utilities/Helpers/SparklineOptionsHelper.d.ts +7 -0
- package/src/Utilities/Helpers/SparklineOptionsHelper.js +65 -0
- package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +204 -0
- package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
- package/src/Utilities/Helpers/ThemeHelpers.js +38 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.js +143 -0
- package/src/Utilities/ObjectFactory.d.ts +1 -3
- package/src/Utilities/ObjectFactory.js +0 -8
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +7 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +4 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +115 -0
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/ThemeService.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +114 -103
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +13 -14
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +55 -55
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +3 -2
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +2 -2
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +31 -39
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +3 -4
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +30 -17
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +3 -3
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +35 -52
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +21 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +10 -7
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +1 -1
- package/src/View/Components/ModuleProfile.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +0 -1
- package/src/View/Components/RangesComponent.d.ts +7 -2
- package/src/View/Components/RangesComponent.js +94 -22
- package/src/View/Components/Selectors/ColumnSelector.js +5 -0
- package/src/View/Components/StyleComponent.d.ts +1 -0
- package/src/View/Components/StyleComponent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +70 -57
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +6 -4
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +3 -2
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +5 -15
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -26
- package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -13
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +20 -22
- package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
- package/src/View/Export/Wizard/ScheduledReportSettings.js +13 -13
- package/src/View/Export/Wizard/ScheduledReportWizard.js +4 -5
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +24 -23
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +21 -5
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +117 -12
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +66 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +30 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +13 -8
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +62 -13
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +5 -3
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +15 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +53 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +33 -68
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +15 -11
- package/src/View/Layout/LayoutViewPanel.js +23 -21
- package/src/View/Layout/TransposedPopup.js +2 -2
- package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +115 -26
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
- package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
- package/src/View/Layout/Wizard/sections/GridFilterSection.js +11 -11
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -52
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
- package/src/View/Layout/Wizard/sections/SettingsSection.js +4 -5
- package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
- package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +9 -14
- package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +43 -13
- package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +11 -18
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +6 -22
- package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
- package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +11 -18
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +17 -6
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +3 -3
- package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
- package/src/View/Shortcut/shortcutOperations.js +28 -0
- package/src/View/SpecialColumnSettingsWizardStep.js +9 -8
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +24 -15
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +96 -16
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +45 -24
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +108 -33
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +21 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +121 -23
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +34 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +86 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +121 -34
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -75
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +16 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +7 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +4 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +12 -14
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +16 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +31 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +30 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +91 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +52 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +53 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +126 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +52 -29
- package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
- package/src/View/Theme/ThemePopup.d.ts +2 -14
- package/src/View/Theme/ThemePopup.js +1 -36
- package/src/View/UIHelper.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +7 -21
- package/src/View/renderWithAdaptableContext.js +2 -3
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.js +38 -43
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +27 -17
- package/src/agGrid/AgGridColumnAdapter.js +10 -19
- package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
- package/src/agGrid/AgGridMenuAdapter.js +20 -37
- package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
- package/src/agGrid/buildValueAggregationMenuItem.js +111 -0
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
- package/src/agGrid/cellRenderers/IconRenderer.js +43 -15
- package/src/agGrid/createAgGridIcon.d.ts +10 -0
- package/src/agGrid/createAgGridIcon.js +16 -0
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +11 -6
- package/src/components/Combobox/VirtualizedList.js +5 -5
- package/src/components/Combobox/comboboxUtils.d.ts +4 -1
- package/src/components/Combobox/comboboxUtils.js +2 -0
- package/src/components/Combobox/index.d.ts +1 -0
- package/src/components/Combobox/index.js +35 -15
- package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/components/Input/NumberInput.js +1 -1
- package/src/components/Panel/index.js +1 -1
- package/src/components/SimpleButton/index.js +4 -4
- package/src/components/Toggle/Toggle.js +1 -1
- package/src/components/Toggle/ToggleGroup.js +1 -1
- package/src/components/Tree/TreeDropdown/index.js +2 -6
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +5 -1
- package/src/layout-manager/src/index.js +2 -9
- package/src/metamodel/adaptable.metamodel.d.ts +39 -46
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +5 -5
- package/themes/dark.css +1 -68
- package/themes/light.css +1 -5
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
- package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -4
- package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
- package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -63
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -55
- package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
- package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -137
- package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
- package/src/Aggregation/parameterizedAggregationHeader.js +0 -60
- package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
- package/src/Aggregation/parameterizedAggregationHelpers.js +0 -111
- package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
- package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -66
- package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
- package/src/Aggregation/validateParameterizedAggregations.js +0 -20
- package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
- package/src/View/AdaptableComputedCSSVarsContext.js +0 -29
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -43
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -28
- package/src/View/Theme/VariantSelector.d.ts +0 -8
- package/src/View/Theme/VariantSelector.js +0 -20
- package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
- package/src/components/Select/CSSNumericVariableWatch.js +0 -45
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import throttle from '../Utilities/utils/throttle';
|
|
2
1
|
import debounce from '../Utilities/utils/debounce';
|
|
3
2
|
import { createGrid, LocalEventService, } from 'ag-grid-enterprise';
|
|
4
3
|
import { AdaptableLogger } from './AdaptableLogger';
|
|
@@ -21,6 +20,7 @@ import { ThemeService } from '../Utilities/Services/ThemeService';
|
|
|
21
20
|
import { ValidationService } from '../Utilities/Services/ValidationService';
|
|
22
21
|
import { ModuleService } from '../Utilities/Services/ModuleService';
|
|
23
22
|
import { CalculatedColumnExpressionService } from '../Utilities/Services/CalculatedColumnExpressionService';
|
|
23
|
+
import { expandCellDataChangedInfosWithCalculatedColumns } from '../Utilities/Services/CalculatedColumnSyntheticChange';
|
|
24
24
|
import { QueryLanguageService } from '../Utilities/Services/QueryLanguageService';
|
|
25
25
|
import { AlertService } from '../Utilities/Services/AlertService';
|
|
26
26
|
import { TeamSharingService } from '../Utilities/Services/TeamSharingService';
|
|
@@ -78,12 +78,8 @@ import { AgGridOptionsService } from './AgGridOptionsService';
|
|
|
78
78
|
import { parseDateValue } from '../Utilities/Helpers/DateHelper';
|
|
79
79
|
import { AgGridColumnAdapter } from './AgGridColumnAdapter';
|
|
80
80
|
import getScrollbarSize from '../Utilities/getScrollbarSize';
|
|
81
|
-
import { ONLY_AGG_FN_NAME } from '../AdaptableState/Common/AggregationColumns';
|
|
82
|
-
import { computeParameterizedAggregation, getParameterizedAggregationDefinitions, } from '../Aggregation/ParameterizedAggregationRegistry';
|
|
83
|
-
import { getParameterizedAggForColumn } from '../Aggregation/parameterizedAggregationHelpers';
|
|
84
|
-
import { getParameterizedAggregationHeaderParenthesisValue } from '../Aggregation/parameterizedAggregationHeader';
|
|
81
|
+
import { ONLY_AGG_FN_NAME, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../AdaptableState/Common/AggregationColumns';
|
|
85
82
|
import { RowFormService } from '../Utilities/Services/RowFormService';
|
|
86
|
-
import { FilterOnDataChangeOptions } from '../AdaptableState/Common/Enums';
|
|
87
83
|
import { ADAPTABLE_PUBLISH_TIMESTAMP } from '../EnvVars';
|
|
88
84
|
import { AdaptableUpgradeHelper } from '../migration/AdaptableUpgradeHelper';
|
|
89
85
|
import { ensureLoadingScreenPortalElement } from '../components/Modal';
|
|
@@ -91,10 +87,11 @@ import { AdaptableLoadingScreen } from '../View/Components/Popups/AdaptableLoadi
|
|
|
91
87
|
import { createElement } from 'react';
|
|
92
88
|
import { createAgStatusPanelComponent } from '../Utilities/createAgStatusPanelComponent';
|
|
93
89
|
import { only } from '../Utilities/only';
|
|
90
|
+
import { weightedAverage } from '../Utilities/weightedAverage';
|
|
94
91
|
import { ROW_SUMMARY_ROW_ID } from '../AdaptableState/Common/RowSummary';
|
|
95
92
|
import { FlashingCellService } from '../Utilities/Services/FlashingCellService';
|
|
96
93
|
import { AgGridExportAdapter } from './AgGridExportAdapter';
|
|
97
|
-
import { checkForDuplicateColumns, getLayoutRowGroupValuesExceptionGroupKeys, isPivotLayout, layoutModelToLayoutState, layoutStateToLayoutModel, normalizeLayout, } from '../Api/Implementation/LayoutHelpers';
|
|
94
|
+
import { checkForDuplicateColumns, resetLayoutHelperErrorOnceMessages, getLayoutRowGroupValuesExceptionGroupKeys, isPivotLayout, layoutModelToLayoutState, layoutStateToLayoutModel, normalizeLayout, } from '../Api/Implementation/LayoutHelpers';
|
|
98
95
|
import { LayoutManager } from '../layout-manager/src';
|
|
99
96
|
import { rowGroupDisplayTypeToGridOption } from '../layout-manager/src/rowGroupDisplayType';
|
|
100
97
|
import { isPivotLayoutModel } from '../layout-manager/src/isPivotLayoutModel';
|
|
@@ -204,7 +201,6 @@ export class AdaptableAgGrid {
|
|
|
204
201
|
LicenseService;
|
|
205
202
|
ChartingService;
|
|
206
203
|
rowListeners;
|
|
207
|
-
throttleFilterOnDataChange;
|
|
208
204
|
debouncedSetSelectedRows;
|
|
209
205
|
debouncedSetSelectedCells;
|
|
210
206
|
agGridListenerKeydown;
|
|
@@ -356,6 +352,7 @@ export class AdaptableAgGrid {
|
|
|
356
352
|
this._rawAdaptableOptions.adaptableId = `adaptable_id_${Date.now()}`;
|
|
357
353
|
}
|
|
358
354
|
this.logger = this.logger ?? new AdaptableLogger(this._rawAdaptableOptions.adaptableId);
|
|
355
|
+
resetLayoutHelperErrorOnceMessages();
|
|
359
356
|
const adaptableId = this._rawAdaptableOptions.adaptableId;
|
|
360
357
|
const initMarker = getMarker(adaptableId).track.Init.label.Init.start();
|
|
361
358
|
const perfInitAdaptableAgGrid = this.logger.beginPerf(`Adaptable._initAdaptableAgGrid()`);
|
|
@@ -901,16 +898,7 @@ export class AdaptableAgGrid {
|
|
|
901
898
|
// #customize_header
|
|
902
899
|
const defaultColDef = { ...original_defaultColDef };
|
|
903
900
|
defaultColDef.headerValueGetter = tagProvidedByAdaptable((params) => {
|
|
904
|
-
|
|
905
|
-
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
906
|
-
if (params.column &&
|
|
907
|
-
!currentLayout.SuppressAggFuncInHeader &&
|
|
908
|
-
params.location === 'header') {
|
|
909
|
-
const parameterizedParenthesisValue = getParameterizedAggregationHeaderParenthesisValue(this.api, params.column.getColId(), currentLayout);
|
|
910
|
-
if (parameterizedParenthesisValue) {
|
|
911
|
-
columnHeaderName = parameterizedParenthesisValue;
|
|
912
|
-
}
|
|
913
|
-
}
|
|
901
|
+
const columnHeaderName = this.api.columnApi.internalApi.getColumnHeaderName(params);
|
|
914
902
|
const formattedHeaderName = this.api.formatColumnApi.internalApi.formatColumnHeaderName(columnHeaderName, params);
|
|
915
903
|
return formattedHeaderName;
|
|
916
904
|
});
|
|
@@ -1124,16 +1112,17 @@ export class AdaptableAgGrid {
|
|
|
1124
1112
|
aggregationFunctions[ONLY_AGG_FN_NAME] = (params) => {
|
|
1125
1113
|
return only(params);
|
|
1126
1114
|
};
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
return
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1115
|
+
aggregationFunctions[WEIGHTED_AVERAGE_AGG_FN_NAME] = (params) => {
|
|
1116
|
+
const columnId = params.column.getColId();
|
|
1117
|
+
const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(columnId);
|
|
1118
|
+
if (!adaptableAggFunc) {
|
|
1119
|
+
return undefined;
|
|
1120
|
+
}
|
|
1121
|
+
if (adaptableAggFunc.type === 'weightedAverage') {
|
|
1122
|
+
return weightedAverage(params, params.colDef.colId, adaptableAggFunc.weightedColumnId);
|
|
1123
|
+
}
|
|
1124
|
+
return undefined;
|
|
1125
|
+
};
|
|
1137
1126
|
return aggregationFunctions;
|
|
1138
1127
|
});
|
|
1139
1128
|
/**
|
|
@@ -1699,12 +1688,6 @@ export class AdaptableAgGrid {
|
|
|
1699
1688
|
}), true);
|
|
1700
1689
|
gridContainerElement.addEventListener('mouseleave', (this.agGridListenerMouseLeave = (event) => this._emit('MouseLeave', event)));
|
|
1701
1690
|
}
|
|
1702
|
-
this.throttleFilterOnDataChange = throttle(
|
|
1703
|
-
// the extra function is to make sure we have a reference to ag-grid-api
|
|
1704
|
-
() => this.agGridAdapter.getAgGridApi()?.onFilterChanged(), this.adaptableOptions.filterOptions.filterActionOnDataChange.throttleDelay, {
|
|
1705
|
-
trailing: true,
|
|
1706
|
-
leading: false,
|
|
1707
|
-
});
|
|
1708
1691
|
/**
|
|
1709
1692
|
* Use Case: User has started inline editing but its disabled in Row Form Options
|
|
1710
1693
|
* Action: Stop editing
|
|
@@ -3813,7 +3796,6 @@ export class AdaptableAgGrid {
|
|
|
3813
3796
|
this.listenerCellSelectionChanged = null;
|
|
3814
3797
|
this.listenerGlobalSetRowSelection = null;
|
|
3815
3798
|
this.listenerSortChanged = null;
|
|
3816
|
-
this.throttleFilterOnDataChange = null;
|
|
3817
3799
|
const liveGridOptions = this.agGridAdapter.DANGER_getLiveGridOptions();
|
|
3818
3800
|
if (liveGridOptions) {
|
|
3819
3801
|
this.agGridOptionsService.revertGridOptionsPropertiesToUserValue(liveGridOptions, [
|
|
@@ -4049,6 +4031,25 @@ export class AdaptableAgGrid {
|
|
|
4049
4031
|
],
|
|
4050
4032
|
});
|
|
4051
4033
|
}
|
|
4034
|
+
getActiveAdaptableAggFuncForCol(columnId) {
|
|
4035
|
+
if (!columnId) {
|
|
4036
|
+
return null;
|
|
4037
|
+
}
|
|
4038
|
+
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
4039
|
+
const aggregationFunctionsColumnsMap = (isPivotLayout(currentLayout)
|
|
4040
|
+
? currentLayout.PivotAggregationColumns
|
|
4041
|
+
: currentLayout.TableAggregationColumns).reduce((acc, col) => {
|
|
4042
|
+
acc[col.ColumnId] = col.AggFunc;
|
|
4043
|
+
return acc;
|
|
4044
|
+
}, {});
|
|
4045
|
+
const adaptableAggFunc = aggregationFunctionsColumnsMap[columnId];
|
|
4046
|
+
if (typeof adaptableAggFunc === 'object' &&
|
|
4047
|
+
'type' in adaptableAggFunc &&
|
|
4048
|
+
adaptableAggFunc.type === 'weightedAverage') {
|
|
4049
|
+
return adaptableAggFunc;
|
|
4050
|
+
}
|
|
4051
|
+
return null;
|
|
4052
|
+
}
|
|
4052
4053
|
onRowDataChanged({ rowNode, oldData, newData, }) {
|
|
4053
4054
|
if (oldData == null || oldData == undefined) {
|
|
4054
4055
|
return;
|
|
@@ -4133,6 +4134,7 @@ export class AdaptableAgGrid {
|
|
|
4133
4134
|
* There are a few things we need to do AFTER we edit a cell and it makes sense to put them in one place
|
|
4134
4135
|
*/
|
|
4135
4136
|
performPostEditChecks(rowNode, cellDataChangedInfos) {
|
|
4137
|
+
cellDataChangedInfos = expandCellDataChangedInfosWithCalculatedColumns(this.api, cellDataChangedInfos);
|
|
4136
4138
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
4137
4139
|
// if a Cell Data Change is undone, log to the Console
|
|
4138
4140
|
if (cellDataChangedInfo.trigger === 'undo') {
|
|
@@ -4290,14 +4292,7 @@ export class AdaptableAgGrid {
|
|
|
4290
4292
|
}
|
|
4291
4293
|
}
|
|
4292
4294
|
filterOnDataChange() {
|
|
4293
|
-
|
|
4294
|
-
FilterOnDataChangeOptions.Always) {
|
|
4295
|
-
this.agGridAdapter.getAgGridApi()?.onFilterChanged();
|
|
4296
|
-
}
|
|
4297
|
-
else if (this.adaptableOptions.filterOptions.filterActionOnDataChange.applyFilter ==
|
|
4298
|
-
FilterOnDataChangeOptions.Throttle) {
|
|
4299
|
-
this.throttleFilterOnDataChange();
|
|
4300
|
-
}
|
|
4295
|
+
this.agGridAdapter.getAgGridApi()?.onFilterChanged();
|
|
4301
4296
|
}
|
|
4302
4297
|
refreshLayout() {
|
|
4303
4298
|
const columnDefs = this.agGridAdapter.getColumnDefinitionsInclSpecialColumns();
|
|
@@ -50,6 +50,7 @@ export declare class AgGridAdapter {
|
|
|
50
50
|
deriveSelectedRowInfoFromAgGrid(): SelectedRowInfo;
|
|
51
51
|
isPinnedRowNode(rowNode: IRowNode): boolean;
|
|
52
52
|
createAdaptableColumnFromAgGridColumn(agGridColumn: Column, colsToGroups: Record<string, AdaptableColumnGroup>): AdaptableColumn;
|
|
53
|
+
private getUserAllowedAggFuncs;
|
|
53
54
|
private deriveAdaptableColumnDataType;
|
|
54
55
|
private isColumnReadonly;
|
|
55
56
|
private isColumnFieldonly;
|
|
@@ -57,7 +58,6 @@ export declare class AgGridAdapter {
|
|
|
57
58
|
private isColumnRowGroupable;
|
|
58
59
|
private isColumnPivotable;
|
|
59
60
|
private isColumnAggregetable;
|
|
60
|
-
private getUserAllowedAggFuncs;
|
|
61
61
|
private getColumnAggregationFunctions;
|
|
62
62
|
private isTreeColumn;
|
|
63
63
|
private isColumnMoveable;
|
|
@@ -8,8 +8,7 @@ import { agGridDataTypeDefinitions, ALL_ADAPTABLE_DATA_TYPES } from './agGridDat
|
|
|
8
8
|
import { isPivotGrandTotal } from '../Api/Implementation/ColumnApiImpl';
|
|
9
9
|
import { isPivotColumnTotal } from '../layout-manager/src/isPivotColumnTotal';
|
|
10
10
|
import { isPivotAggTotalColumn } from '../layout-manager/src/isPivotAggTotalColumn';
|
|
11
|
-
import {
|
|
12
|
-
import { isParameterizedAggFuncName } from '../Aggregation/ParameterizedAggregationRegistry';
|
|
11
|
+
import { ONLY_AGG_FN_NAME, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../AdaptableState/Common/AggregationColumns';
|
|
13
12
|
// AG GRID obfuscates its internals, this is (currently) the best way to get hold of its internal services
|
|
14
13
|
const DANGER_AG_GRID_BEANS_MAP = {};
|
|
15
14
|
const getColumnApiModule = () => ColumnApiModule;
|
|
@@ -226,9 +225,8 @@ export class AgGridAdapter {
|
|
|
226
225
|
if (fctName === 'only') {
|
|
227
226
|
return 'Only';
|
|
228
227
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return parameterizedDefinition.agGridAggFuncName;
|
|
228
|
+
if (fctName === 'weightedAvg') {
|
|
229
|
+
return 'Weighted Average';
|
|
232
230
|
}
|
|
233
231
|
return original_getDefaultFuncLabel.call(this, fctName);
|
|
234
232
|
};
|
|
@@ -542,16 +540,23 @@ export class AgGridAdapter {
|
|
|
542
540
|
abColumn.exportable = this.isColumnExportable(abColumn);
|
|
543
541
|
if (abColumn.aggregatable) {
|
|
544
542
|
abColumn.availableAggregationFunctions = this.getColumnAggregationFunctions(colDef);
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
543
|
+
Object.defineProperty(abColumn, 'userAllowedAggFuncs', {
|
|
544
|
+
get: () => this.getUserAllowedAggFuncs(ColumnId),
|
|
545
|
+
enumerable: true,
|
|
546
|
+
configurable: true,
|
|
547
|
+
});
|
|
549
548
|
if (typeof colDef.aggFunc === 'string') {
|
|
550
549
|
abColumn.aggregationFunction = colDef.aggFunc;
|
|
551
550
|
}
|
|
552
551
|
}
|
|
553
552
|
return abColumn;
|
|
554
553
|
}
|
|
554
|
+
getUserAllowedAggFuncs(columnId) {
|
|
555
|
+
const userColumnAllowed = this._adaptableInstance?.agGridColumnAdapter?.getUserColDefProperty(columnId, 'allowedAggFuncs');
|
|
556
|
+
const userDefaultColDef = this.getUserGridOptionsProperty('defaultColDef');
|
|
557
|
+
const userAllowed = userColumnAllowed ?? userDefaultColDef?.allowedAggFuncs;
|
|
558
|
+
return Array.isArray(userAllowed) ? [...userAllowed] : undefined;
|
|
559
|
+
}
|
|
555
560
|
deriveAdaptableColumnDataType(agColumn, logWarning = true) {
|
|
556
561
|
// Some columns can have no ID or Title. we return string as a consequence but it needs testing
|
|
557
562
|
if (!agColumn) {
|
|
@@ -684,12 +689,6 @@ export class AgGridAdapter {
|
|
|
684
689
|
}
|
|
685
690
|
return false;
|
|
686
691
|
}
|
|
687
|
-
getUserAllowedAggFuncs(columnId) {
|
|
688
|
-
const userColumnAllowed = this._adaptableInstance?.agGridColumnAdapter?.getUserColDefProperty(columnId, 'allowedAggFuncs');
|
|
689
|
-
const userDefaultColDef = this.getUserGridOptionsProperty('defaultColDef');
|
|
690
|
-
const userAllowed = userColumnAllowed ?? userDefaultColDef?.allowedAggFuncs;
|
|
691
|
-
return Array.isArray(userAllowed) ? [...userAllowed] : undefined;
|
|
692
|
-
}
|
|
693
692
|
getColumnAggregationFunctions(colDef) {
|
|
694
693
|
const defaultAggFuncs = ['sum', 'min', 'max', 'count', 'avg', 'first', 'last'];
|
|
695
694
|
const hasAllowedAggFuncs = Array.isArray(colDef.allowedAggFuncs);
|
|
@@ -697,9 +696,20 @@ export class AgGridAdapter {
|
|
|
697
696
|
const gridOptionsAggFuncs = this.adaptableApi.agGridApi.getGridOption('aggFuncs') || {};
|
|
698
697
|
const gridOptionsAggFuncNames = Object.keys(gridOptionsAggFuncs);
|
|
699
698
|
if (!hasAllowedAggFuncs) {
|
|
700
|
-
|
|
699
|
+
// we assume gridOptionsAggFuncNames includes 'weightedAvg' and 'only'
|
|
700
|
+
const customAggFuncNames = gridOptionsAggFuncNames.filter((name) => name !== WEIGHTED_AVERAGE_AGG_FN_NAME && name !== ONLY_AGG_FN_NAME);
|
|
701
|
+
// 'weightedAvg' is displayed right after 'avg'
|
|
702
|
+
const avgIndex = result.indexOf('avg');
|
|
703
|
+
if (avgIndex >= 0) {
|
|
704
|
+
result.splice(avgIndex + 1, 0, WEIGHTED_AVERAGE_AGG_FN_NAME);
|
|
705
|
+
}
|
|
706
|
+
else {
|
|
707
|
+
result.push(WEIGHTED_AVERAGE_AGG_FN_NAME);
|
|
708
|
+
}
|
|
709
|
+
result.push(...customAggFuncNames);
|
|
710
|
+
// 'only' is always the last element
|
|
711
|
+
result.push(ONLY_AGG_FN_NAME);
|
|
701
712
|
}
|
|
702
|
-
result = result.filter((func) => !isParameterizedAggFuncName(func));
|
|
703
713
|
return [...new Set(result)];
|
|
704
714
|
}
|
|
705
715
|
isTreeColumn(isGeneratedRowGroupColumn) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import kebabCase from '../Utilities/utils/kebabCase';
|
|
2
2
|
import { resolveDisplayFormat } from '../AdaptableState/Common/AdaptableFormatPresets';
|
|
3
3
|
import merge from '../Utilities/utils/merge';
|
|
4
|
+
import { resolveSparklineOptionsForRender } from '../Utilities/Helpers/SparklineOptionsHelper';
|
|
4
5
|
import { convertAdaptableStyleToCSS, getVariableColor, hasCellBoxStyle, hasCellFontStyle, normalizeStyleForAgGrid, } from '../Utilities/Helpers/StyleHelper';
|
|
5
6
|
import StringExtensions from '../Utilities/Extensions/StringExtensions';
|
|
6
7
|
import { ACTION_COLUMN_TYPE, CALCULATED_COLUMN_TYPE, FDC3_COLUMN_TYPE, FREE_TEXT_COLUMN_TYPE, } from '../AdaptableState/Common/AdaptableColumn';
|
|
@@ -26,7 +27,7 @@ import { AgGridFilterAdapterFactory } from './AgGridFilterAdapter';
|
|
|
26
27
|
import { AgGridFloatingFilterAdapterFactory } from './AgGridFloatingFilterAdapter';
|
|
27
28
|
import { errorOnce } from './AdaptableLogger';
|
|
28
29
|
import { isUnsupportedColumnDataTypeForIconStyle } from '../Utilities/Helpers/iconStyledColumnColumnSupport';
|
|
29
|
-
import {
|
|
30
|
+
import { isWeightedAverageAggFuncName, } from '../AdaptableState/Common/AggregationColumns';
|
|
30
31
|
/**
|
|
31
32
|
* CSS property keys produced by `convertAdaptableStyleToCSS` from a
|
|
32
33
|
* `CellFontStyle` slice. Used to strip Format-Column-derived font CSS
|
|
@@ -552,7 +553,7 @@ export class AgGridColumnAdapter {
|
|
|
552
553
|
if (styledColumn && !styledColumn.IsSuspended) {
|
|
553
554
|
if (styledColumn.SparklineStyle) {
|
|
554
555
|
const sanitizedSparklineOptions = AdaptableHelper.removeAdaptableObjectPrimitives(styledColumn.SparklineStyle.options);
|
|
555
|
-
const sparklineOptions = merge({}, userDefined?.sparklineOptions, sanitizedSparklineOptions);
|
|
556
|
+
const sparklineOptions = resolveSparklineOptionsForRender(merge({}, userDefined?.sparklineOptions, sanitizedSparklineOptions));
|
|
556
557
|
return {
|
|
557
558
|
...userDefined,
|
|
558
559
|
sparklineOptions,
|
|
@@ -571,8 +572,7 @@ export class AgGridColumnAdapter {
|
|
|
571
572
|
// Icon Style has its own tooltip vocabulary (`'CellValue'` /
|
|
572
573
|
// `'IconDescription'`) so we handle it before falling through to the
|
|
573
574
|
// numeric tooltip branch.
|
|
574
|
-
if (styledColumn.IconStyle &&
|
|
575
|
-
!isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType)) {
|
|
575
|
+
if (styledColumn.IconStyle && !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType)) {
|
|
576
576
|
const iconTokens = styledColumn.IconStyle.ToolTipText ?? [];
|
|
577
577
|
if (iconTokens.length === 0) {
|
|
578
578
|
return undefined;
|
|
@@ -650,9 +650,7 @@ export class AgGridColumnAdapter {
|
|
|
650
650
|
if (textOptions.includes('CellValue')) {
|
|
651
651
|
returnValue = String(params.value ?? '');
|
|
652
652
|
}
|
|
653
|
-
if (textOptions.includes('PercentageValue') &&
|
|
654
|
-
min != undefined &&
|
|
655
|
-
max != undefined) {
|
|
653
|
+
if (textOptions.includes('PercentageValue') && min != undefined && max != undefined) {
|
|
656
654
|
let percentageValue;
|
|
657
655
|
if (styledColumn.PercentBarStyle?.ColumnComparison) {
|
|
658
656
|
const absMax = Math.abs(max);
|
|
@@ -661,8 +659,7 @@ export class AgGridColumnAdapter {
|
|
|
661
659
|
else {
|
|
662
660
|
const scaleSpan = max - min;
|
|
663
661
|
const clamped = Helper.clamp(Number(params.value), min, max);
|
|
664
|
-
percentageValue =
|
|
665
|
-
scaleSpan === 0 ? 0 : ((clamped - min) / scaleSpan) * 100;
|
|
662
|
+
percentageValue = scaleSpan === 0 ? 0 : ((clamped - min) / scaleSpan) * 100;
|
|
666
663
|
}
|
|
667
664
|
returnValue += ` (${percentageValue.toFixed(0)}%)`;
|
|
668
665
|
}
|
|
@@ -728,8 +725,7 @@ export class AgGridColumnAdapter {
|
|
|
728
725
|
if (!abColumn.availableAggregationFunctions) {
|
|
729
726
|
return undefined;
|
|
730
727
|
}
|
|
731
|
-
return abColumn.availableAggregationFunctions.filter((func) => !
|
|
732
|
-
// .filter((func) => func !== ONLY_AGG_FN_NAME);
|
|
728
|
+
return abColumn.availableAggregationFunctions.filter((func) => !isWeightedAverageAggFuncName(func));
|
|
733
729
|
});
|
|
734
730
|
}
|
|
735
731
|
setupColumnType(columnSetupInfo) {
|
|
@@ -951,10 +947,7 @@ export class AgGridColumnAdapter {
|
|
|
951
947
|
// 1. evaluate EditOptions.isCellEditable if provided
|
|
952
948
|
if (this.adaptableApi.gridApi.internalApi.hasCellEditableAccordingToEditOptions()) {
|
|
953
949
|
const gridCell = this.adaptableApi.gridApi.getGridCellFromRowNode(params.node, params.column.getColId());
|
|
954
|
-
|
|
955
|
-
if (editOptionsEditability) {
|
|
956
|
-
return editOptionsEditability;
|
|
957
|
-
}
|
|
950
|
+
return this.adaptableApi.gridApi.internalApi.isCellEditableAccordingToEditOptions(gridCell, getOriginalColDefEditable());
|
|
958
951
|
}
|
|
959
952
|
// 2. otherwise, fallback to colDef.editable
|
|
960
953
|
return getOriginalColDefEditable();
|
|
@@ -1466,8 +1459,7 @@ export class AgGridColumnAdapter {
|
|
|
1466
1459
|
// basis when a Gradient cell has a tinted background, even if the user
|
|
1467
1460
|
// also set `Font.ForeColor` as a baseline.
|
|
1468
1461
|
const autoContrastColor = gradientStyle?.AutoContrastText && style.color ? style.color : undefined;
|
|
1469
|
-
const iconStyleFontApplies = styledColumn.IconStyle &&
|
|
1470
|
-
!isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
|
|
1462
|
+
const iconStyleFontApplies = styledColumn.IconStyle && !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
|
|
1471
1463
|
const fontSlot = styledColumn.GradientStyle?.Font ??
|
|
1472
1464
|
styledColumn.PercentBarStyle?.Font ??
|
|
1473
1465
|
styledColumn.BulletChartStyle?.Font ??
|
|
@@ -1479,8 +1471,7 @@ export class AgGridColumnAdapter {
|
|
|
1479
1471
|
if (fontSlot) {
|
|
1480
1472
|
style = { ...style, ...convertAdaptableStyleToCSS(fontSlot) };
|
|
1481
1473
|
}
|
|
1482
|
-
const iconStyleCellApplies = styledColumn.IconStyle &&
|
|
1483
|
-
!isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
|
|
1474
|
+
const iconStyleCellApplies = styledColumn.IconStyle && !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
|
|
1484
1475
|
const cellSlot = styledColumn.RatingStyle?.Cell ??
|
|
1485
1476
|
styledColumn.SparklineStyle?.Cell ??
|
|
1486
1477
|
styledColumn.BadgeStyle?.Cell ??
|
|
@@ -9,7 +9,6 @@ export declare class AgGridMenuAdapter {
|
|
|
9
9
|
private get adaptableApi();
|
|
10
10
|
destroy(): void;
|
|
11
11
|
buildColumnMenu(params: GetMainMenuItemsParams, originalGetMainMenuItems: GetMainMenuItems): (DefaultMenuItem | MenuItemDef)[];
|
|
12
|
-
private injectParameterizedAggregationColumnMenuItems;
|
|
13
12
|
buildContextMenu(params: GetContextMenuItemsParams, originalGetContextMenuItems: GetContextMenuItems): (DefaultMenuItem | MenuItemDef)[];
|
|
14
13
|
private mapAgGridItemTypeToAgGridMenuItem;
|
|
15
14
|
private removeConsecutiveSeparators;
|
|
@@ -2,8 +2,8 @@ import { isAdaptableElementIcon } from '../components/Icon';
|
|
|
2
2
|
import { iconToString } from '../components/icons';
|
|
3
3
|
import ArrayExtensions from '../Utilities/Extensions/ArrayExtensions';
|
|
4
4
|
import { MENU_SEPARATOR } from '../Utilities/Constants/GeneralConstants';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { buildValueAggregationMenuItem } from './buildValueAggregationMenuItem';
|
|
6
|
+
import { createAgGridIcon } from './createAgGridIcon';
|
|
7
7
|
export class AgGridMenuAdapter {
|
|
8
8
|
_adaptableInstance;
|
|
9
9
|
constructor(_adaptableInstance) {
|
|
@@ -55,42 +55,25 @@ export class AgGridMenuAdapter {
|
|
|
55
55
|
.filter(Boolean);
|
|
56
56
|
}
|
|
57
57
|
// 2. if not, return the default context menu
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
// AG Grid does not allow customizing the built-in `valueAggSubMenu`, so we
|
|
59
|
+
// replace it with an Adaptable-built equivalent that also offers a Weighted
|
|
60
|
+
// Average aggregation (with a submenu to pick the weight column).
|
|
61
|
+
// Weighted Average is never used in Pivot Layouts, so we leave the AG Grid
|
|
62
|
+
// default item untouched there.
|
|
63
|
+
const isPivotLayout = this.adaptableApi.layoutApi.isCurrentLayoutPivot();
|
|
64
|
+
const mappedAgGridMenuItems = agGridMenuItems.map((itemName) => itemName === 'valueAggSubMenu' && !isPivotLayout
|
|
65
|
+
? {
|
|
66
|
+
...buildValueAggregationMenuItem(this.adaptableApi, menuContext),
|
|
67
|
+
icon: createAgGridIcon('aggregation'),
|
|
68
|
+
}
|
|
69
|
+
: itemName);
|
|
70
|
+
const defaultContextMenu = [
|
|
71
|
+
...mappedAgGridMenuItems,
|
|
60
72
|
'separator',
|
|
61
73
|
...defaultColumnMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
|
|
62
74
|
];
|
|
63
|
-
defaultContextMenu = this.injectParameterizedAggregationColumnMenuItems(defaultContextMenu, adaptableColumn);
|
|
64
75
|
return this.removeConsecutiveSeparators(defaultContextMenu);
|
|
65
76
|
}
|
|
66
|
-
injectParameterizedAggregationColumnMenuItems(menuItems, column) {
|
|
67
|
-
const consolidatedAggregationMenuItem = buildConsolidatedAggregationColumnMenuItem(this.adaptableApi, column, (columnId, parameterizedAgg) => {
|
|
68
|
-
this.adaptableApi.layoutApi.setColumnParameterizedAggregation(columnId, parameterizedAgg);
|
|
69
|
-
}, (columnId, aggFunc) => {
|
|
70
|
-
this.adaptableApi.layoutApi.updateCurrentLayout((layout) => {
|
|
71
|
-
if (aggFunc == null) {
|
|
72
|
-
removeColumnAggregationFromLayout(layout, columnId);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
upsertColumnAggregationInLayout(layout, columnId, aggFunc);
|
|
76
|
-
}
|
|
77
|
-
return layout;
|
|
78
|
-
});
|
|
79
|
-
this.adaptableApi.agGridApi.setColumnAggFunc(columnId, aggFunc);
|
|
80
|
-
});
|
|
81
|
-
if (!consolidatedAggregationMenuItem) {
|
|
82
|
-
return menuItems;
|
|
83
|
-
}
|
|
84
|
-
consolidatedAggregationMenuItem.icon = this.mapAdaptableIconToAgGridIcon({ name: 'equation' });
|
|
85
|
-
const originalValueAggMenuIndex = menuItems.findIndex((item) => isValueAggregationMenuItem(item));
|
|
86
|
-
const menuItemsWithoutValueAgg = menuItems.filter((item) => !isValueAggregationMenuItem(item));
|
|
87
|
-
const result = [...menuItemsWithoutValueAgg];
|
|
88
|
-
const insertIndex = originalValueAggMenuIndex !== -1
|
|
89
|
-
? Math.min(originalValueAggMenuIndex, result.length)
|
|
90
|
-
: findParameterizedAggMenuInsertIndex(menuItemsWithoutValueAgg);
|
|
91
|
-
result.splice(insertIndex, 0, consolidatedAggregationMenuItem);
|
|
92
|
-
return result;
|
|
93
|
-
}
|
|
94
77
|
buildContextMenu(params, originalGetContextMenuItems) {
|
|
95
78
|
if (!params.column) {
|
|
96
79
|
return [];
|
|
@@ -269,7 +252,7 @@ export class AgGridMenuAdapter {
|
|
|
269
252
|
? () => this.adaptableApi.internalApi.dispatchReduxAction(fullMenuItem.reduxAction)
|
|
270
253
|
: undefined,
|
|
271
254
|
icon: this.mapAdaptableIconToAgGridIcon(fullMenuItem.icon, {
|
|
272
|
-
fill: 'var(--ab-color-
|
|
255
|
+
fill: 'var(--ab-color-primary-foreground)',
|
|
273
256
|
}),
|
|
274
257
|
subMenu: fullMenuItem.subItems?.map((subMenuItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(subMenuItem)),
|
|
275
258
|
};
|
|
@@ -282,7 +265,7 @@ export class AgGridMenuAdapter {
|
|
|
282
265
|
return {
|
|
283
266
|
name: customMenuItem.label,
|
|
284
267
|
icon: this.mapAdaptableIconToAgGridIcon(customMenuItem.icon, {
|
|
285
|
-
fill: 'var(--ab-color-
|
|
268
|
+
fill: 'var(--ab-color-primary-foreground)',
|
|
286
269
|
}),
|
|
287
270
|
disabled: customMenuItem.disabled,
|
|
288
271
|
subMenu: !customMenuItem.disabled
|
|
@@ -310,7 +293,7 @@ export class AgGridMenuAdapter {
|
|
|
310
293
|
name: userMenuItem.label,
|
|
311
294
|
action: () => (userMenuItem.onClick ? userMenuItem.onClick(menuContext) : null),
|
|
312
295
|
icon: this.mapAdaptableIconToAgGridIcon(userMenuItem.icon, {
|
|
313
|
-
fill: 'var(--ab-color-
|
|
296
|
+
fill: 'var(--ab-color-primary-foreground)',
|
|
314
297
|
}),
|
|
315
298
|
disabled: userMenuItem.disabled,
|
|
316
299
|
subMenu: userMenuItem.subMenuItems
|
|
@@ -735,7 +718,7 @@ export class AgGridMenuAdapter {
|
|
|
735
718
|
}
|
|
736
719
|
else {
|
|
737
720
|
return iconToString(icon, {
|
|
738
|
-
fill: 'var(--ab-color-
|
|
721
|
+
fill: 'var(--ab-color-primary-foreground)',
|
|
739
722
|
});
|
|
740
723
|
}
|
|
741
724
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MenuItemDef } from 'ag-grid-enterprise';
|
|
2
|
+
import { AdaptableApi } from '../types';
|
|
3
|
+
import { ColumnMenuContext } from '../AdaptableState/Common/Menu';
|
|
4
|
+
/**
|
|
5
|
+
* Builds the replacement for AG Grid's built-in `valueAggSubMenu` column menu item.
|
|
6
|
+
*
|
|
7
|
+
* AG Grid does not allow customizing the built-in submenu, so we rebuild an
|
|
8
|
+
* equivalent one: the column's existing aggregation functions plus a
|
|
9
|
+
* `Weighted Average` item whose submenu lists the numeric columns that can be
|
|
10
|
+
* used as the weight parameter.
|
|
11
|
+
*
|
|
12
|
+
* Both standard and weighted selections persist through the current Layout
|
|
13
|
+
* (`updateCurrentLayout`), so the existing `weightedAvg` aggFunc can read the
|
|
14
|
+
* chosen `weightedColumnId` back from the Layout.
|
|
15
|
+
*
|
|
16
|
+
* Weighted Average is never used in Pivot Layouts, so this only deals with the
|
|
17
|
+
* Table Layout aggregations and the caller skips it entirely in Pivot mode.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildValueAggregationMenuItem(adaptableApi: AdaptableApi, menuContext: ColumnMenuContext): MenuItemDef;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { getAggFuncName, getDisplayAggFuncNames, isWeightedAverageAggregation, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../AdaptableState/Common/AggregationColumns';
|
|
2
|
+
const toFuncLabel = (funcName) => {
|
|
3
|
+
if (funcName === 'avg') {
|
|
4
|
+
return 'Average';
|
|
5
|
+
}
|
|
6
|
+
if (funcName === 'weightedAvg') {
|
|
7
|
+
return 'Weighted Average';
|
|
8
|
+
}
|
|
9
|
+
return funcName ? funcName.charAt(0).toUpperCase() + funcName.slice(1) : funcName;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Builds the replacement for AG Grid's built-in `valueAggSubMenu` column menu item.
|
|
13
|
+
*
|
|
14
|
+
* AG Grid does not allow customizing the built-in submenu, so we rebuild an
|
|
15
|
+
* equivalent one: the column's existing aggregation functions plus a
|
|
16
|
+
* `Weighted Average` item whose submenu lists the numeric columns that can be
|
|
17
|
+
* used as the weight parameter.
|
|
18
|
+
*
|
|
19
|
+
* Both standard and weighted selections persist through the current Layout
|
|
20
|
+
* (`updateCurrentLayout`), so the existing `weightedAvg` aggFunc can read the
|
|
21
|
+
* chosen `weightedColumnId` back from the Layout.
|
|
22
|
+
*
|
|
23
|
+
* Weighted Average is never used in Pivot Layouts, so this only deals with the
|
|
24
|
+
* Table Layout aggregations and the caller skips it entirely in Pivot mode.
|
|
25
|
+
*/
|
|
26
|
+
export function buildValueAggregationMenuItem(adaptableApi, menuContext) {
|
|
27
|
+
const column = menuContext.adaptableColumn;
|
|
28
|
+
const columnId = column.columnId;
|
|
29
|
+
const currentLayout = adaptableApi.layoutApi.getCurrentLayout();
|
|
30
|
+
const aggregationColumns = currentLayout.TableAggregationColumns || [];
|
|
31
|
+
const currentAggFunc = aggregationColumns.find((agg) => agg.ColumnId === columnId)?.AggFunc;
|
|
32
|
+
let activeAggFuncName;
|
|
33
|
+
if (currentAggFunc != null) {
|
|
34
|
+
const aggFuncName = getAggFuncName(currentAggFunc);
|
|
35
|
+
activeAggFuncName = aggFuncName === true ? column.aggregationFunction : aggFuncName;
|
|
36
|
+
}
|
|
37
|
+
const activeWeightColumnId = isWeightedAverageAggregation(currentAggFunc)
|
|
38
|
+
? currentAggFunc.weightedColumnId
|
|
39
|
+
: undefined;
|
|
40
|
+
const applyAggregation = (aggFuncValue) => {
|
|
41
|
+
const upsert = (cols) => {
|
|
42
|
+
const list = cols ? [...cols] : [];
|
|
43
|
+
const index = list.findIndex((col) => col.ColumnId === columnId);
|
|
44
|
+
if (index >= 0) {
|
|
45
|
+
list[index] = { ...list[index], AggFunc: aggFuncValue };
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
list.push({ ColumnId: columnId, AggFunc: aggFuncValue });
|
|
49
|
+
}
|
|
50
|
+
return list;
|
|
51
|
+
};
|
|
52
|
+
adaptableApi.layoutApi.updateCurrentLayout((layout) => {
|
|
53
|
+
const tableLayout = layout;
|
|
54
|
+
return {
|
|
55
|
+
...tableLayout,
|
|
56
|
+
TableAggregationColumns: upsert(tableLayout.TableAggregationColumns),
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const removeAggregation = () => {
|
|
61
|
+
adaptableApi.layoutApi.updateCurrentLayout((layout) => {
|
|
62
|
+
const tableLayout = layout;
|
|
63
|
+
return {
|
|
64
|
+
...tableLayout,
|
|
65
|
+
TableAggregationColumns: (tableLayout.TableAggregationColumns || []).filter((col) => col.ColumnId !== columnId),
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
// 'None' clears any aggregation for the column and is checked when none is set
|
|
70
|
+
const subMenu = [
|
|
71
|
+
{
|
|
72
|
+
name: 'None',
|
|
73
|
+
checked: activeAggFuncName == null,
|
|
74
|
+
action: () => removeAggregation(),
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
// getDisplayAggFuncNames already positions weightedAvg right after 'avg'
|
|
78
|
+
// (and only includes it when the column is eligible)
|
|
79
|
+
const aggFuncItems = getDisplayAggFuncNames(column).map((funcName) => {
|
|
80
|
+
// Weighted Average needs a weight column parameter, so instead of a plain
|
|
81
|
+
// action it gets a submenu listing the numeric columns usable as the weight.
|
|
82
|
+
if (funcName === WEIGHTED_AVERAGE_AGG_FN_NAME) {
|
|
83
|
+
const weightColumnItems = adaptableApi.columnApi
|
|
84
|
+
.getNumericColumns()
|
|
85
|
+
.filter((numericColumn) => numericColumn.columnId !== columnId)
|
|
86
|
+
.map((numericColumn) => ({
|
|
87
|
+
name: numericColumn.friendlyName ?? numericColumn.columnId,
|
|
88
|
+
checked: activeWeightColumnId === numericColumn.columnId,
|
|
89
|
+
action: () => applyAggregation({
|
|
90
|
+
type: 'weightedAverage',
|
|
91
|
+
weightedColumnId: numericColumn.columnId,
|
|
92
|
+
}),
|
|
93
|
+
}));
|
|
94
|
+
return {
|
|
95
|
+
name: 'Weighted Average',
|
|
96
|
+
checked: activeAggFuncName === WEIGHTED_AVERAGE_AGG_FN_NAME,
|
|
97
|
+
subMenu: weightColumnItems,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
name: toFuncLabel(funcName),
|
|
102
|
+
checked: activeAggFuncName === funcName,
|
|
103
|
+
action: () => applyAggregation(funcName),
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
subMenu.push(...aggFuncItems);
|
|
107
|
+
return {
|
|
108
|
+
name: 'Value Aggregation',
|
|
109
|
+
subMenu,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -18,6 +18,12 @@ import { AdaptableColumn } from '../../AdaptableState/Common/AdaptableColumn';
|
|
|
18
18
|
* is configured for case-insensitive matching.
|
|
19
19
|
*/
|
|
20
20
|
export declare const resolveEffectiveIconStyleMappings: (iconStyle: IconStyle | undefined) => IconStyleMapping[];
|
|
21
|
+
/**
|
|
22
|
+
* Mapping list for wizard / settings summaries: custom mappings first so
|
|
23
|
+
* user-authored entries are always visible, then any remaining preset
|
|
24
|
+
* entries (after override filtering).
|
|
25
|
+
*/
|
|
26
|
+
export declare const resolveIconStyleMappingsForSummaryPreview: (iconStyle: IconStyle | undefined) => IconStyleMapping[];
|
|
21
27
|
export declare const getIconRendererForColumn: (styledColumn: StyledColumn, abColumn: AdaptableColumn, api: AdaptableApi) => any;
|
|
22
28
|
/** Helper exposed for the tooltip getter in `AgGridColumnAdapter`. */
|
|
23
29
|
export declare const findIconStyleMappingForValue: (iconStyle: IconStyle | undefined, cellValue: any) => IconStyleMapping | undefined;
|