@adaptabletools/adaptable 23.0.0-canary.4 → 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/EditOptions.d.ts +2 -2
- package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
- package/src/AdaptableState/Common/AggregationColumns.js +27 -2
- package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
- package/src/AdaptableState/Common/Enums.d.ts +5 -5
- package/src/AdaptableState/Common/Enums.js +4 -4
- 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 +17 -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/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/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 +32 -41
- 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/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/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 +21 -22
- 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/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/agGrid/AdaptableAgGrid.d.ts +1 -0
- package/src/agGrid/AdaptableAgGrid.js +35 -25
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +27 -17
- package/src/agGrid/AgGridColumnAdapter.js +9 -15
- 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/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/env.js +2 -2
- package/src/layout-manager/src/index.js +2 -9
- package/src/metamodel/adaptable.metamodel.d.ts +39 -29
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +5 -4
- package/themes/dark.css +1 -68
- package/themes/light.css +1 -5
- package/tsconfig.esm.tsbuildinfo +1 -1
- 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/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
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as ThemeRedux from '../../Redux/ActionsReducers/ThemeRedux';
|
|
3
2
|
import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
|
|
4
|
-
|
|
5
|
-
interface ThemePopupProps extends ModuleViewPopupProps<ThemePopupComponent> {
|
|
6
|
-
CurrentTheme: string;
|
|
7
|
-
UserThemes: AdaptableTheme[];
|
|
8
|
-
SelectTheme: (newTheme: string) => ThemeRedux.ThemeSelectAction;
|
|
9
|
-
hideShowInWindow?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare class ThemePopupComponent extends React.Component<ThemePopupProps, {}> {
|
|
3
|
+
declare class ThemePopupComponent extends React.Component<ModuleViewPopupProps<ThemePopupComponent>, {}> {
|
|
12
4
|
render(): React.JSX.Element;
|
|
13
|
-
onChangeTheme(value: string): void;
|
|
14
|
-
handleCreateNewTheme: (variant: "dark" | "light") => void;
|
|
15
5
|
}
|
|
16
|
-
export declare let ThemePopup:
|
|
17
|
-
[x: string]: any;
|
|
18
|
-
}>;
|
|
6
|
+
export declare let ThemePopup: typeof ThemePopupComponent;
|
|
19
7
|
export {};
|
|
@@ -1,47 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { connect } from 'react-redux';
|
|
4
|
-
import * as ThemeRedux from '../../Redux/ActionsReducers/ThemeRedux';
|
|
5
3
|
import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
|
|
6
4
|
import FormLayout, { FormRow } from '../../components/FormLayout';
|
|
7
|
-
import ObjectFactory from '../../Utilities/ObjectFactory';
|
|
8
|
-
import { ACCESS_LEVEL_READ_ONLY } from '../../Utilities/Constants/GeneralConstants';
|
|
9
5
|
import { ThemeSelector } from './ThemeSelector';
|
|
10
6
|
import { Box } from '../../components/Flex';
|
|
11
7
|
class ThemePopupComponent extends React.Component {
|
|
12
8
|
render() {
|
|
13
|
-
const isCustomTheme = this.props.api.themeApi
|
|
14
|
-
.getUserThemes()
|
|
15
|
-
.some((theme) => theme.Name === this.props.CurrentTheme);
|
|
16
|
-
const disabled = this.props.accessLevel === ACCESS_LEVEL_READ_ONLY;
|
|
17
9
|
return (_jsx(PopupPanel, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), children: _jsx(FormLayout, { children: _jsx(FormRow, { label: "Select Current Theme:", children: _jsx(Box, { className: "twa:max-w-[150px]", children: _jsx(ThemeSelector, {}) }) }) }) }));
|
|
18
10
|
}
|
|
19
|
-
onChangeTheme(value) {
|
|
20
|
-
this.props.SelectTheme(value);
|
|
21
|
-
}
|
|
22
|
-
handleCreateNewTheme = (variant) => {
|
|
23
|
-
let nthItem = this.props.UserThemes.length + 1;
|
|
24
|
-
let name = 'Custom-Theme-' + nthItem;
|
|
25
|
-
// make sure it is unique
|
|
26
|
-
while (this.props.UserThemes.some((theme) => theme.Name === name)) {
|
|
27
|
-
nthItem++;
|
|
28
|
-
name = 'Custom-Theme-' + nthItem;
|
|
29
|
-
}
|
|
30
|
-
const newTheme = ObjectFactory.CreateEmptyTheme(name);
|
|
31
|
-
newTheme.Variant = variant;
|
|
32
|
-
this.props.api.themeApi.addUserTheme(newTheme);
|
|
33
|
-
this.props.api.themeApi.loadTheme(newTheme.Name);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function mapStateToProps(state, ownProps) {
|
|
37
|
-
return {
|
|
38
|
-
CurrentTheme: state.Theme.CurrentTheme,
|
|
39
|
-
UserThemes: state.Theme.UserThemes,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function mapDispatchToProps(dispatch) {
|
|
43
|
-
return {
|
|
44
|
-
SelectTheme: (newTheme) => dispatch(ThemeRedux.ThemeSelect(newTheme)),
|
|
45
|
-
};
|
|
46
11
|
}
|
|
47
|
-
export let ThemePopup =
|
|
12
|
+
export let ThemePopup = ThemePopupComponent;
|
package/src/View/UIHelper.js
CHANGED
|
@@ -314,7 +314,7 @@ export function getButtonColourForAdaptableAlerts(adaptableAlerts, messageTypeCo
|
|
|
314
314
|
}
|
|
315
315
|
export function getButtonTextColourForArrayandMessageType(adaptableAlerts, messageType) {
|
|
316
316
|
if (ArrayExtensions.IsNullOrEmpty(adaptableAlerts)) {
|
|
317
|
-
return '
|
|
317
|
+
return 'primary-foreground';
|
|
318
318
|
}
|
|
319
319
|
return this.getButtonTextColourForMessageType(messageType);
|
|
320
320
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { useDispatch } from 'react-redux';
|
|
5
5
|
import * as NamedQueryRedux from '../../Redux/ActionsReducers/NamedQueryRedux';
|
|
6
|
-
import SimpleButton from '../../components/SimpleButton';
|
|
7
6
|
import { useAdaptable } from '../AdaptableContext';
|
|
8
|
-
import {
|
|
7
|
+
import { Card } from '../../components/Card';
|
|
8
|
+
import { ButtonEdit } from '../Components/Buttons/ButtonEdit';
|
|
9
9
|
import { NamedQueryContext, } from '../../components/ExpressionEditor/NamedQueryContext';
|
|
10
10
|
import { OnePageWizard, useOnePageWizardContext } from './OnePageWizards';
|
|
11
11
|
import kebabCase from '../../Utilities/utils/kebabCase';
|
|
@@ -74,20 +74,9 @@ export const OnePageAdaptableWizard = (props) => {
|
|
|
74
74
|
return (_jsx(OnePageAdaptableWizardContext.Provider, { value: extraContext, children: _jsx(NamedQueryContext.Provider, { value: { namedQuery, setNamedQuery }, children: _jsx(OnePageWizard, { ...props, name: name, sections: sections, onFinish: handleClickFinish, moduleName: props.moduleName ?? props.moduleInfo.FriendlyName }) }) }));
|
|
75
75
|
};
|
|
76
76
|
export const OnePageWizardSummary = () => {
|
|
77
|
-
const {
|
|
78
|
-
const { setCurrentSection } = useOnePageWizardContext();
|
|
79
|
-
|
|
80
|
-
const renderEdit = (index) => (_jsx(SimpleButton, { className: "twa:px-1 twa:inline-block twa:text-2 twa:underline", variant: "text", onClick: () => {
|
|
81
|
-
setCurrentSection(index);
|
|
82
|
-
}, children: "edit" }));
|
|
83
|
-
const extraContext = {
|
|
84
|
-
data,
|
|
85
|
-
api,
|
|
86
|
-
namedQuery,
|
|
87
|
-
moduleInfo: moduleInfo,
|
|
88
|
-
sections,
|
|
89
|
-
};
|
|
90
|
-
return (_jsx(Box, { className: "ab-OnePageWizardSummary twa:flex twa:flex-col twa:gap-2", children: sections
|
|
77
|
+
const { data, api } = useOnePageAdaptableWizardContext();
|
|
78
|
+
const { sections: visibleSections, setCurrentSection } = useOnePageWizardContext();
|
|
79
|
+
return (_jsx(Box, { className: "ab-OnePageWizardSummary twa:flex twa:flex-col twa:gap-3", children: visibleSections
|
|
91
80
|
.map((section, index) => {
|
|
92
81
|
if (section === '-') {
|
|
93
82
|
return null;
|
|
@@ -95,10 +84,7 @@ export const OnePageWizardSummary = () => {
|
|
|
95
84
|
if (!section.renderSummary) {
|
|
96
85
|
return null;
|
|
97
86
|
}
|
|
98
|
-
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
return (_jsx(_Fragment, { children: _jsxs(Tabs, { keyboardNavigation: false, children: [_jsxs(Tabs.Tab, { children: [section.title, " ", renderEdit(index)] }), _jsx(Tabs.Content, { children: section.renderSummary(data, api) })] }, index) }));
|
|
87
|
+
return (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { className: "twa:w-full", children: [_jsx(Box, { className: "twa:font-medium twa:flex-1", children: section.title }), _jsx(ButtonEdit, { onClick: () => setCurrentSection(index) })] }), _jsx(Card.Body, { className: "twa:p-1", children: section.renderSummary?.(data, api) })] }, `${section.title}-${index}`));
|
|
102
88
|
})
|
|
103
89
|
.filter(Boolean) }));
|
|
104
90
|
};
|
|
@@ -360,6 +360,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
360
360
|
private hasFloatingFilterOnAtLeastOneColumn;
|
|
361
361
|
getChartRef(chartId: string): ChartRef;
|
|
362
362
|
updateLayoutInManagerAfterStoreHasChanged(layout?: Layout): void;
|
|
363
|
+
private getActiveAdaptableAggFuncForCol;
|
|
363
364
|
private onRowDataChanged;
|
|
364
365
|
private onCellDataChanged;
|
|
365
366
|
private isUndoChange;
|
|
@@ -78,10 +78,7 @@ 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
83
|
import { ADAPTABLE_PUBLISH_TIMESTAMP } from '../EnvVars';
|
|
87
84
|
import { AdaptableUpgradeHelper } from '../migration/AdaptableUpgradeHelper';
|
|
@@ -90,10 +87,11 @@ import { AdaptableLoadingScreen } from '../View/Components/Popups/AdaptableLoadi
|
|
|
90
87
|
import { createElement } from 'react';
|
|
91
88
|
import { createAgStatusPanelComponent } from '../Utilities/createAgStatusPanelComponent';
|
|
92
89
|
import { only } from '../Utilities/only';
|
|
90
|
+
import { weightedAverage } from '../Utilities/weightedAverage';
|
|
93
91
|
import { ROW_SUMMARY_ROW_ID } from '../AdaptableState/Common/RowSummary';
|
|
94
92
|
import { FlashingCellService } from '../Utilities/Services/FlashingCellService';
|
|
95
93
|
import { AgGridExportAdapter } from './AgGridExportAdapter';
|
|
96
|
-
import { checkForDuplicateColumns, getLayoutRowGroupValuesExceptionGroupKeys, isPivotLayout, layoutModelToLayoutState, layoutStateToLayoutModel, normalizeLayout, } from '../Api/Implementation/LayoutHelpers';
|
|
94
|
+
import { checkForDuplicateColumns, resetLayoutHelperErrorOnceMessages, getLayoutRowGroupValuesExceptionGroupKeys, isPivotLayout, layoutModelToLayoutState, layoutStateToLayoutModel, normalizeLayout, } from '../Api/Implementation/LayoutHelpers';
|
|
97
95
|
import { LayoutManager } from '../layout-manager/src';
|
|
98
96
|
import { rowGroupDisplayTypeToGridOption } from '../layout-manager/src/rowGroupDisplayType';
|
|
99
97
|
import { isPivotLayoutModel } from '../layout-manager/src/isPivotLayoutModel';
|
|
@@ -354,6 +352,7 @@ export class AdaptableAgGrid {
|
|
|
354
352
|
this._rawAdaptableOptions.adaptableId = `adaptable_id_${Date.now()}`;
|
|
355
353
|
}
|
|
356
354
|
this.logger = this.logger ?? new AdaptableLogger(this._rawAdaptableOptions.adaptableId);
|
|
355
|
+
resetLayoutHelperErrorOnceMessages();
|
|
357
356
|
const adaptableId = this._rawAdaptableOptions.adaptableId;
|
|
358
357
|
const initMarker = getMarker(adaptableId).track.Init.label.Init.start();
|
|
359
358
|
const perfInitAdaptableAgGrid = this.logger.beginPerf(`Adaptable._initAdaptableAgGrid()`);
|
|
@@ -899,16 +898,7 @@ export class AdaptableAgGrid {
|
|
|
899
898
|
// #customize_header
|
|
900
899
|
const defaultColDef = { ...original_defaultColDef };
|
|
901
900
|
defaultColDef.headerValueGetter = tagProvidedByAdaptable((params) => {
|
|
902
|
-
|
|
903
|
-
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
904
|
-
if (params.column &&
|
|
905
|
-
!currentLayout.SuppressAggFuncInHeader &&
|
|
906
|
-
params.location === 'header') {
|
|
907
|
-
const parameterizedParenthesisValue = getParameterizedAggregationHeaderParenthesisValue(this.api, params.column.getColId(), currentLayout);
|
|
908
|
-
if (parameterizedParenthesisValue) {
|
|
909
|
-
columnHeaderName = parameterizedParenthesisValue;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
901
|
+
const columnHeaderName = this.api.columnApi.internalApi.getColumnHeaderName(params);
|
|
912
902
|
const formattedHeaderName = this.api.formatColumnApi.internalApi.formatColumnHeaderName(columnHeaderName, params);
|
|
913
903
|
return formattedHeaderName;
|
|
914
904
|
});
|
|
@@ -1122,16 +1112,17 @@ export class AdaptableAgGrid {
|
|
|
1122
1112
|
aggregationFunctions[ONLY_AGG_FN_NAME] = (params) => {
|
|
1123
1113
|
return only(params);
|
|
1124
1114
|
};
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
return
|
|
1133
|
-
}
|
|
1134
|
-
|
|
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
|
+
};
|
|
1135
1126
|
return aggregationFunctions;
|
|
1136
1127
|
});
|
|
1137
1128
|
/**
|
|
@@ -4040,6 +4031,25 @@ export class AdaptableAgGrid {
|
|
|
4040
4031
|
],
|
|
4041
4032
|
});
|
|
4042
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
|
+
}
|
|
4043
4053
|
onRowDataChanged({ rowNode, oldData, newData, }) {
|
|
4044
4054
|
if (oldData == null || oldData == undefined) {
|
|
4045
4055
|
return;
|
|
@@ -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) {
|
|
@@ -1463,8 +1459,7 @@ export class AgGridColumnAdapter {
|
|
|
1463
1459
|
// basis when a Gradient cell has a tinted background, even if the user
|
|
1464
1460
|
// also set `Font.ForeColor` as a baseline.
|
|
1465
1461
|
const autoContrastColor = gradientStyle?.AutoContrastText && style.color ? style.color : undefined;
|
|
1466
|
-
const iconStyleFontApplies = styledColumn.IconStyle &&
|
|
1467
|
-
!isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
|
|
1462
|
+
const iconStyleFontApplies = styledColumn.IconStyle && !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
|
|
1468
1463
|
const fontSlot = styledColumn.GradientStyle?.Font ??
|
|
1469
1464
|
styledColumn.PercentBarStyle?.Font ??
|
|
1470
1465
|
styledColumn.BulletChartStyle?.Font ??
|
|
@@ -1476,8 +1471,7 @@ export class AgGridColumnAdapter {
|
|
|
1476
1471
|
if (fontSlot) {
|
|
1477
1472
|
style = { ...style, ...convertAdaptableStyleToCSS(fontSlot) };
|
|
1478
1473
|
}
|
|
1479
|
-
const iconStyleCellApplies = styledColumn.IconStyle &&
|
|
1480
|
-
!isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
|
|
1474
|
+
const iconStyleCellApplies = styledColumn.IconStyle && !isUnsupportedColumnDataTypeForIconStyle(abColumn.dataType);
|
|
1481
1475
|
const cellSlot = styledColumn.RatingStyle?.Cell ??
|
|
1482
1476
|
styledColumn.SparklineStyle?.Cell ??
|
|
1483
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;
|