@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import Input from '../../../components/Input';
|
|
4
|
+
import { Tag } from '../../../components/Tag';
|
|
5
|
+
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
6
|
+
import { Box, Flex } from '../../../components/Flex';
|
|
7
|
+
import { Card } from '../../../components/Card';
|
|
8
|
+
export const renderFreeTextColumnDefinitionSummary = (data) => {
|
|
9
|
+
return (_jsxs(Box, { className: "twa:text-2 twa:grid twa:items-center twa:grid-cols-[auto_1fr] twa:gap-2", children: [_jsx(Box, { children: "Column Identifier:" }), _jsx(Box, { children: _jsx(Tag, { children: data.ColumnId }) }), data.FriendlyName ? (_jsxs(_Fragment, { children: [_jsx(Box, { children: "Column Name:" }), _jsx(Box, { children: _jsx(Tag, { children: data.FriendlyName ?? data.ColumnId }) })] })) : null] }));
|
|
10
|
+
};
|
|
11
|
+
export const isValidFreeTextColumnDefinition = (data, api) => {
|
|
12
|
+
const columns = api.columnApi.getUIAvailableColumns();
|
|
13
|
+
if (!data.ColumnId) {
|
|
14
|
+
return 'A Column Name is required';
|
|
15
|
+
}
|
|
16
|
+
const columnsWithSameIdCount = columns.filter((c) => c.columnId === data.ColumnId).length;
|
|
17
|
+
const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
|
|
18
|
+
return hasAlreadyExistingId ? 'A column with this Name already exists' : true;
|
|
19
|
+
};
|
|
20
|
+
export const FreeTextColumnDefinitionWizardSection = (props) => {
|
|
21
|
+
const { data } = useOnePageAdaptableWizardContext();
|
|
22
|
+
const [ColumnNameFocused, setColumnNameFocused] = useState(false);
|
|
23
|
+
const inEdit = props.isEdit;
|
|
24
|
+
const handleColumnIdChange = (event) => {
|
|
25
|
+
let e = event.target;
|
|
26
|
+
props.onChange({
|
|
27
|
+
...data,
|
|
28
|
+
ColumnId: e.value,
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const handleColumnNameChange = (event) => {
|
|
32
|
+
let e = event.target;
|
|
33
|
+
props.onChange({
|
|
34
|
+
...data,
|
|
35
|
+
FriendlyName: e.value,
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const handleSpecialColumnSettingsChange = (settings) => {
|
|
39
|
+
props.onChange({
|
|
40
|
+
...data,
|
|
41
|
+
FreeTextColumnSettings: {
|
|
42
|
+
...data.FreeTextColumnSettings,
|
|
43
|
+
...settings,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const { HeaderToolTip } = data.FreeTextColumnSettings ?? {};
|
|
48
|
+
return (_jsx(Box, { "data-name": "free-text-column-definition", children: _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: "Column Name" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Unique identifier for the Free Text Column" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { "data-name": "column-id", value: data.ColumnId || '', className: "twa:max-w-[500px] twa:w-full", autoFocus: !inEdit, disabled: inEdit, type: "text", placeholder: "Enter a Column Name", onChange: handleColumnIdChange }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Column Header" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional display name shown in the grid header" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { "data-name": "column-name", autoFocus: inEdit, onFocus: () => setColumnNameFocused(true), onBlur: () => setColumnNameFocused(false), value: ColumnNameFocused
|
|
49
|
+
? data.FriendlyName || ''
|
|
50
|
+
: data.FriendlyName || data.ColumnId || '', className: "twa:max-w-[500px] twa:w-full", type: "text", placeholder: "Enter a Column Header (optional)", onChange: handleColumnNameChange }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Column Header Tooltip" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional text shown when hovering over the column header" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { "data-name": "header-tooltip", type: "text", className: "twa:max-w-[500px] twa:w-full", value: HeaderToolTip, onChange: (e) => handleSpecialColumnSettingsChange({
|
|
51
|
+
HeaderToolTip: e.target.value,
|
|
52
|
+
}) }) })] })] }) }));
|
|
53
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FreeTextColumn } from '../../../AdaptableState/FreeTextColumnState';
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const isValidFreeTextColumn: (data: FreeTextColumn, api: AdaptableApi) => true | "A Column Name is required" | "A column with this Name already exists" | "A data type is required for the column";
|
|
3
|
+
export declare const renderFreeTextColumnSettingsSummary: (data: FreeTextColumn) => React.JSX.Element;
|
|
4
|
+
export declare const isValidFreeTextColumnSettings: (data: FreeTextColumn) => true | string;
|
|
6
5
|
export type FreeTextColumnSettingsWizardSectionProps = {
|
|
7
6
|
onChange: (data: FreeTextColumn) => void;
|
|
8
7
|
isEdit: boolean;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
2
|
import Input from '../../../components/Input';
|
|
4
|
-
import
|
|
5
|
-
import Radio from '../../../components/Radio';
|
|
6
|
-
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
3
|
+
import Radio, { RadioGroup } from '../../../components/Radio';
|
|
7
4
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
8
5
|
import AdaptableInput from '../../Components/AdaptableInput';
|
|
9
6
|
import { CheckBox } from '../../../components/CheckBox';
|
|
@@ -11,28 +8,24 @@ import { DateFormatter } from '../../../Utilities/Helpers/FormatHelper';
|
|
|
11
8
|
import { parseToISO } from '../../../Utilities/Helpers/DateHelper';
|
|
12
9
|
import { Tag } from '../../../components/Tag';
|
|
13
10
|
import { SpecialColumnSettingsWizardStep } from '../../SpecialColumnSettingsWizardStep';
|
|
14
|
-
import { Box } from '../../../components/Flex';
|
|
11
|
+
import { Box, Flex } from '../../../components/Flex';
|
|
15
12
|
import { SingleSelect } from '../../../components/NewSelect';
|
|
16
|
-
|
|
13
|
+
import { Card } from '../../../components/Card';
|
|
14
|
+
import { TagList } from '../../../components/Tag/Tag';
|
|
15
|
+
import { getFreeTextColumnSettingsTags } from '../Utilities/getFreeTextColumnSettingsTags';
|
|
16
|
+
import { SummaryText } from '../../Wizard/OnePageAdaptableWizard';
|
|
17
|
+
const dataTypeOptions = [
|
|
17
18
|
{ value: 'number', label: 'Number' },
|
|
18
19
|
{ value: 'text', label: 'Text' },
|
|
19
20
|
{ value: 'date', label: 'Date' },
|
|
20
21
|
{ value: 'boolean', label: 'Boolean' },
|
|
21
22
|
];
|
|
22
|
-
export const
|
|
23
|
-
|
|
23
|
+
export const renderFreeTextColumnSettingsSummary = (data) => {
|
|
24
|
+
const propertyTags = getFreeTextColumnSettingsTags(data.FreeTextColumnSettings);
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsxs(SummaryText, { children: ["Data Type: ", _jsx(Tag, { children: data.FreeTextColumnSettings.DataType || 'Not specified' })] }), data.DefaultValue !== undefined ? (_jsxs(SummaryText, { children: ["Default Value: ", _jsx(Tag, { children: String(data.DefaultValue) })] })) : null, data.TextEditor !== undefined ? (_jsxs(SummaryText, { children: ["Editor Type: ", _jsx(Tag, { children: data.TextEditor })] })) : null, propertyTags.length ? (_jsx(Box, { className: "twa:mt-2", children: _jsx(TagList, { tags: propertyTags }) })) : null] }));
|
|
24
26
|
};
|
|
25
|
-
export const
|
|
26
|
-
|
|
27
|
-
if (!data.ColumnId) {
|
|
28
|
-
return 'A Column Name is required';
|
|
29
|
-
}
|
|
30
|
-
const columnsWithSameIdCount = columns.filter((c) => c.columnId === data.ColumnId).length;
|
|
31
|
-
const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
|
|
32
|
-
if (hasAlreadyExistingId) {
|
|
33
|
-
return 'A column with this Name already exists';
|
|
34
|
-
}
|
|
35
|
-
if (!data.FreeTextColumnSettings.DataType) {
|
|
27
|
+
export const isValidFreeTextColumnSettings = (data) => {
|
|
28
|
+
if (!data.FreeTextColumnSettings?.DataType) {
|
|
36
29
|
return 'A data type is required for the column';
|
|
37
30
|
}
|
|
38
31
|
return true;
|
|
@@ -40,26 +33,6 @@ export const isValidFreeTextColumn = (data, api) => {
|
|
|
40
33
|
export const FreeTextColumnSettingsWizardSection = (props) => {
|
|
41
34
|
const { data, api } = useOnePageAdaptableWizardContext();
|
|
42
35
|
const Pattern = api.optionsApi.getUserInterfaceOptions().dateInputOptions.dateFormat;
|
|
43
|
-
const [ColumnNameFocused, setColumnNameFocused] = useState(false);
|
|
44
|
-
const inEdit = props.isEdit;
|
|
45
|
-
const validCheck = isValidFreeTextColumn(data, api);
|
|
46
|
-
const ErrorMessage = validCheck === true ? null : validCheck;
|
|
47
|
-
const handleColumnIdChange = (event) => {
|
|
48
|
-
let e = event.target;
|
|
49
|
-
const ColumnId = e.value;
|
|
50
|
-
props.onChange({
|
|
51
|
-
...data,
|
|
52
|
-
ColumnId,
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
const handleColumnNameChange = (event) => {
|
|
56
|
-
let e = event.target;
|
|
57
|
-
const ColumnName = e.value;
|
|
58
|
-
props.onChange({
|
|
59
|
-
...data,
|
|
60
|
-
FriendlyName: ColumnName,
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
36
|
const handleDataTypeChange = (DataType) => {
|
|
64
37
|
const newData = {
|
|
65
38
|
...data,
|
|
@@ -74,14 +47,6 @@ export const FreeTextColumnSettingsWizardSection = (props) => {
|
|
|
74
47
|
}
|
|
75
48
|
props.onChange(newData);
|
|
76
49
|
};
|
|
77
|
-
const onDynamicSelectChanged = (event) => {
|
|
78
|
-
let e = event.target;
|
|
79
|
-
const TextEditor = e.value;
|
|
80
|
-
props.onChange({
|
|
81
|
-
...data,
|
|
82
|
-
TextEditor,
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
50
|
const handleDefaultValueChange = (event) => {
|
|
86
51
|
let e = event.target;
|
|
87
52
|
let DefaultValue = e.value;
|
|
@@ -95,9 +60,7 @@ export const FreeTextColumnSettingsWizardSection = (props) => {
|
|
|
95
60
|
DefaultValue,
|
|
96
61
|
});
|
|
97
62
|
};
|
|
98
|
-
const handleSpecialColumnSettingsChange = (
|
|
99
|
-
// settings: SpecialColumnSettings
|
|
100
|
-
settings) => {
|
|
63
|
+
const handleSpecialColumnSettingsChange = (settings) => {
|
|
101
64
|
props.onChange({
|
|
102
65
|
...data,
|
|
103
66
|
FreeTextColumnSettings: {
|
|
@@ -106,22 +69,24 @@ export const FreeTextColumnSettingsWizardSection = (props) => {
|
|
|
106
69
|
},
|
|
107
70
|
});
|
|
108
71
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
DefaultValue,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
72
|
+
const { Width } = data.FreeTextColumnSettings ?? {};
|
|
73
|
+
return (_jsx(Box, { "data-name": "free-text-column-settings", children: _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: "Data Type" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose the data type for values entered in this column" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(SingleSelect, { "data-name": "column-type-dropdown", className: "twa:max-w-[300px]", items: dataTypeOptions, placeholder: "Select Data Type", value: data.FreeTextColumnSettings.DataType, onValueChange: (value) => handleDataTypeChange(value) }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Default Value" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional initial value for each cell in the column" })] }), _jsx(Card.Body, { children: data.FreeTextColumnSettings.DataType === 'boolean' ? (_jsx(CheckBox, { "data-name": "column-default-value-checkbox", checked: !!data.DefaultValue, onChange: (DefaultValue) => {
|
|
74
|
+
props.onChange({
|
|
75
|
+
...data,
|
|
76
|
+
DefaultValue,
|
|
77
|
+
});
|
|
78
|
+
} })) : (_jsx(AdaptableInput, { "data-name": "column-default-value", value: data.FreeTextColumnSettings.DataType === 'date' && data.DefaultValue
|
|
79
|
+
? parseToISO(data.DefaultValue, Pattern) || ''
|
|
80
|
+
: data.DefaultValue || '', className: "twa:max-w-[500px] twa:w-full", type: data.FreeTextColumnSettings.DataType === 'number'
|
|
81
|
+
? 'number'
|
|
82
|
+
: data.FreeTextColumnSettings.DataType === 'date'
|
|
83
|
+
? 'date'
|
|
84
|
+
: 'text', placeholder: "Enter a default value (optional)", onChange: handleDefaultValueChange })) })] }), data.FreeTextColumnSettings.DataType === 'text' ? (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Cell Editor" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose how text values are edited in the grid" })] }), _jsx(Card.Body, { children: _jsxs(RadioGroup, { value: data.TextEditor ?? 'Inline', name: "textEditor", orientation: "horizontal", onRadioChange: (TextEditor) => {
|
|
85
|
+
props.onChange({
|
|
86
|
+
...data,
|
|
87
|
+
TextEditor,
|
|
88
|
+
});
|
|
89
|
+
}, children: [_jsx(Radio, { className: "twa:ml-1", "data-name": "inline-editor", value: "Inline", children: "Inline Editor" }), _jsx(Radio, { className: "twa:ml-4", "data-name": "large-editor", value: "Large", children: "Large Editor" })] }) })] })) : null, _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Width" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional column width in pixels" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { "data-name": "column-width", type: "number", className: "twa:max-w-[300px]", value: Width || '', onChange: (e) => handleSpecialColumnSettingsChange({
|
|
90
|
+
Width: Number(e.target.value),
|
|
91
|
+
}) }) })] }), _jsx(SpecialColumnSettingsWizardStep, { isEditable: true, settings: data.FreeTextColumnSettings, onChange: handleSpecialColumnSettingsChange })] }) }));
|
|
127
92
|
};
|
|
@@ -2,7 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { OnePageAdaptableWizard, OnePageWizardSummary } from '../../Wizard/OnePageAdaptableWizard';
|
|
4
4
|
import { cloneObject } from '../../../Utilities/Helpers/Helper';
|
|
5
|
-
import { FreeTextColumnSettingsWizardSection,
|
|
5
|
+
import { FreeTextColumnSettingsWizardSection, isValidFreeTextColumnSettings, renderFreeTextColumnSettingsSummary, } from './FreeTextColumnSettingsWizardSection';
|
|
6
|
+
import { FreeTextColumnDefinitionWizardSection, isValidFreeTextColumnDefinition, renderFreeTextColumnDefinitionSummary, } from './FreeTextColumnDefinitionWizardSection';
|
|
6
7
|
import ObjectFactory from '../../../Utilities/ObjectFactory';
|
|
7
8
|
import * as FreeTextColumnRedux from '../../../Redux/ActionsReducers/FreeTextColumnRedux';
|
|
8
9
|
import { useDispatch, useSelector } from 'react-redux';
|
|
@@ -22,7 +23,7 @@ export const FreeTextColumnWizard = (props) => {
|
|
|
22
23
|
return ObjectFactory.CreateEmptyFreeTextColumn(adaptable.api.gridApi.internalApi.deriveSpecialColumnSettingsFromAgGridDefaultColDef());
|
|
23
24
|
});
|
|
24
25
|
const dispatch = useDispatch();
|
|
25
|
-
const isEdit = props.data || props.popupParams?.action === 'Edit';
|
|
26
|
+
const isEdit = Boolean(props.data) || props.popupParams?.action === 'Edit';
|
|
26
27
|
const handleFinish = () => {
|
|
27
28
|
if (isEdit) {
|
|
28
29
|
dispatch(FreeTextColumnRedux.FreeTextColumnEdit(freeTextColumn));
|
|
@@ -33,13 +34,19 @@ export const FreeTextColumnWizard = (props) => {
|
|
|
33
34
|
props.onFinishWizard(freeTextColumn);
|
|
34
35
|
};
|
|
35
36
|
return (_jsx(OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: freeTextColumn, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
|
|
37
|
+
{
|
|
38
|
+
title: 'Details',
|
|
39
|
+
details: 'Provide Free Text Column Details',
|
|
40
|
+
isValid: isValidFreeTextColumnDefinition,
|
|
41
|
+
renderSummary: renderFreeTextColumnDefinitionSummary,
|
|
42
|
+
render: () => (_jsx(Box, { className: "twa:p-2", children: _jsx(FreeTextColumnDefinitionWizardSection, { isEdit: isEdit, onChange: setFreeTextColumn }) })),
|
|
43
|
+
},
|
|
36
44
|
{
|
|
37
45
|
title: 'Settings',
|
|
38
|
-
details: '
|
|
39
|
-
isValid:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
46
|
+
details: 'Specify Free Text Column Properties',
|
|
47
|
+
isValid: isValidFreeTextColumnSettings,
|
|
48
|
+
renderSummary: renderFreeTextColumnSettingsSummary,
|
|
49
|
+
render: () => (_jsx(Box, { className: "twa:p-2", children: _jsx(FreeTextColumnSettingsWizardSection, { isEdit: isEdit, onChange: setFreeTextColumn }) })),
|
|
43
50
|
},
|
|
44
51
|
{
|
|
45
52
|
details: 'Select Free Text Column Tags',
|
|
@@ -51,10 +58,7 @@ export const FreeTextColumnWizard = (props) => {
|
|
|
51
58
|
'-',
|
|
52
59
|
{
|
|
53
60
|
details: 'Review the Free Text Column',
|
|
54
|
-
|
|
55
|
-
render: () => {
|
|
56
|
-
return (_jsx(Box, { className: "twa:p-2", children: _jsx(OnePageWizardSummary, {}) }));
|
|
57
|
-
},
|
|
61
|
+
render: () => (_jsx(Box, { className: "twa:p-2", children: _jsx(OnePageWizardSummary, {}) })),
|
|
58
62
|
title: 'Summary',
|
|
59
63
|
},
|
|
60
64
|
] }));
|
|
@@ -33,29 +33,31 @@ const LayoutViewPanelComponent = (props) => {
|
|
|
33
33
|
const entityAccessLevel = AdaptableHelper.getAccessLevelForObject(layoutEntity, accessLevel);
|
|
34
34
|
const elementType = viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
35
35
|
const layoutSelectStyle = elementType === 'ToolPanel' ? { minWidth: '100%' } : {};
|
|
36
|
+
const toLayoutSelectItems = (layouts) => layouts.map((layout) => ({
|
|
37
|
+
label: layout.Name,
|
|
38
|
+
value: layout.Name,
|
|
39
|
+
}));
|
|
36
40
|
const tableLayoutsArray = Layouts.filter((layout) => !isPivotLayout(layout));
|
|
37
41
|
const pivotLayoutsArray = Layouts.filter((layout) => isPivotLayout(layout));
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
].filter(Boolean);
|
|
58
|
-
return (_jsxs(Flex, { flexDirection: "row", className: `ab-${elementType}__Layout__wrap twa:gap-0.5`, flexWrap: viewType === 'ToolPanel' ? 'wrap' : 'nowrap', children: [_jsx(Flex, { style: layoutSelectStyle, className: "twa:flex-1", children: _jsx(SingleSelect, { groups: layoutGroups, showItemTooltip: true, disabled: isErrorLayout, className: `twa:w-full twa:min-w-30 ab-${elementType}__Layout__select`, ariaLabel: 'Select Layout', value: layoutEntity ? layoutEntity.Name : null, onValueChange: (layout) => onSelectLayout(layout) }) }), _jsxs(Flex, { flexDirection: "row", className: join(accessLevel === GeneralConstants.ACCESS_LEVEL_READ_ONLY
|
|
42
|
+
const showLayoutTypeHeadings = tableLayoutsArray.length > 0 && pivotLayoutsArray.length > 0;
|
|
43
|
+
const layoutSelectCommonProps = {
|
|
44
|
+
showItemTooltip: true,
|
|
45
|
+
disabled: isErrorLayout,
|
|
46
|
+
className: `twa:w-full twa:min-w-30 ab-${elementType}__Layout__select`,
|
|
47
|
+
ariaLabel: 'Select Layout',
|
|
48
|
+
value: layoutEntity ? layoutEntity.Name : null,
|
|
49
|
+
onValueChange: (layout) => onSelectLayout(layout),
|
|
50
|
+
};
|
|
51
|
+
return (_jsxs(Flex, { flexDirection: "row", className: `ab-${elementType}__Layout__wrap twa:gap-0.5`, flexWrap: viewType === 'ToolPanel' ? 'wrap' : 'nowrap', children: [_jsx(Flex, { style: layoutSelectStyle, className: "twa:flex-1", children: showLayoutTypeHeadings ? (_jsx(SingleSelect, { ...layoutSelectCommonProps, groups: [
|
|
52
|
+
{
|
|
53
|
+
label: 'Table Layouts',
|
|
54
|
+
items: toLayoutSelectItems(tableLayoutsArray),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'Pivot Layouts',
|
|
58
|
+
items: toLayoutSelectItems(pivotLayoutsArray),
|
|
59
|
+
},
|
|
60
|
+
] })) : (_jsx(SingleSelect, { ...layoutSelectCommonProps, items: toLayoutSelectItems(Layouts) })) }), _jsxs(Flex, { flexDirection: "row", className: join(accessLevel === GeneralConstants.ACCESS_LEVEL_READ_ONLY
|
|
59
61
|
? GeneralConstants.READ_ONLY_STYLE
|
|
60
62
|
: '', `ab-${elementType}__Layout__wrap`), children: [_jsx(ButtonEdit, { disabled: isErrorLayout, onClick: () => api.layoutApi.showLayoutEditor(layoutEntity.Name), tooltip: LAYOUT_EDIT_TOOLTIP, className: `ab-${elementType}__Layout__edit`, accessLevel: entityAccessLevel }), _jsx(ButtonClone, { disabled: isErrorLayout, onClick: () => api.layoutApi.showLayoutEditor(layoutEntity.Name, isPivotLayout(layoutEntity) ? 'pivot' : 'table', 'Clone'), tooltip: LAYOUT_CLONE_TOOLTIP, className: `ab-${elementType}__Layout__clone`, tone: "neutral", variant: "text", children: null, accessLevel: cloneAccessLevel }), _jsx(NewDropdownButton, { variant: "text", tooltip: LAYOUT_NEW_TABLE_OR_PIVOT_TOOLTIP, "data-name": "new", items: [
|
|
61
63
|
{
|
|
@@ -183,8 +183,8 @@ export const TransposedPopup = (props) => {
|
|
|
183
183
|
modules,
|
|
184
184
|
}).then((adaptableApi) => {
|
|
185
185
|
transposedAdaptableApiRef.current = adaptableApi;
|
|
186
|
-
adaptableApi.eventApi.on('
|
|
187
|
-
transposedAdaptableApiRef.current?.themeApi.loadTheme(
|
|
186
|
+
adaptableApi.eventApi.on('ThemeSelected', (event) => {
|
|
187
|
+
transposedAdaptableApiRef.current?.themeApi.loadTheme(event.theme);
|
|
188
188
|
});
|
|
189
189
|
});
|
|
190
190
|
}, [elevatedColumnId, adaptable]);
|
|
@@ -175,8 +175,7 @@ export const LayoutWizard = (props) => {
|
|
|
175
175
|
{
|
|
176
176
|
title: 'Row Groups',
|
|
177
177
|
isVisible: () => layoutSupportedFeatures.RowGroupedColumns,
|
|
178
|
-
|
|
179
|
-
details: 'Configure Row Grouping',
|
|
178
|
+
details: 'Configure Row Grouping and Display Behaviour',
|
|
180
179
|
renderSummary: () => _jsx(RowGroupingSectionSummary, {}),
|
|
181
180
|
render: () => (_jsx(Box, { className: "twa:p-2 twa:h-full", children: _jsx(RowGroupingSection, { onChange: setLayout }) })),
|
|
182
181
|
},
|
|
@@ -190,7 +189,7 @@ export const LayoutWizard = (props) => {
|
|
|
190
189
|
{
|
|
191
190
|
title: 'Aggregations',
|
|
192
191
|
isVisible: () => layoutSupportedFeatures.TableAggregationColumns,
|
|
193
|
-
details: 'Select
|
|
192
|
+
details: 'Select Aggregation Columns and Behaviour',
|
|
194
193
|
renderSummary: () => _jsx(AggregationsSectionSummary, {}),
|
|
195
194
|
isValid: (data) => isAggregationsSectionValid(data),
|
|
196
195
|
render: () => (_jsx(Box, { className: "twa:p-2 twa:h-full", children: _jsx(AggregationsSection, { onChange: (layout) => {
|
|
@@ -229,6 +228,7 @@ export const LayoutWizard = (props) => {
|
|
|
229
228
|
details: 'Configure Row Summaries',
|
|
230
229
|
renderSummary: () => _jsx(RowSummarySectionSummary, {}),
|
|
231
230
|
isVisible: () => layoutSupportedFeatures.RowSummaries,
|
|
231
|
+
isValid: areSummaryRowsValid,
|
|
232
232
|
render: () => (_jsx(Box, { className: "twa:p-2 twa:h-full", children: _jsx(RowSummarySection, { onChange: setLayout }) })),
|
|
233
233
|
},
|
|
234
234
|
{
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { TableLayout } from '../../../../../types';
|
|
3
|
-
|
|
4
|
-
export declare const isAggregationsSectionValid: typeof validateTableLayoutAggregations;
|
|
2
|
+
import { Layout, TableLayout } from '../../../../../types';
|
|
3
|
+
export declare const isAggregationsSectionValid: (data: Layout) => true | string;
|
|
5
4
|
export declare const AggregationsSectionSummary: React.FunctionComponent;
|
|
6
5
|
interface AggregationsSectionProps {
|
|
7
6
|
onChange: (data: TableLayout) => void;
|
|
@@ -2,11 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { CheckBox } from '../../../../components/CheckBox';
|
|
4
4
|
import FormLayout, { FormRow } from '../../../../components/FormLayout';
|
|
5
|
-
import {
|
|
5
|
+
import { Card } from '../../../../components/Card';
|
|
6
6
|
import { Tag } from '../../../../components/Tag';
|
|
7
|
-
import {
|
|
8
|
-
import { getParameterizedAggregationDisplayName } from '../../../../Aggregation/parameterizedAggregationHeader';
|
|
9
|
-
import { buildAggregationColumnsMap } from '../../../../Aggregation/parameterizedAggregationWizardHelpers';
|
|
7
|
+
import { getDisplayAggFuncNames, } from '../../../../AdaptableState/Common/AggregationColumns';
|
|
10
8
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
11
9
|
import { ValueSelector } from '../../../Components/ValueSelector';
|
|
12
10
|
import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
|
|
@@ -16,15 +14,24 @@ import ArrayExtensions from '../../../../Utilities/Extensions/ArrayExtensions';
|
|
|
16
14
|
import StringExtensions from '../../../../Utilities/Extensions/StringExtensions';
|
|
17
15
|
import { Box, Flex } from '../../../../components/Flex';
|
|
18
16
|
import { SingleSelect } from '../../../../components/NewSelect';
|
|
19
|
-
|
|
20
|
-
export const isAggregationsSectionValid =
|
|
17
|
+
const WEIGHTED_AVERAGE_AGG_FN_NAME = 'weightedAvg';
|
|
18
|
+
export const isAggregationsSectionValid = (data) => {
|
|
19
|
+
const weightedAvg = data.TableAggregationColumns
|
|
20
|
+
? (data.TableAggregationColumns || []).find(({ AggFunc }) => typeof AggFunc === 'object' &&
|
|
21
|
+
AggFunc.type === 'weightedAverage')?.AggFunc
|
|
22
|
+
: null;
|
|
23
|
+
if (weightedAvg && !weightedAvg.weightedColumnId) {
|
|
24
|
+
return 'Weighted Average requires a weight column to be selected.';
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
};
|
|
21
28
|
export const AggregationsSectionSummary = () => {
|
|
22
29
|
const adaptable = useAdaptable();
|
|
23
30
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
24
31
|
const entries = layout.TableAggregationColumns || [];
|
|
25
32
|
let content = null;
|
|
26
33
|
if (entries.length) {
|
|
27
|
-
content = (_jsx(FormLayout, { children: entries.map(({ ColumnId, AggFunc }) => (_jsx(FormRow, { label: adaptable.api.columnApi.getFriendlyNameForColumnId(ColumnId), children: _jsx(Tag, { children:
|
|
34
|
+
content = (_jsx(FormLayout, { children: entries.map(({ ColumnId, AggFunc }) => (_jsx(FormRow, { label: adaptable.api.columnApi.getFriendlyNameForColumnId(ColumnId), children: _jsx(Tag, { children: typeof AggFunc === 'object' ? AggFunc.type : AggFunc }) }, ColumnId))) }));
|
|
28
35
|
}
|
|
29
36
|
else {
|
|
30
37
|
content = _jsx(Tag, { children: "No Aggregations" });
|
|
@@ -33,7 +40,73 @@ export const AggregationsSectionSummary = () => {
|
|
|
33
40
|
};
|
|
34
41
|
const ColumnRow = (props) => {
|
|
35
42
|
const aggValue = props.layout?.TableAggregationColumns?.find((agg) => agg.ColumnId === props.column.columnId)?.AggFunc;
|
|
36
|
-
|
|
43
|
+
const aggFunctionNames = getDisplayAggFuncNames(props.column);
|
|
44
|
+
const currentAggFnName = props.aggregationColumnsMap[props.column.columnId];
|
|
45
|
+
const updateAggFunc = (fnName) => {
|
|
46
|
+
let aggCols = [...(props.layout.TableAggregationColumns || [])];
|
|
47
|
+
const AggFuncValue = fnName === WEIGHTED_AVERAGE_AGG_FN_NAME
|
|
48
|
+
? {
|
|
49
|
+
type: 'weightedAverage',
|
|
50
|
+
weightedColumnId: null,
|
|
51
|
+
}
|
|
52
|
+
: fnName;
|
|
53
|
+
let found = false;
|
|
54
|
+
aggCols = aggCols.map(({ ColumnId, AggFunc }) => {
|
|
55
|
+
if (ColumnId === props.column.columnId) {
|
|
56
|
+
found = true;
|
|
57
|
+
return {
|
|
58
|
+
ColumnId,
|
|
59
|
+
AggFunc: AggFuncValue,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return { ColumnId, AggFunc };
|
|
63
|
+
});
|
|
64
|
+
if (!found) {
|
|
65
|
+
aggCols.push({
|
|
66
|
+
ColumnId: props.column.columnId,
|
|
67
|
+
AggFunc: AggFuncValue,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
props.onChangeAggFunction(aggCols);
|
|
71
|
+
};
|
|
72
|
+
const updateWeightedColumn = (weightedColumnId) => {
|
|
73
|
+
let aggCols = [...(props.layout.TableAggregationColumns || [])];
|
|
74
|
+
const AggFuncValue = {
|
|
75
|
+
type: 'weightedAverage',
|
|
76
|
+
weightedColumnId: weightedColumnId,
|
|
77
|
+
};
|
|
78
|
+
let found = false;
|
|
79
|
+
aggCols = aggCols.map(({ ColumnId, AggFunc }) => {
|
|
80
|
+
if (ColumnId === props.column.columnId) {
|
|
81
|
+
found = true;
|
|
82
|
+
return {
|
|
83
|
+
ColumnId,
|
|
84
|
+
AggFunc: AggFuncValue,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return { ColumnId, AggFunc };
|
|
88
|
+
});
|
|
89
|
+
if (!found) {
|
|
90
|
+
aggCols.push({
|
|
91
|
+
ColumnId: props.column.columnId,
|
|
92
|
+
AggFunc: AggFuncValue,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
props.onChangeAggFunction(aggCols);
|
|
96
|
+
};
|
|
97
|
+
const weightColumnId = typeof aggValue === 'object' && aggValue.type === 'weightedAverage'
|
|
98
|
+
? aggValue.weightedColumnId
|
|
99
|
+
: null;
|
|
100
|
+
const weightColumnOptions = props.numberColumns
|
|
101
|
+
.filter((col) => col.columnId !== props.column.columnId)
|
|
102
|
+
.map((col) => ({
|
|
103
|
+
label: col.friendlyName,
|
|
104
|
+
value: col.columnId,
|
|
105
|
+
}));
|
|
106
|
+
return (_jsxs(Flex, { alignItems: "center", 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) => ({
|
|
107
|
+
label: fnName,
|
|
108
|
+
value: fnName,
|
|
109
|
+
})), onValueChange: updateAggFunc })), currentAggFnName === WEIGHTED_AVERAGE_AGG_FN_NAME && (_jsxs(Flex, { className: "twa:bg-primary twa:ml-3", alignItems: "center", children: [_jsx(Box, { children: "Weight" }), _jsx(SingleSelect, { className: "twa:min-w-[140px] twa:ml-2", placeholder: "Select Weight", value: weightColumnId, items: weightColumnOptions, onValueChange: updateWeightedColumn })] }))] }));
|
|
37
110
|
};
|
|
38
111
|
export const AggregationsSection = (props) => {
|
|
39
112
|
const adaptable = useAdaptable();
|
|
@@ -43,6 +116,8 @@ export const AggregationsSection = (props) => {
|
|
|
43
116
|
const numberColumns = adaptable.api.columnApi.getNumericColumns();
|
|
44
117
|
const allAggregatableColumnIds = allAggregableColumns.map((col) => col.columnId);
|
|
45
118
|
(layout.TableAggregationColumns || []).forEach((agg) => {
|
|
119
|
+
// we need to also display the columns currently aggregated,
|
|
120
|
+
// even if they are not aggregatable
|
|
46
121
|
if (!allAggregatableColumnIds.includes(agg.ColumnId)) {
|
|
47
122
|
allAggregatableColumnIds.push(agg.ColumnId);
|
|
48
123
|
}
|
|
@@ -77,28 +152,42 @@ export const AggregationsSection = (props) => {
|
|
|
77
152
|
acc[col.columnId] = col;
|
|
78
153
|
return acc;
|
|
79
154
|
}, {});
|
|
80
|
-
return
|
|
81
|
-
|
|
155
|
+
return (layout.TableAggregationColumns || []).reduce((acc, { ColumnId: colId, AggFunc }) => {
|
|
156
|
+
let fn = AggFunc;
|
|
157
|
+
let fnName = '';
|
|
158
|
+
if (typeof fn === 'boolean') {
|
|
159
|
+
fnName = allColumnsMap[colId].aggregationFunction;
|
|
160
|
+
}
|
|
161
|
+
if (typeof fn === 'object' && fn.type === 'weightedAverage') {
|
|
162
|
+
fnName = WEIGHTED_AVERAGE_AGG_FN_NAME;
|
|
163
|
+
}
|
|
164
|
+
else if (typeof fn === 'string') {
|
|
165
|
+
fnName = fn;
|
|
166
|
+
}
|
|
167
|
+
acc[colId] = fnName;
|
|
168
|
+
return acc;
|
|
169
|
+
}, {});
|
|
170
|
+
}, [layout]);
|
|
82
171
|
const handleSuppressAggFuncInHeader = (checked) => {
|
|
83
172
|
props.onChange({
|
|
84
173
|
...layout,
|
|
85
174
|
SuppressAggFuncInHeader: checked,
|
|
86
175
|
});
|
|
87
176
|
};
|
|
88
|
-
return (_jsxs(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
177
|
+
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(ColumnRow, { onChangeAggFunction: handleAggregationChange, layout: layout, column: column, aggregationColumnsMap: aggregationColumnsMap, numberColumns: numberColumns })), options: sortedAggregableColumns, value: (layout.TableAggregationColumns || []).map((agg) => agg.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: [
|
|
178
|
+
{
|
|
179
|
+
label: 'Off',
|
|
180
|
+
value: null,
|
|
181
|
+
},
|
|
182
|
+
].concat(['top', 'bottom', 'pinnedTop', 'pinnedBottom'].map((position) => {
|
|
183
|
+
return {
|
|
184
|
+
label: StringExtensions.CamelCaseToHumanText(position),
|
|
185
|
+
value: position,
|
|
186
|
+
};
|
|
187
|
+
})), placeholder: "Off", value: layout.GrandTotalRow, onValueChange: (value) => {
|
|
188
|
+
props.onChange({
|
|
189
|
+
...layout,
|
|
190
|
+
GrandTotalRow: value,
|
|
191
|
+
});
|
|
192
|
+
} }) })] })] })] }));
|
|
104
193
|
};
|