@adaptabletools/adaptable 23.0.0-canary.3 → 23.0.0-canary.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +116 -61
- package/package.json +9 -4
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -4
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +0 -7
- package/src/AdaptableState/Common/AdaptableForm.d.ts +18 -1
- package/src/AdaptableState/Common/AdaptableForm.js +31 -0
- package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
- package/src/AdaptableState/Common/AggregationColumns.js +27 -2
- package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +3 -2
- package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
- package/src/AdaptableState/Common/Enums.d.ts +5 -10
- package/src/AdaptableState/Common/Enums.js +4 -10
- package/src/AdaptableState/PlusMinusState.d.ts +3 -3
- package/src/AdaptableState/ShortcutState.d.ts +2 -6
- package/src/AdaptableState/StyledColumnState.d.ts +3 -5
- package/src/AdaptableState/ThemeState.d.ts +33 -28
- package/src/Api/EventApi.d.ts +14 -1
- package/src/Api/Events/ThemeChanged.d.ts +6 -0
- package/src/Api/Events/ThemeSelected.d.ts +11 -0
- package/src/Api/Events/ThemeSelected.js +1 -0
- package/src/Api/Implementation/EventApiImpl.js +4 -0
- package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -2
- package/src/Api/Implementation/LayoutApiImpl.js +0 -14
- package/src/Api/Implementation/LayoutHelpers.d.ts +2 -0
- package/src/Api/Implementation/LayoutHelpers.js +29 -7
- package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
- package/src/Api/Implementation/ThemeApiImpl.js +19 -15
- package/src/Api/Internal/EventInternalApi.d.ts +2 -0
- package/src/Api/Internal/EventInternalApi.js +8 -1
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
- package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
- package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
- package/src/Api/Internal/ThemeInternalApi.js +0 -10
- package/src/Api/LayoutApi.d.ts +1 -8
- package/src/Api/ThemeApi.d.ts +6 -2
- package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
- package/src/Strategy/CalculatedColumnModule.js +3 -1
- package/src/Strategy/FormatColumnModule.js +14 -7
- package/src/Strategy/LayoutModule.js +13 -8
- package/src/Strategy/StyledColumnModule.js +64 -36
- package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
- package/src/Utilities/Constants/ReduxConstants.js +1 -14
- package/src/Utilities/Helpers/FormatHelper.js +20 -1
- package/src/Utilities/Helpers/SparklineOptionsHelper.d.ts +7 -0
- package/src/Utilities/Helpers/SparklineOptionsHelper.js +65 -0
- package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +204 -0
- package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
- package/src/Utilities/Helpers/ThemeHelpers.js +38 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.js +143 -0
- package/src/Utilities/ObjectFactory.d.ts +1 -3
- package/src/Utilities/ObjectFactory.js +0 -8
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +7 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +4 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +115 -0
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/ThemeService.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +114 -103
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +13 -14
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +55 -55
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +3 -2
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +2 -2
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +31 -39
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +3 -4
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +30 -17
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +3 -3
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +35 -52
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +21 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +10 -7
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +1 -1
- package/src/View/Components/ModuleProfile.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +0 -1
- package/src/View/Components/RangesComponent.d.ts +7 -2
- package/src/View/Components/RangesComponent.js +94 -22
- package/src/View/Components/Selectors/ColumnSelector.js +5 -0
- package/src/View/Components/StyleComponent.d.ts +1 -0
- package/src/View/Components/StyleComponent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +70 -57
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +6 -4
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +3 -2
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +5 -15
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -26
- package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -13
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +20 -22
- package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
- package/src/View/Export/Wizard/ScheduledReportSettings.js +13 -13
- package/src/View/Export/Wizard/ScheduledReportWizard.js +4 -5
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +24 -23
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +21 -5
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +117 -12
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +66 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +30 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +13 -8
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +62 -13
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +5 -3
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +15 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +53 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +33 -68
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +15 -11
- package/src/View/Layout/LayoutViewPanel.js +23 -21
- package/src/View/Layout/TransposedPopup.js +2 -2
- package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +115 -26
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
- package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
- package/src/View/Layout/Wizard/sections/GridFilterSection.js +11 -11
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -52
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
- package/src/View/Layout/Wizard/sections/SettingsSection.js +4 -5
- package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
- package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +9 -14
- package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +43 -13
- package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +11 -18
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +6 -22
- package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
- package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +11 -18
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +17 -6
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +3 -3
- package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
- package/src/View/Shortcut/shortcutOperations.js +28 -0
- package/src/View/SpecialColumnSettingsWizardStep.js +9 -8
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +24 -15
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +96 -16
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +45 -24
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +108 -33
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +21 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +121 -23
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +34 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +86 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +121 -34
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -75
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +16 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +7 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +4 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +12 -14
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +16 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +31 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +30 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +91 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +52 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +53 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +126 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +52 -29
- package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
- package/src/View/Theme/ThemePopup.d.ts +2 -14
- package/src/View/Theme/ThemePopup.js +1 -36
- package/src/View/UIHelper.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +7 -21
- package/src/View/renderWithAdaptableContext.js +2 -3
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.js +38 -43
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +27 -17
- package/src/agGrid/AgGridColumnAdapter.js +10 -19
- package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
- package/src/agGrid/AgGridMenuAdapter.js +20 -37
- package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
- package/src/agGrid/buildValueAggregationMenuItem.js +111 -0
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
- package/src/agGrid/cellRenderers/IconRenderer.js +43 -15
- package/src/agGrid/createAgGridIcon.d.ts +10 -0
- package/src/agGrid/createAgGridIcon.js +16 -0
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +11 -6
- package/src/components/Combobox/VirtualizedList.js +5 -5
- package/src/components/Combobox/comboboxUtils.d.ts +4 -1
- package/src/components/Combobox/comboboxUtils.js +2 -0
- package/src/components/Combobox/index.d.ts +1 -0
- package/src/components/Combobox/index.js +35 -15
- package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/components/Input/NumberInput.js +1 -1
- package/src/components/Panel/index.js +1 -1
- package/src/components/SimpleButton/index.js +4 -4
- package/src/components/Toggle/Toggle.js +1 -1
- package/src/components/Toggle/ToggleGroup.js +1 -1
- package/src/components/Tree/TreeDropdown/index.js +2 -6
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +5 -1
- package/src/layout-manager/src/index.js +2 -9
- package/src/metamodel/adaptable.metamodel.d.ts +39 -46
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +5 -5
- package/themes/dark.css +1 -68
- package/themes/light.css +1 -5
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
- package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -4
- package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
- package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -63
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -55
- package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
- package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -137
- package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
- package/src/Aggregation/parameterizedAggregationHeader.js +0 -60
- package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
- package/src/Aggregation/parameterizedAggregationHelpers.js +0 -111
- package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
- package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -66
- package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
- package/src/Aggregation/validateParameterizedAggregations.js +0 -20
- package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
- package/src/View/AdaptableComputedCSSVarsContext.js +0 -29
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -43
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -28
- package/src/View/Theme/VariantSelector.d.ts +0 -8
- package/src/View/Theme/VariantSelector.js +0 -20
- package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
- package/src/components/Select/CSSNumericVariableWatch.js +0 -45
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { DataSource, InfiniteTableGrid, } from '../../../../components/InfiniteTable';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import Input from '../../../../components/Input';
|
|
5
|
-
import {
|
|
5
|
+
import { Card } from '../../../../components/Card';
|
|
6
6
|
import { isValidOrderForColumnGroups, } from '../../../../AdaptableState/Common/AdaptableColumn';
|
|
7
7
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
8
8
|
import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
|
|
@@ -373,87 +373,87 @@ export const ColumnsSection = (props) => {
|
|
|
373
373
|
.map((col) => col.columnId)
|
|
374
374
|
: currentOrder.map((col) => col.columnId);
|
|
375
375
|
const visibleIdsCurrentlyDisplayed = visibleIds.filter((colId) => currentlyDisplayedColumnIds.includes(colId));
|
|
376
|
-
return (_jsxs(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
376
|
+
return (_jsxs(Flex, { flexDirection: "column", className: "twa:h-full", children: [_jsxs(Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:mb-2 twa:border-b-foreground/20", children: [_jsx(Box, { className: "twa:text-4 twa:font-medium twa:shrink-0", children: "Columns" }), _jsx(Flex, { flexDirection: "column", className: "twa:flex-1 twa:min-w-0 twa:text-xs twa:opacity-70 twa:font-normal twa:gap-0.5", children: _jsx(Box, { children: "Drag to reorder and use checkboxes to show or hide columns; click a column to edit in right side panel" }) })] }), _jsxs(Box, { className: "twa:flex-1 twa:min-h-0 twa:p-2 twa:gap-2 twa:overflow-hidden twa:grid twa:grid-cols-2", children: [_jsx(Card, { shadow: false, className: "twa:h-full twa:overflow-hidden twa:flex twa:flex-col", children: _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-0 twa:overflow-hidden twa:p-1", children: _jsx(Box, { className: "twa:gap-2 twa:focus:outline-none twa:flex-1 twa:max-h-full twa:overflow-hidden twa:h-full", "data-name": "columns-container", tabIndex: -1, onKeyDown: (event) => {
|
|
377
|
+
const scrollIntoView = (columnId) => {
|
|
378
|
+
const el = event.currentTarget.querySelector(`[data-id="${columnId}"]`);
|
|
379
|
+
el?.scrollIntoView({ block: 'nearest' });
|
|
380
|
+
const input = el?.querySelector('input[type="checkbox"]');
|
|
381
|
+
input?.focus();
|
|
382
|
+
};
|
|
383
|
+
if (event.key === 'ArrowDown') {
|
|
384
|
+
event.preventDefault();
|
|
385
|
+
event.stopPropagation();
|
|
386
|
+
const index = currentlyDisplayedColumnIds.indexOf(selectedColumnId);
|
|
387
|
+
if (index === -1) {
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
const nextColumnId = currentlyDisplayedColumnIds[index + 1];
|
|
391
|
+
const nextColumn = colIdToCol[nextColumnId];
|
|
392
|
+
if (nextColumn) {
|
|
393
|
+
setSelectedColumnId(nextColumn.columnId);
|
|
394
|
+
scrollIntoView(nextColumn.columnId);
|
|
395
|
+
}
|
|
389
396
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
397
|
+
if (event.key === 'ArrowUp') {
|
|
398
|
+
event.preventDefault();
|
|
399
|
+
event.stopPropagation();
|
|
400
|
+
const index = currentlyDisplayedColumnIds.indexOf(selectedColumnId);
|
|
401
|
+
if (index === -1) {
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
const previousColumnId = currentlyDisplayedColumnIds[index - 1];
|
|
405
|
+
const previousColumn = colIdToCol[previousColumnId];
|
|
406
|
+
if (previousColumn) {
|
|
407
|
+
setSelectedColumnId(previousColumn.columnId);
|
|
408
|
+
scrollIntoView(previousColumn.columnId);
|
|
409
|
+
}
|
|
395
410
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
411
|
+
if (event.key === ' ') {
|
|
412
|
+
const target = event.target;
|
|
413
|
+
if (target.tagName === 'INPUT' &&
|
|
414
|
+
target.type === 'checkbox') {
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
event.preventDefault();
|
|
418
|
+
event.stopPropagation();
|
|
419
|
+
const selectedColumn = colIdToCol[selectedColumnId];
|
|
420
|
+
if (!selectedColumn) {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
const visible = isColumnVisible({ columnId: selectedColumnId, layout });
|
|
424
|
+
handleColumnVisibilityChange(selectedColumnId, !visible);
|
|
403
425
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
return option.moveable;
|
|
436
|
-
}, optionClassName: (option) => {
|
|
437
|
-
const baseCls = 'ab-Layout-Wizard__ColumnRow twa:cursor-pointer twa:rounded-standard';
|
|
438
|
-
if (selectedColumnId !== option.columnId) {
|
|
439
|
-
return baseCls;
|
|
440
|
-
}
|
|
441
|
-
return clsx(baseCls, 'twa:after:border-accent twa:relative twa:after:border-2 twa:after:rounded-standard twa:after:pointer-events-none twa:after:inset-0 twa:after:absolute twa:after:bg-accent/15');
|
|
442
|
-
}, order: currentOrder, onOptionClick: (option, event) => {
|
|
443
|
-
if (event.ctrlKey || option.columnId === selectedColumnId) {
|
|
444
|
-
setSelectedColumnId(null);
|
|
445
|
-
}
|
|
446
|
-
else {
|
|
447
|
-
setSelectedColumnId(option.columnId);
|
|
448
|
-
const row = event.target.closest?.(`[data-id="${option.columnId}"]`);
|
|
449
|
-
const input = row?.querySelector('input[type="checkbox"]');
|
|
450
|
-
input?.focus();
|
|
451
|
-
}
|
|
452
|
-
}, renderOption: (option) => {
|
|
453
|
-
return (_jsx(ColumnRow, { onColumnNameChange: handleColumnNameChange, onColumnWidthChange: handleColumnWidthChange, onColumnFlexChange: handleColumnFlexChange, onColumnMinWidthChange: handleColumnMinWidthChange, onColumnMaxWidthChange: handleColumnMaxWidthChange, onColumnVisibilityChange: handleColumnVisibilityChange, onPinChange: handlePinChange, onCheckboxFocus: setSelectedColumnId, layout: layout, column: option }));
|
|
454
|
-
}, onChange: handleColumnsChange })] }) }), currentOrderIds.length ? (_jsx(ColumnPropertiesEditor, { column: selectedColumnId && currentOrderIds.includes(selectedColumnId)
|
|
455
|
-
? colIdToCol[selectedColumnId] ?? null
|
|
456
|
-
: null, layout: layout, onPinChange: handlePinChange, onColumnNameChange: handleColumnNameChange, onColumnWidthChange: handleColumnWidthChange, onColumnFlexChange: handleColumnFlexChange, onColumnMinWidthChange: handleColumnMinWidthChange, onColumnMaxWidthChange: handleColumnMaxWidthChange, onColumnVisibilityChange: handleColumnVisibilityChange })) : null] }) })] }));
|
|
426
|
+
}, children: _jsxs(Box, { className: "twa:flex twa:flex-col twa:gap-2 twa:h-full twa:overflow-hidden twa:p-1", children: [_jsx(AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Search Columns...", className: "twa:w-full twa:p-1" }), _jsx(Box, { className: clsx('twa:font-bold', 'twa:border-b twa:border-primarydark/30 twa:rounded-standard'), children: _jsx(CheckBox, { checked: currentlyDisplayedColumnIds.length
|
|
427
|
+
? currentlyDisplayedColumnIds.length === visibleIdsCurrentlyDisplayed.length
|
|
428
|
+
? true
|
|
429
|
+
: visibleIdsCurrentlyDisplayed.length
|
|
430
|
+
? null
|
|
431
|
+
: false
|
|
432
|
+
: false, onChange: (checked) => {
|
|
433
|
+
handleColumnVisibilityChange(currentlyDisplayedColumnIds, checked);
|
|
434
|
+
}, children: "Select All" }) }), _jsx(ReorderDraggable, { className: "twa:overflow-y-auto", toIdentifier: (option) => `${option.columnId}`, isOptionDraggable: (option) => {
|
|
435
|
+
return option.moveable;
|
|
436
|
+
}, optionClassName: (option) => {
|
|
437
|
+
const baseCls = 'ab-Layout-Wizard__ColumnRow twa:cursor-pointer twa:rounded-standard';
|
|
438
|
+
if (selectedColumnId !== option.columnId) {
|
|
439
|
+
return baseCls;
|
|
440
|
+
}
|
|
441
|
+
return clsx(baseCls, 'twa:after:border-accent twa:relative twa:after:border-2 twa:after:rounded-standard twa:after:pointer-events-none twa:after:inset-0 twa:after:absolute twa:after:bg-accent/15');
|
|
442
|
+
}, order: currentOrder, onOptionClick: (option, event) => {
|
|
443
|
+
if (event.ctrlKey || option.columnId === selectedColumnId) {
|
|
444
|
+
setSelectedColumnId(null);
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
setSelectedColumnId(option.columnId);
|
|
448
|
+
const row = event.target.closest?.(`[data-id="${option.columnId}"]`);
|
|
449
|
+
const input = row?.querySelector('input[type="checkbox"]');
|
|
450
|
+
input?.focus();
|
|
451
|
+
}
|
|
452
|
+
}, renderOption: (option) => {
|
|
453
|
+
return (_jsx(ColumnRow, { onColumnNameChange: handleColumnNameChange, onColumnWidthChange: handleColumnWidthChange, onColumnFlexChange: handleColumnFlexChange, onColumnMinWidthChange: handleColumnMinWidthChange, onColumnMaxWidthChange: handleColumnMaxWidthChange, onColumnVisibilityChange: handleColumnVisibilityChange, onPinChange: handlePinChange, onCheckboxFocus: setSelectedColumnId, layout: layout, column: option }));
|
|
454
|
+
}, onChange: handleColumnsChange })] }) }) }) }), currentOrderIds.length ? (_jsx(ColumnPropertiesEditor, { column: selectedColumnId && currentOrderIds.includes(selectedColumnId)
|
|
455
|
+
? colIdToCol[selectedColumnId] ?? null
|
|
456
|
+
: null, layout: layout, onPinChange: handlePinChange, onColumnNameChange: handleColumnNameChange, onColumnWidthChange: handleColumnWidthChange, onColumnFlexChange: handleColumnFlexChange, onColumnMinWidthChange: handleColumnMinWidthChange, onColumnMaxWidthChange: handleColumnMaxWidthChange, onColumnVisibilityChange: handleColumnVisibilityChange })) : null] })] }));
|
|
457
457
|
};
|
|
458
458
|
const hr = (_jsx("hr", { className: "twa:my-3 twa:mb-0 twa:w-full twa:h-[0.5px] twa:bg-input-border/50 twa:border-none" }));
|
|
459
459
|
const ColumnPropertiesEditor = (props) => {
|
|
@@ -2,8 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { getLayoutFilterViewItems } from '../../../../Strategy/Utilities/Layout/getLayoutFilterViewItems';
|
|
4
4
|
import * as ModuleConstants from '../../../../Utilities/Constants/ModuleConstants';
|
|
5
|
-
import FormLayout, { FormRow } from '../../../../components/FormLayout';
|
|
6
|
-
import { Tabs } from '../../../../components/Tabs';
|
|
7
5
|
import { Tag } from '../../../../components/Tag';
|
|
8
6
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
9
7
|
import { AdaptableObjectListItemView } from '../../../Components/AdaptableObjectList/AdaptableObjectList';
|
|
@@ -11,6 +9,7 @@ import { ColumnSelector } from '../../../Components/Selectors/ColumnSelector';
|
|
|
11
9
|
import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
|
|
12
10
|
import { LayoutColumnFilter } from '../../../Components/ColumnFilter/LayoutColumnFilter';
|
|
13
11
|
import { Box } from '../../../../components/Flex';
|
|
12
|
+
import { Card } from '../../../../components/Card';
|
|
14
13
|
export const isColumnFiltersValid = (layout) => {
|
|
15
14
|
const invalidColumnFilters = (layout.ColumnFilters ?? [])?.filter((columnFilter) => !columnFilter?.Predicates[0]?.PredicateId);
|
|
16
15
|
if (invalidColumnFilters.length > 0) {
|
|
@@ -41,34 +40,34 @@ export const FilterSection = (props) => {
|
|
|
41
40
|
ColumnFilters: layoutFilters.map((layoutFilter) => layoutFilter.ColumnId === columnFilter.ColumnId ? { ...columnFilter } : layoutFilter),
|
|
42
41
|
});
|
|
43
42
|
}, [layout.ColumnFilters]);
|
|
44
|
-
return (_jsxs(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
43
|
+
return (_jsxs(Box, { className: "twa:gap-3 twa:p-3 twa:flex twa:flex-col", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Add Column Filter" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Select a column and then create a Filter" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(ColumnSelector, { filterColumn: (column) => column.filterable && !layoutFilters.some((f) => f.ColumnId === column.columnId), placeholder: "Select a Column", onChange: (option) => {
|
|
44
|
+
props.onChange({
|
|
45
|
+
...layout,
|
|
46
|
+
ColumnFilters: [
|
|
47
|
+
...layoutFilters,
|
|
48
|
+
{
|
|
49
|
+
ColumnId: option,
|
|
50
|
+
Predicates: [],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
} }) })] }), layoutFilters?.length > 0 && (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Column Filters" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Configure predicates for each column filter in this Layout" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Box, { className: "twa:p-0", as: "ul", children: layoutFilters.map((columnFilter) => {
|
|
55
|
+
const moduleItems = filterModule.toView(columnFilter).items;
|
|
56
|
+
const column = adaptable.api.columnApi.getColumnWithColumnId(columnFilter.ColumnId);
|
|
57
|
+
const columnGroupItems = column?.columnGroup && column.columnGroup.groupCount > 1
|
|
58
|
+
? [{ name: 'Column Group', values: [column.columnGroup.friendlyName] }]
|
|
59
|
+
: [];
|
|
60
|
+
const items = [
|
|
61
|
+
moduleItems[0],
|
|
62
|
+
...columnGroupItems,
|
|
63
|
+
...moduleItems.slice(1),
|
|
64
|
+
{
|
|
65
|
+
name: 'Column Filter',
|
|
66
|
+
view: (_jsx(LayoutColumnFilter, { columnFilter: columnFilter, onColumnFilterChange: (columnFilter) => {
|
|
67
|
+
handlePredicateEdit(columnFilter);
|
|
68
|
+
} })),
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
return (_jsx(AdaptableObjectListItemView, { module: filterModule, abObject: columnFilter, entityType: "Column Filter", showActions: true, showEditButton: false, items: items, onDelete: () => handleDelete(columnFilter) }, columnFilter.ColumnId));
|
|
72
|
+
}) }) })] }))] }));
|
|
74
73
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
4
4
|
import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
|
|
@@ -8,6 +8,7 @@ import { GridFilterModuleId } from '../../../../Utilities/Constants/ModuleConsta
|
|
|
8
8
|
import StringExtensions from '../../../../Utilities/Extensions/StringExtensions';
|
|
9
9
|
import { useGridFilterOptionsForExpressionEditorProps } from '../../../GridFilter/useGridFilterOptionsForExpressionEditor';
|
|
10
10
|
import { Box } from '../../../../components/Flex';
|
|
11
|
+
import { Card } from '../../../../components/Card';
|
|
11
12
|
export const isGridFiltersValid = (layout, api) => {
|
|
12
13
|
const expression = layout?.GridFilter?.Expression;
|
|
13
14
|
if (StringExtensions.IsNullOrEmpty(expression)) {
|
|
@@ -25,14 +26,13 @@ export const GridFilterSection = (props) => {
|
|
|
25
26
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
26
27
|
const initialData = React.useMemo(() => api.internalApi.getQueryPreviewData(), []);
|
|
27
28
|
const expressionEditorProps = useGridFilterOptionsForExpressionEditorProps();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return _jsx("div", { children: expressionEditorContent });
|
|
29
|
+
return (_jsx(Box, { className: "twa:p-3", children: _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Grid Filter" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Define a boolean expression to filter rows across the entire grid in this Layout" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(ExpressionEditor, { ...expressionEditorProps, allowSaveNamedQuery: false, type: 'boolean', module: GridFilterModuleId, value: layout?.GridFilter?.Expression ?? '', onChange: (expression) => {
|
|
30
|
+
props.onChange({
|
|
31
|
+
...layout,
|
|
32
|
+
GridFilter: {
|
|
33
|
+
...layout.GridFilter,
|
|
34
|
+
Expression: expression,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}, initialData: initialData, columns: api.columnApi.internalApi.getQueryableColumnsForUIEditor(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }) })] }) }));
|
|
38
38
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PivotLayout } from '../../../../../types';
|
|
3
|
-
|
|
4
|
-
export declare const isPivotAggregationsSectionValid: typeof validatePivotLayoutAggregations;
|
|
3
|
+
export declare const isPivotAggregationsSectionValid: (data: PivotLayout) => true | string;
|
|
5
4
|
export declare const PivotAggregationsSectionSummary: React.FunctionComponent;
|
|
6
5
|
interface PivotAggregationsSectionProps {
|
|
7
6
|
onChange: (data: PivotLayout) => void;
|
|
@@ -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
|
};
|