@adaptabletools/adaptable 23.0.0-canary.4 → 23.0.0-canary.6
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 +117 -62
- 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/ColumnFilter/components/ColumnFilterInput.js +0 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +3 -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 +36 -26
- 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
|
@@ -3,13 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import { CheckBox } from '../../../../components/CheckBox';
|
|
4
4
|
import DropdownButton from '../../../../components/DropdownButton';
|
|
5
5
|
import FormLayout, { FormRow } from '../../../../components/FormLayout';
|
|
6
|
-
import {
|
|
6
|
+
import { Card } from '../../../../components/Card';
|
|
7
7
|
import { Tag } from '../../../../components/Tag';
|
|
8
|
-
import { getAggFuncName } from '../../../../AdaptableState/Common/AggregationColumns';
|
|
9
|
-
import { validatePivotLayoutAggregations } from '../../../../Aggregation/validateParameterizedAggregations';
|
|
10
|
-
import { getParameterizedAggregationDisplayName } from '../../../../Aggregation/parameterizedAggregationHeader';
|
|
11
|
-
import { buildAggregationColumnsMap } from '../../../../Aggregation/parameterizedAggregationWizardHelpers';
|
|
12
|
-
import { ParameterizedAggFuncPicker } from './ParameterizedAggFuncPicker';
|
|
8
|
+
import { getAggFuncName, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../../../../AdaptableState/Common/AggregationColumns';
|
|
13
9
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
14
10
|
import { ValueSelector } from '../../../Components/ValueSelector';
|
|
15
11
|
import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
|
|
@@ -22,6 +18,33 @@ import { SingleSelect } from '../../../../components/NewSelect';
|
|
|
22
18
|
const PivotColumnRow = (props) => {
|
|
23
19
|
const adaptable = useAdaptable();
|
|
24
20
|
const aggValue = (props.layout.PivotAggregationColumns || []).find((x) => x.ColumnId === props.column.columnId)?.AggFunc;
|
|
21
|
+
// Weighted Average is not supported in Pivot Layouts, so only the standard
|
|
22
|
+
// AG Grid aggregation functions are offered here.
|
|
23
|
+
const aggFunctionNames = props.column.availableAggregationFunctions || [];
|
|
24
|
+
const currentAggFnName = props.aggregationColumnsMap[props.column.columnId];
|
|
25
|
+
const updateAggFunc = (fnName) => {
|
|
26
|
+
let aggCols = [...(props.layout.PivotAggregationColumns || [])];
|
|
27
|
+
const AggFuncValue = fnName;
|
|
28
|
+
let found = false;
|
|
29
|
+
aggCols = aggCols.map(({ ColumnId, AggFunc, ...rest }) => {
|
|
30
|
+
if (ColumnId === props.column.columnId) {
|
|
31
|
+
found = true;
|
|
32
|
+
return {
|
|
33
|
+
ColumnId,
|
|
34
|
+
AggFunc: AggFuncValue,
|
|
35
|
+
...rest,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return { ColumnId, AggFunc, ...rest };
|
|
39
|
+
});
|
|
40
|
+
if (!found) {
|
|
41
|
+
aggCols.push({
|
|
42
|
+
ColumnId: props.column.columnId,
|
|
43
|
+
AggFunc: AggFuncValue,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
props.onChangeAggFunction(aggCols);
|
|
47
|
+
};
|
|
25
48
|
const totalOptions = ['Off', 'Before', 'After', 'Pivot Specific'].map((totalVariant) => {
|
|
26
49
|
return {
|
|
27
50
|
label: totalVariant,
|
|
@@ -94,8 +117,11 @@ const PivotColumnRow = (props) => {
|
|
|
94
117
|
label: option,
|
|
95
118
|
value: option === 'Off' ? false : option.toLowerCase(),
|
|
96
119
|
}));
|
|
97
|
-
return (_jsx(Box, { "data-name": props.column.columnId, className: "ab-Layout-Wizard__ColumnRow", children: _jsxs(Flex, { alignItems: "flex-start", children: [_jsxs(Flex, { className: "twa:flex-[0_0_auto]", alignItems: "center", children: [_jsx(Flex, { className: "twa:min-w-[80px]", children: props.column.friendlyName }), _jsx(ColumnGroupTag, { column: props.column }),
|
|
98
|
-
|
|
120
|
+
return (_jsx(Box, { "data-name": props.column.columnId, className: "ab-Layout-Wizard__ColumnRow", children: _jsxs(Flex, { alignItems: "flex-start", children: [_jsxs(Flex, { className: "twa:flex-[0_0_auto]", alignItems: "center", children: [_jsx(Flex, { className: "twa:min-w-[80px]", children: props.column.friendlyName }), _jsx(ColumnGroupTag, { column: props.column }), aggValue && (_jsx(SingleSelect, { className: "twa:min-w-[140px] twa:ml-2", value: currentAggFnName, items: aggFunctionNames.map((fnName) => ({
|
|
121
|
+
label: fnName,
|
|
122
|
+
value: fnName,
|
|
123
|
+
})), onValueChange: updateAggFunc })), aggValue && (_jsxs(Flex, { className: "twa:bg-primary twa:ml-3", alignItems: "center", children: [_jsx(Box, { children: "Total" }), ' ', _jsx(DropdownButton, { columns: ['label'], items: totalOptions, className: "twa:ml-2", children: currentTotal })] }))] }), hasPivotSpecificTotals && (_jsx(Flex, { className: "twa:ml-2 twa:pl-2 twa:flex-[1_1_auto] twa:min-w-[200px]", flexWrap: "wrap", alignItems: "center", style: {
|
|
124
|
+
borderLeft: '1px solid var(--ab-color-primary-foreground)',
|
|
99
125
|
rowGap: '8px',
|
|
100
126
|
columnGap: '12px',
|
|
101
127
|
}, children: props.layout.PivotColumns.map((pivotColId) => {
|
|
@@ -117,14 +143,24 @@ const PivotColumnRow = (props) => {
|
|
|
117
143
|
})), children: currentValue })] }, pivotColId));
|
|
118
144
|
}) }))] }) }));
|
|
119
145
|
};
|
|
120
|
-
export const isPivotAggregationsSectionValid =
|
|
146
|
+
export const isPivotAggregationsSectionValid = (data) => {
|
|
147
|
+
const weightedAvg = data.PivotAggregationColumns
|
|
148
|
+
? (data.PivotAggregationColumns || [])
|
|
149
|
+
.map((agg) => agg.AggFunc)
|
|
150
|
+
.find((agg) => typeof agg === 'object' && agg.type === 'weightedAverage')
|
|
151
|
+
: null;
|
|
152
|
+
if (weightedAvg && !weightedAvg.weightedColumnId) {
|
|
153
|
+
return 'Weighted Average requires a weight column to be selected.';
|
|
154
|
+
}
|
|
155
|
+
return true;
|
|
156
|
+
};
|
|
121
157
|
export const PivotAggregationsSectionSummary = () => {
|
|
122
158
|
const adaptable = useAdaptable();
|
|
123
159
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
124
160
|
const pivotAggregationColumns = layout.PivotAggregationColumns || [];
|
|
125
161
|
let content = null;
|
|
126
162
|
if (pivotAggregationColumns.length) {
|
|
127
|
-
content = (_jsx(FormLayout, { children: pivotAggregationColumns.map(({ ColumnId: colId, AggFunc: aggFunc }) => (_jsx(FormRow, { label: adaptable.api.columnApi.getFriendlyNameForColumnId(colId), children: _jsx(Tag, { children:
|
|
163
|
+
content = (_jsx(FormLayout, { children: pivotAggregationColumns.map(({ ColumnId: colId, AggFunc: aggFunc }) => (_jsx(FormRow, { label: adaptable.api.columnApi.getFriendlyNameForColumnId(colId), children: _jsx(Tag, { children: typeof aggFunc === 'object' ? aggFunc.type : aggFunc }) }, colId))) }));
|
|
128
164
|
}
|
|
129
165
|
else {
|
|
130
166
|
content = _jsx(Tag, { children: "No Pivot Column Aggregations" });
|
|
@@ -136,7 +172,6 @@ export const PivotAggregationsSection = (props) => {
|
|
|
136
172
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
137
173
|
const allAggregableColumns = adaptable.api.columnApi.getAggregatableColumns();
|
|
138
174
|
const allColumns = adaptable.api.columnApi.getUIAvailableColumns();
|
|
139
|
-
const numberColumns = adaptable.api.columnApi.getNumericColumns();
|
|
140
175
|
const sortedAggregableColumns = React.useMemo(() => {
|
|
141
176
|
return ArrayExtensions.sortArrayWithOrder(allAggregableColumns.map((col) => col.columnId), (layout.PivotAggregationColumns ?? []).map((col) => col.ColumnId), { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
|
|
142
177
|
}, [layout, allAggregableColumns]);
|
|
@@ -170,8 +205,22 @@ export const PivotAggregationsSection = (props) => {
|
|
|
170
205
|
acc[col.columnId] = col;
|
|
171
206
|
return acc;
|
|
172
207
|
}, {});
|
|
173
|
-
return
|
|
174
|
-
|
|
208
|
+
return (layout.PivotAggregationColumns || []).reduce((acc, { ColumnId: colId, AggFunc: aggFunc }) => {
|
|
209
|
+
let fn = aggFunc;
|
|
210
|
+
let fnName = '';
|
|
211
|
+
if (typeof fn === 'boolean') {
|
|
212
|
+
fnName = allColumnsMap[colId].aggregationFunction;
|
|
213
|
+
}
|
|
214
|
+
if (typeof fn === 'object' && fn.type === 'weightedAverage') {
|
|
215
|
+
fnName = WEIGHTED_AVERAGE_AGG_FN_NAME;
|
|
216
|
+
}
|
|
217
|
+
else if (typeof fn === 'string') {
|
|
218
|
+
fnName = fn;
|
|
219
|
+
}
|
|
220
|
+
acc[colId] = fnName;
|
|
221
|
+
return acc;
|
|
222
|
+
}, {});
|
|
223
|
+
}, [layout]);
|
|
175
224
|
const handleSuppressAggFuncInHeader = (checked) => {
|
|
176
225
|
props.onChange({
|
|
177
226
|
...layout,
|
|
@@ -196,46 +245,46 @@ export const PivotAggregationsSection = (props) => {
|
|
|
196
245
|
return true;
|
|
197
246
|
};
|
|
198
247
|
const isPivotColumnTotalEnabled = checkIfPivotColumnTotalEnabled();
|
|
199
|
-
return (_jsxs(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
248
|
+
return (_jsxs(Box, { className: "twa:h-full twa:min-h-0 twa:p-2 twa:gap-2 twa:overflow-hidden twa:grid twa:grid-cols-2", children: [_jsxs(Card, { shadow: false, className: "twa:h-full twa:overflow-hidden twa:flex twa:flex-col", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Aggregation Columns" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Select a column and an aggregation function" })] }), _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-0 twa:overflow-hidden twa:p-1", children: _jsx(ValueSelector, { style: { minHeight: 0 }, showFilterInput: true, filter: columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (column) => (_jsx(PivotColumnRow, { onChangeAggFunction: handleAggregationChange, layout: layout, column: column, aggregationColumnsMap: aggregationColumnsMap })), options: sortedAggregableColumns, value: (layout.PivotAggregationColumns || []).map((col) => col.ColumnId), allowReorder: true, onChange: handleColumnsSelectionChange }) })] }), _jsxs(Box, { className: "twa:h-full twa:min-h-0 twa:overflow-y-auto twa:flex twa:flex-col twa:gap-2", children: [_jsxs(Card, { shadow: false, children: [_jsx(Card.Title, { children: _jsx(Box, { className: "twa:font-medium", children: "Omit Aggregation from Header" }) }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(CheckBox, { checked: layout.SuppressAggFuncInHeader, onChange: handleSuppressAggFuncInHeader, children: "Do not show aggregation function names in column headers" }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Grand Total Row" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set position of the grand total row in the grid" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(SingleSelect, { className: "twa:w-[180px]", items: [
|
|
249
|
+
{
|
|
250
|
+
label: 'Off',
|
|
251
|
+
value: null,
|
|
252
|
+
},
|
|
253
|
+
].concat(['top', 'bottom', 'pinnedTop', 'pinnedBottom'].map((position) => {
|
|
254
|
+
return {
|
|
255
|
+
label: StringExtensions.CamelCaseToHumanText(position),
|
|
256
|
+
value: position,
|
|
257
|
+
};
|
|
258
|
+
})), placeholder: "Off", value: layout.GrandTotalRow, onValueChange: (value) => {
|
|
259
|
+
props.onChange({
|
|
260
|
+
...layout,
|
|
261
|
+
GrandTotalRow: value,
|
|
262
|
+
});
|
|
263
|
+
} }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Pivot Grand Total" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set position of pivot grand total columns" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(SingleSelect, { className: "twa:w-[180px]", items: [
|
|
264
|
+
{ label: 'Off', value: null },
|
|
265
|
+
...['before', 'after'].map((position) => {
|
|
266
|
+
return {
|
|
267
|
+
label: StringExtensions.CapitaliseFirstLetter(position),
|
|
268
|
+
value: position,
|
|
269
|
+
};
|
|
270
|
+
}),
|
|
271
|
+
], placeholder: "Off", value: layout.PivotGrandTotal, onValueChange: (value) => {
|
|
272
|
+
props.onChange({
|
|
273
|
+
...layout,
|
|
274
|
+
PivotGrandTotal: value,
|
|
275
|
+
});
|
|
276
|
+
} }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Pivot Column Total" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set position of pivot column totals" })] }), _jsx(Card.Body, { className: "twa:p-1", children: isPivotColumnTotalEnabled === true ? (_jsx(SingleSelect, { className: "twa:w-[180px]", items: [
|
|
277
|
+
{ label: 'Off', value: null },
|
|
278
|
+
...['before', 'after'].map((position) => {
|
|
205
279
|
return {
|
|
206
|
-
label: StringExtensions.
|
|
280
|
+
label: StringExtensions.CapitaliseFirstLetter(position),
|
|
207
281
|
value: position,
|
|
208
282
|
};
|
|
209
|
-
})
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
...['before', 'after'].map((position) => {
|
|
217
|
-
return {
|
|
218
|
-
label: StringExtensions.CapitaliseFirstLetter(position),
|
|
219
|
-
value: position,
|
|
220
|
-
};
|
|
221
|
-
}),
|
|
222
|
-
], placeholder: "[none]", value: layout.PivotGrandTotal, onValueChange: (value) => {
|
|
223
|
-
props.onChange({
|
|
224
|
-
...layout,
|
|
225
|
-
PivotGrandTotal: value,
|
|
226
|
-
});
|
|
227
|
-
} }) }), _jsx(FormRow, { label: 'Pivot Column Total', children: isPivotColumnTotalEnabled === true ? (_jsx(SingleSelect, { className: "twa:w-[160px]", items: [
|
|
228
|
-
{ label: 'Off', value: null },
|
|
229
|
-
...['before', 'after'].map((position) => {
|
|
230
|
-
return {
|
|
231
|
-
label: StringExtensions.CapitaliseFirstLetter(position),
|
|
232
|
-
value: position,
|
|
233
|
-
};
|
|
234
|
-
}),
|
|
235
|
-
], placeholder: "[none]", value: layout.PivotColumnTotal, onValueChange: (value) => {
|
|
236
|
-
props.onChange({
|
|
237
|
-
...layout,
|
|
238
|
-
PivotColumnTotal: value,
|
|
239
|
-
});
|
|
240
|
-
} })) : (_jsx(Box, { className: "twa:ml-1 twa:italic", children: isPivotColumnTotalEnabled })) })] }) }), _jsx(ValueSelector, { showFilterInput: true, filter: columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (column) => (_jsx(PivotColumnRow, { onChangeAggFunction: handleAggregationChange, layout: layout, column: column, aggregationColumnsMap: aggregationColumnsMap, numberColumns: numberColumns })), options: sortedAggregableColumns, value: (layout.PivotAggregationColumns || []).map((col) => col.ColumnId), allowReorder: true, onChange: handleColumnsSelectionChange })] })] }));
|
|
283
|
+
}),
|
|
284
|
+
], placeholder: "Off", value: layout.PivotColumnTotal, onValueChange: (value) => {
|
|
285
|
+
props.onChange({
|
|
286
|
+
...layout,
|
|
287
|
+
PivotColumnTotal: value,
|
|
288
|
+
});
|
|
289
|
+
} })) : (_jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:italic", children: isPivotColumnTotalEnabled })) })] })] })] }));
|
|
241
290
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Tabs } from '../../../../components/Tabs';
|
|
4
3
|
import { Tag } from '../../../../components/Tag';
|
|
5
4
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
6
5
|
import { ValueSelector } from '../../../Components/ValueSelector';
|
|
@@ -9,6 +8,8 @@ import { columnFilter } from './Utilities';
|
|
|
9
8
|
import ArrayExtensions from '../../../../Utilities/Extensions/ArrayExtensions';
|
|
10
9
|
import { Box } from '../../../../components/Flex';
|
|
11
10
|
import { CheckBox } from '../../../../components/CheckBox';
|
|
11
|
+
import HelpBlock from '../../../../components/HelpBlock';
|
|
12
|
+
import { Card } from '../../../../components/Card';
|
|
12
13
|
export const PivotColumnsSectionSummary = () => {
|
|
13
14
|
const adaptable = useAdaptable();
|
|
14
15
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
@@ -20,17 +21,17 @@ export const PivotColumnsSection = (props) => {
|
|
|
20
21
|
const allPivotColumns = adaptable.api.columnApi.getPivotableColumns();
|
|
21
22
|
const sortedPivotColumns = React.useMemo(() => {
|
|
22
23
|
return ArrayExtensions.sortArrayWithOrder(allPivotColumns.map((col) => col.columnId), layout.PivotColumns ?? [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
|
|
23
|
-
}, [layout, allPivotColumns]);
|
|
24
|
+
}, [layout, allPivotColumns, adaptable]);
|
|
24
25
|
const handleColumnsChange = (columnIds) => {
|
|
25
26
|
props.onChange({
|
|
26
27
|
...layout,
|
|
27
28
|
PivotColumns: columnIds,
|
|
28
29
|
});
|
|
29
30
|
};
|
|
30
|
-
return (_jsxs(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
return (_jsxs(Box, { className: "twa:h-full twa:min-h-0 twa:p-2 twa:gap-2 twa:overflow-hidden twa:grid twa:grid-cols-2", children: [_jsxs(Card, { shadow: false, className: "twa:h-full twa:overflow-hidden twa:flex twa:flex-col", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Pivot Columns" }), _jsxs(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: ["Select and order the columns used as pivot columns", ' '] })] }), _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-0 twa:overflow-hidden twa:p-1", children: _jsx(ValueSelector, { style: { minHeight: 0 }, showFilterInput: true, filter: columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, options: sortedPivotColumns, value: layout.PivotColumns ?? [], allowReorder: true, onChange: handleColumnsChange }) })] }), _jsx(Box, { className: "twa:h-full twa:min-h-0 twa:overflow-y-auto twa:flex twa:flex-col twa:gap-2", children: _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Pivot Result Columns" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Configure layout persistence behaviour" })] }), _jsxs(Card.Body, { className: "twa:p-1", children: [_jsx(CheckBox, { checked: !!layout.PivotResultColumnsOrder, onChange: (checked) => {
|
|
32
|
+
props.onChange({
|
|
33
|
+
...layout,
|
|
34
|
+
PivotResultColumnsOrder: checked,
|
|
35
|
+
});
|
|
36
|
+
}, children: "Persist order of pivot result columns" }), _jsx(HelpBlock, { className: "twa:mt-2", children: "Result columns are created dynamically for each value in the pivot column" })] })] }) })] }));
|
|
36
37
|
};
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { columnFilter } from './Utilities';
|
|
4
4
|
import { ColumnGroupTag } from '../../../Components/ColumnGroupTag';
|
|
5
|
-
import { Tabs } from '../../../../components/Tabs';
|
|
6
5
|
import { Tag } from '../../../../components/Tag';
|
|
7
6
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
8
7
|
import { ValueSelector } from '../../../Components/ValueSelector';
|
|
@@ -11,11 +10,12 @@ import ArrayExtensions from '../../../../Utilities/Extensions/ArrayExtensions';
|
|
|
11
10
|
import { normalizeLayout } from '../../../../Api/Implementation/LayoutHelpers';
|
|
12
11
|
import { RowGroupBehaviorSection } from './RowGroupingSection';
|
|
13
12
|
import { Box, Flex } from '../../../../components/Flex';
|
|
13
|
+
import { Card } from '../../../../components/Card';
|
|
14
14
|
export const PivotRowGroupingSectionSummary = () => {
|
|
15
15
|
const adaptable = useAdaptable();
|
|
16
16
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
17
17
|
return (_jsx(Box, { children: layout.PivotGroupedColumns?.length ? (layout.PivotGroupedColumns.map((columnId) => {
|
|
18
|
-
return (_jsx(Box, { className: "twa:mb-2", children: _jsx(Tag, { children: adaptable.api.columnApi.getFriendlyNameForColumnId(columnId) }, columnId)
|
|
18
|
+
return (_jsx(Box, { className: "twa:mb-2", children: _jsx(Tag, { children: adaptable.api.columnApi.getFriendlyNameForColumnId(columnId) }) }, columnId));
|
|
19
19
|
})) : (_jsx(Tag, { children: "No Pivot Row Grouping" })) }));
|
|
20
20
|
};
|
|
21
21
|
export const PivotRowGroupingSection = (props) => {
|
|
@@ -34,6 +34,6 @@ export const PivotRowGroupingSection = (props) => {
|
|
|
34
34
|
PivotGroupedColumns: columnIds,
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
const rowGroupsText = '
|
|
38
|
-
return (_jsxs(
|
|
37
|
+
const rowGroupsText = 'Grouped Rows ' + adaptable.api.internalApi.getCorrectEnglishVariant('Behaviour');
|
|
38
|
+
return (_jsxs(Box, { className: "twa:h-full twa:min-h-0 twa:p-2 twa:gap-2 twa:overflow-hidden twa:grid twa:grid-cols-2", children: [_jsxs(Card, { shadow: false, className: "twa:h-full twa:overflow-hidden twa:flex twa:flex-col", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Row Grouped Columns" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Select and order Columns used in grouping" })] }), _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-0 twa:overflow-hidden twa:p-1", children: _jsx(ValueSelector, { style: { minHeight: 0 }, showFilterInput: true, filter: columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (option) => (_jsxs(Flex, { alignItems: "center", children: [option.friendlyName ?? option.columnId, _jsx(ColumnGroupTag, { column: option })] })), options: sortedGroupableColumns, value: layout.PivotGroupedColumns ?? [], allowReorder: true, onChange: handleColumnsChange }) })] }), _jsx(Box, { className: "twa:h-full twa:min-h-0 twa:overflow-y-auto twa:flex twa:flex-col twa:gap-2", children: _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: rowGroupsText }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set what happens when Layout opens" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(RowGroupBehaviorSection, { layout: layout, onChange: onChange }) })] }) })] }));
|
|
39
39
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import FormLayout from '../../../../components/FormLayout';
|
|
4
3
|
import { columnFilter } from './Utilities';
|
|
5
4
|
import { ColumnGroupTag } from '../../../Components/ColumnGroupTag';
|
|
6
5
|
import { RadioGroup } from '../../../../components/Radio';
|
|
7
|
-
import { Tabs } from '../../../../components/Tabs';
|
|
8
6
|
import { Tag } from '../../../../components/Tag';
|
|
9
7
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
10
8
|
import { ValueSelector } from '../../../Components/ValueSelector';
|
|
@@ -13,6 +11,7 @@ import ArrayExtensions from '../../../../Utilities/Extensions/ArrayExtensions';
|
|
|
13
11
|
import { normalizeLayout } from '../../../../Api/Implementation/LayoutHelpers';
|
|
14
12
|
import { TypeRadio } from '../../../Wizard/TypeRadio';
|
|
15
13
|
import { Box, Flex } from '../../../../components/Flex';
|
|
14
|
+
import { Card } from '../../../../components/Card';
|
|
16
15
|
export const RowGroupingSectionSummary = () => {
|
|
17
16
|
const adaptable = useAdaptable();
|
|
18
17
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
@@ -25,19 +24,39 @@ export const RowGroupingSectionSummary = () => {
|
|
|
25
24
|
};
|
|
26
25
|
export const RowGroupBehaviorSection = (props) => {
|
|
27
26
|
const { layout, onChange } = props;
|
|
28
|
-
return (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
return (_jsxs(RadioGroup, { orientation: "vertical", value: layout.RowGroupValues?.RowGroupDefaultBehavior ?? 'always-collapsed', onRadioChange: (RowGroupDefaultBehavior) => {
|
|
28
|
+
const newLayout = {
|
|
29
|
+
...layout,
|
|
30
|
+
RowGroupValues: {
|
|
31
|
+
RowGroupDefaultBehavior,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
if (newLayout.RowGroupValues.RowGroupDefaultBehavior === 'collapsed' ||
|
|
35
|
+
newLayout.RowGroupValues.RowGroupDefaultBehavior === 'expanded') {
|
|
36
|
+
newLayout.RowGroupValues.ExceptionGroupKeys = [];
|
|
37
|
+
}
|
|
38
|
+
onChange(newLayout);
|
|
39
|
+
}, children: [_jsx(TypeRadio, { value: "always-collapsed", text: "All Collapsed", description: "All Grouped Rows are always collapsed" }), _jsx(TypeRadio, { value: "always-expanded", text: "All Expanded", description: "All Grouped Rows are always expanded" }), _jsx(TypeRadio, { value: "expanded", text: "Mostly Expanded", description: "All expanded, other than those collapsed when Layout last displayed" }), _jsx(TypeRadio, { value: "collapsed", text: "Mostly Collapsed", description: "All collapsed, other than those expanded when Layout last displayed" })] }));
|
|
40
|
+
};
|
|
41
|
+
const RowGroupDisplayTypeSection = ({ layout, onChange }) => {
|
|
42
|
+
const adaptable = useAdaptable();
|
|
43
|
+
return (_jsxs(RadioGroup, { orientation: "vertical", value: layout.RowGroupDisplayType ?? 'single', onRadioChange: (RowGroupDisplayType) => {
|
|
44
|
+
let newLayout = {
|
|
45
|
+
...layout,
|
|
46
|
+
RowGroupDisplayType,
|
|
47
|
+
};
|
|
48
|
+
if (RowGroupDisplayType === 'single') {
|
|
49
|
+
newLayout.TableColumns = (newLayout.TableColumns || []).filter((colId) => !adaptable.api.columnApi.isAutoRowGroupColumnForMulti(colId));
|
|
50
|
+
}
|
|
51
|
+
else if (RowGroupDisplayType === 'multi') {
|
|
52
|
+
newLayout.TableColumns = (newLayout.TableColumns || []).filter((colId) => !adaptable.api.columnApi.isAutoRowGroupColumnForSingle(colId));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
newLayout.TableColumns = (newLayout.TableColumns || []).filter((colId) => !adaptable.api.columnApi.isAutoRowGroupColumnForSingle(colId) &&
|
|
56
|
+
!adaptable.api.columnApi.isAutoRowGroupColumnForMulti(colId));
|
|
57
|
+
}
|
|
58
|
+
onChange(newLayout);
|
|
59
|
+
}, children: [_jsx(TypeRadio, { value: "single", text: "Single Column", description: "All Row Grouped Columns display in one hierarchical Column" }), _jsx(TypeRadio, { value: "multi", text: "Multiple Columns", description: "Each Row Grouped Column displays in its own, separate, Column" }), _jsx(TypeRadio, { value: "groupRows", text: "Full Width Group Rows", description: "Row groups display as full-width rows (no group column and no aggregations)" })] }));
|
|
41
60
|
};
|
|
42
61
|
export const RowGroupingSection = (props) => {
|
|
43
62
|
const adaptable = useAdaptable();
|
|
@@ -45,7 +64,7 @@ export const RowGroupingSection = (props) => {
|
|
|
45
64
|
return (_jsx(Flex, { flexDirection: "row", children: _jsx(Tag, { children: "Row Grouping is not available in Tree Grids" }) }));
|
|
46
65
|
}
|
|
47
66
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
48
|
-
const rowGroupsText = '
|
|
67
|
+
const rowGroupsText = 'Grouped Rows ' + adaptable.api.internalApi.getCorrectEnglishVariant('Behaviour');
|
|
49
68
|
const allGroupableColumns = adaptable.api.columnApi.getGroupableColumns();
|
|
50
69
|
const sortedGroupableColumns = React.useMemo(() => {
|
|
51
70
|
return ArrayExtensions.sortArrayWithOrder(allGroupableColumns.map((col) => col.columnId), layout.RowGroupedColumns ?? [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
|
|
@@ -65,21 +84,5 @@ export const RowGroupingSection = (props) => {
|
|
|
65
84
|
}
|
|
66
85
|
onChange(newLayout);
|
|
67
86
|
};
|
|
68
|
-
return (_jsxs(Box, { className: "twa:h-full", children: [_jsxs(
|
|
69
|
-
let newLayout = {
|
|
70
|
-
...layout,
|
|
71
|
-
RowGroupDisplayType,
|
|
72
|
-
};
|
|
73
|
-
if (RowGroupDisplayType === 'single') {
|
|
74
|
-
newLayout.TableColumns = (newLayout.TableColumns || []).filter((colId) => !adaptable.api.columnApi.isAutoRowGroupColumnForMulti(colId));
|
|
75
|
-
}
|
|
76
|
-
else if (RowGroupDisplayType === 'multi') {
|
|
77
|
-
newLayout.TableColumns = (newLayout.TableColumns || []).filter((colId) => !adaptable.api.columnApi.isAutoRowGroupColumnForSingle(colId));
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
newLayout.TableColumns = (newLayout.TableColumns || []).filter((colId) => !adaptable.api.columnApi.isAutoRowGroupColumnForSingle(colId) &&
|
|
81
|
-
!adaptable.api.columnApi.isAutoRowGroupColumnForMulti(colId));
|
|
82
|
-
}
|
|
83
|
-
onChange(newLayout);
|
|
84
|
-
}, children: [_jsx(TypeRadio, { value: "single", text: "Single Column", description: "All Row Grouped Columns display in one hierarchical Column" }), _jsx(TypeRadio, { value: "multi", text: "Multiple Columns", description: "Each Row Grouped Column displays in its own, separate, Column" }), _jsx(TypeRadio, { value: "groupRows", text: "Full Width Group Rows", description: "Row groups display as full-width rows (no group column and no aggregations)" })] }) }) })] }), _jsxs(Tabs, { className: "twa:mt-2", children: [_jsx(Tabs.Tab, { children: "Row Grouped Columns" }), _jsx(Tabs.Tab, { children: rowGroupsText }), _jsx(Tabs.Content, { children: _jsx(ValueSelector, { showFilterInput: true, filter: columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (option) => (_jsxs(Flex, { alignItems: "center", children: [option.friendlyName ?? option.columnId, _jsx(ColumnGroupTag, { column: option })] })), options: sortedGroupableColumns, value: layout.RowGroupedColumns ?? [], allowReorder: true, onChange: handleColumnsChange }) }), _jsx(Tabs.Content, { children: _jsx(RowGroupBehaviorSection, { layout: layout, onChange: onChange }) })] })] }));
|
|
87
|
+
return (_jsxs(Box, { className: "twa:h-full twa:min-h-0 twa:p-2 twa:gap-2 twa:overflow-hidden twa:grid twa:grid-cols-2", children: [_jsxs(Card, { shadow: false, className: "twa:h-full twa:overflow-hidden twa:flex twa:flex-col", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Row Grouped Columns" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Select and order Columns used in grouping" })] }), _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-0 twa:overflow-hidden twa:p-1", children: _jsx(ValueSelector, { style: { minHeight: 0 }, showFilterInput: true, filter: columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (option) => (_jsxs(Flex, { alignItems: "center", children: [option.friendlyName ?? option.columnId, _jsx(ColumnGroupTag, { column: option })] })), options: sortedGroupableColumns, value: layout.RowGroupedColumns ?? [], allowReorder: true, onChange: handleColumnsChange }) })] }), _jsxs(Box, { className: "twa:h-full twa:min-h-0 twa:overflow-y-auto twa:flex twa:flex-col twa:gap-2", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Group Display Type" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose how grouped rows display in the grid" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(RowGroupDisplayTypeSection, { layout: layout, onChange: onChange }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: rowGroupsText }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set what happens when Layout opens" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(RowGroupBehaviorSection, { layout: layout, onChange: onChange }) })] })] })] }));
|
|
85
88
|
};
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { CheckBox } from '../../../../components/CheckBox';
|
|
3
3
|
import Radio, { radioGroupStyling } from '../../../../components/Radio';
|
|
4
4
|
import { RadioGroup } from '../../../../components/Radio';
|
|
5
|
-
import { Tabs } from '../../../../components/Tabs';
|
|
6
5
|
import { Tag } from '../../../../components/Tag';
|
|
7
6
|
import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
|
|
8
7
|
import { Box, Flex } from '../../../../components/Flex';
|
|
@@ -10,6 +9,7 @@ import { twMerge } from '../../../../twMerge';
|
|
|
10
9
|
import HelpBlock from '../../../../components/HelpBlock';
|
|
11
10
|
import { isPivotLayout } from '../../../../Utilities/isPivotLayout';
|
|
12
11
|
import { AG_GRID_SELECTION_COLUMN } from '../../../../Utilities/Constants/GeneralConstants';
|
|
12
|
+
import { Card } from '../../../../components/Card';
|
|
13
13
|
export const RowSelectionSectionSummary = () => {
|
|
14
14
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
15
15
|
if (layout.RowSelection === false) {
|
|
@@ -69,5 +69,5 @@ export const RowSelectionSection = (props) => {
|
|
|
69
69
|
}
|
|
70
70
|
props.onChange(newLayout);
|
|
71
71
|
};
|
|
72
|
-
return (_jsxs(
|
|
72
|
+
return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Row Selection Mode" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose whether row selection is disabled, single row, or multi row" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsxs(RadioGroup, { orientation: "horizontal", variant: "text-only", className: twMerge(radioGroupStyling.horizontalTextOnly, 'twa:gap-2 twa:max-w-[500px] twa:bg-background twa:p-2'), value: mode, name: "rowSelectionMode", onRadioChange: handleModeChange, children: [_jsx(Radio, { value: false, children: "Disabled" }), _jsx(Radio, { value: "singleRow", children: "Single Row" }), _jsx(Radio, { value: "multiRow", children: "Multi Row" })] }) })] }), !rowSelection && _jsx(HelpBlock, { children: "There is no Row Selection configured for this Layout" }), rowSelection && (_jsxs(_Fragment, { children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Row Selection Column Checkboxes" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Configure checkboxes in the selection column cells and header" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsxs(Flex, { flexDirection: "row", className: "twa:gap-6", children: [_jsx(CheckBox, { className: "twa:flex-1", checked: rowSelection.Checkboxes ?? true, onChange: (checked) => updateRowSelection({ Checkboxes: checked }), children: "Checkboxes in Column Cells" }), mode === 'multiRow' && (_jsx(CheckBox, { className: "twa:flex-1", checked: rowSelection.HeaderCheckbox ?? true, onChange: (checked) => updateRowSelection({ HeaderCheckbox: checked }), children: "Checkbox in Column Header (to enable Select All)" }))] }) })] }), (rowSelection.Checkboxes ?? true) && (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Row Grouping Selection Checkboxes" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose where selection checkboxes appear when row grouping is enabled" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsxs(RadioGroup, { orientation: "vertical", value: rowSelection.CheckboxInGroupColumn ?? false, name: "checkboxLocation", onRadioChange: (value) => updateRowSelection({ CheckboxInGroupColumn: value }), children: [_jsx(Radio, { value: false, children: "Display in dedicated Selection Column" }), _jsx(Radio, { value: true, children: "Display in Row Grouped Column" })] }) })] })), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Row Click Selection" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Configure whether users can select or deselect rows by clicking outside the checkbox" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsxs(RadioGroup, { orientation: "vertical", value: rowSelection.EnableClickSelection ?? false, name: "clickSelection", onRadioChange: (value) => updateRowSelection({ EnableClickSelection: value }), children: [_jsx(Radio, { value: false, children: "Disabled (Cannot select or deselect by clicking in Row)" }), _jsx(Radio, { value: true, children: "Full (Enable selection by clicking in Row and deselection by Ctrl+clicking in Row)" }), _jsx(Radio, { value: 'enableSelection', children: "Selection Only (Enable selection by clicking in Row)" }), _jsx(Radio, { value: 'enableDeselection', children: "Deselection Only (Enable deselection by Ctrl+clicking in Row)" })] }) })] }), mode === 'multiRow' && !isPivot && (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Grouped Row Selection Behaviour" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose how selection cascades when a grouped row is selected" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsxs(RadioGroup, { orientation: "vertical", value: rowSelection.GroupSelectMode ?? 'self', name: "groupSelectMode", onRadioChange: (value) => updateRowSelection({ GroupSelectMode: value }), children: [_jsx(Radio, { value: 'self', children: "Select Grouped Row Only (no cascade)" }), _jsx(Radio, { value: 'descendants', children: "Select Grouped Row and all descendants" }), _jsx(Radio, { value: 'filteredDescendants', children: "Select Grouped Row and only filtered descendants" })] }) })] })), mode === 'multiRow' && (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Select All Behaviour" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose which rows are selected when the header Select All checkbox is used" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsxs(RadioGroup, { orientation: "vertical", value: rowSelection.SelectAllMode ?? 'all', name: "selectAllMode", onRadioChange: (value) => updateRowSelection({ SelectAllMode: value }), children: [_jsx(Radio, { value: 'all', children: "All rows" }), _jsx(Radio, { value: 'filtered', children: "Filtered rows only" }), _jsx(Radio, { value: 'currentPage', children: "Current page only" })] }) })] }))] }))] }));
|
|
73
73
|
};
|