@adaptabletools/adaptable 23.0.0-canary.3 → 23.0.0-canary.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +116 -61
- package/package.json +9 -4
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -4
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +0 -7
- package/src/AdaptableState/Common/AdaptableForm.d.ts +18 -1
- package/src/AdaptableState/Common/AdaptableForm.js +31 -0
- package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
- package/src/AdaptableState/Common/AggregationColumns.js +27 -2
- package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +3 -2
- package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
- package/src/AdaptableState/Common/Enums.d.ts +5 -10
- package/src/AdaptableState/Common/Enums.js +4 -10
- package/src/AdaptableState/PlusMinusState.d.ts +3 -3
- package/src/AdaptableState/ShortcutState.d.ts +2 -6
- package/src/AdaptableState/StyledColumnState.d.ts +3 -5
- package/src/AdaptableState/ThemeState.d.ts +33 -28
- package/src/Api/EventApi.d.ts +14 -1
- package/src/Api/Events/ThemeChanged.d.ts +6 -0
- package/src/Api/Events/ThemeSelected.d.ts +11 -0
- package/src/Api/Events/ThemeSelected.js +1 -0
- package/src/Api/Implementation/EventApiImpl.js +4 -0
- package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -2
- package/src/Api/Implementation/LayoutApiImpl.js +0 -14
- package/src/Api/Implementation/LayoutHelpers.d.ts +2 -0
- package/src/Api/Implementation/LayoutHelpers.js +29 -7
- package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
- package/src/Api/Implementation/ThemeApiImpl.js +19 -15
- package/src/Api/Internal/EventInternalApi.d.ts +2 -0
- package/src/Api/Internal/EventInternalApi.js +8 -1
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
- package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
- package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
- package/src/Api/Internal/ThemeInternalApi.js +0 -10
- package/src/Api/LayoutApi.d.ts +1 -8
- package/src/Api/ThemeApi.d.ts +6 -2
- package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
- package/src/Strategy/CalculatedColumnModule.js +3 -1
- package/src/Strategy/FormatColumnModule.js +14 -7
- package/src/Strategy/LayoutModule.js +13 -8
- package/src/Strategy/StyledColumnModule.js +64 -36
- package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
- package/src/Utilities/Constants/ReduxConstants.js +1 -14
- package/src/Utilities/Helpers/FormatHelper.js +20 -1
- package/src/Utilities/Helpers/SparklineOptionsHelper.d.ts +7 -0
- package/src/Utilities/Helpers/SparklineOptionsHelper.js +65 -0
- package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +204 -0
- package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
- package/src/Utilities/Helpers/ThemeHelpers.js +38 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.js +143 -0
- package/src/Utilities/ObjectFactory.d.ts +1 -3
- package/src/Utilities/ObjectFactory.js +0 -8
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +7 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +4 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +115 -0
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/ThemeService.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +114 -103
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +13 -14
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +55 -55
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +3 -2
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +2 -2
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +31 -39
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +3 -4
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +30 -17
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +3 -3
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +35 -52
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +21 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +10 -7
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +1 -1
- package/src/View/Components/ModuleProfile.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +0 -1
- package/src/View/Components/RangesComponent.d.ts +7 -2
- package/src/View/Components/RangesComponent.js +94 -22
- package/src/View/Components/Selectors/ColumnSelector.js +5 -0
- package/src/View/Components/StyleComponent.d.ts +1 -0
- package/src/View/Components/StyleComponent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +70 -57
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +6 -4
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +3 -2
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +5 -15
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -26
- package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -13
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +20 -22
- package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
- package/src/View/Export/Wizard/ScheduledReportSettings.js +13 -13
- package/src/View/Export/Wizard/ScheduledReportWizard.js +4 -5
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +24 -23
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +21 -5
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +117 -12
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +66 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +30 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +13 -8
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +62 -13
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +5 -3
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +15 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +53 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +33 -68
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +15 -11
- package/src/View/Layout/LayoutViewPanel.js +23 -21
- package/src/View/Layout/TransposedPopup.js +2 -2
- package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +115 -26
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
- package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
- package/src/View/Layout/Wizard/sections/GridFilterSection.js +11 -11
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -52
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
- package/src/View/Layout/Wizard/sections/SettingsSection.js +4 -5
- package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
- package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +9 -14
- package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +43 -13
- package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +11 -18
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +6 -22
- package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
- package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +11 -18
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +17 -6
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +3 -3
- package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
- package/src/View/Shortcut/shortcutOperations.js +28 -0
- package/src/View/SpecialColumnSettingsWizardStep.js +9 -8
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +24 -15
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +96 -16
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +45 -24
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +108 -33
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +21 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +121 -23
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +34 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +86 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +121 -34
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -75
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +16 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +7 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +4 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +12 -14
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +16 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +31 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +30 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +91 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +52 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +53 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +126 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +52 -29
- package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
- package/src/View/Theme/ThemePopup.d.ts +2 -14
- package/src/View/Theme/ThemePopup.js +1 -36
- package/src/View/UIHelper.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +7 -21
- package/src/View/renderWithAdaptableContext.js +2 -3
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.js +38 -43
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +27 -17
- package/src/agGrid/AgGridColumnAdapter.js +10 -19
- package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
- package/src/agGrid/AgGridMenuAdapter.js +20 -37
- package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
- package/src/agGrid/buildValueAggregationMenuItem.js +111 -0
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
- package/src/agGrid/cellRenderers/IconRenderer.js +43 -15
- package/src/agGrid/createAgGridIcon.d.ts +10 -0
- package/src/agGrid/createAgGridIcon.js +16 -0
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +11 -6
- package/src/components/Combobox/VirtualizedList.js +5 -5
- package/src/components/Combobox/comboboxUtils.d.ts +4 -1
- package/src/components/Combobox/comboboxUtils.js +2 -0
- package/src/components/Combobox/index.d.ts +1 -0
- package/src/components/Combobox/index.js +35 -15
- package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/components/Input/NumberInput.js +1 -1
- package/src/components/Panel/index.js +1 -1
- package/src/components/SimpleButton/index.js +4 -4
- package/src/components/Toggle/Toggle.js +1 -1
- package/src/components/Toggle/ToggleGroup.js +1 -1
- package/src/components/Tree/TreeDropdown/index.js +2 -6
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +5 -1
- package/src/layout-manager/src/index.js +2 -9
- package/src/metamodel/adaptable.metamodel.d.ts +39 -46
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +5 -5
- package/themes/dark.css +1 -68
- package/themes/light.css +1 -5
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
- package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -4
- package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
- package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -63
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -55
- package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
- package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -137
- package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
- package/src/Aggregation/parameterizedAggregationHeader.js +0 -60
- package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
- package/src/Aggregation/parameterizedAggregationHelpers.js +0 -111
- package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
- package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -66
- package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
- package/src/Aggregation/validateParameterizedAggregations.js +0 -20
- package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
- package/src/View/AdaptableComputedCSSVarsContext.js +0 -29
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -43
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -28
- package/src/View/Theme/VariantSelector.d.ts +0 -8
- package/src/View/Theme/VariantSelector.js +0 -20
- package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
- package/src/components/Select/CSSNumericVariableWatch.js +0 -45
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
3
|
-
import { Tabs } from '../../../components/Tabs';
|
|
4
3
|
import { StyleComponent } from '../../Components/StyleComponent';
|
|
5
4
|
import { StylePreview } from '../../../components/StylePreview';
|
|
6
|
-
import { Box } from '../../../components/Flex';
|
|
7
|
-
|
|
5
|
+
import { Box, Flex } from '../../../components/Flex';
|
|
6
|
+
import { Card } from '../../../components/Card';
|
|
7
|
+
const FLASH_STYLE_CARDS = [
|
|
8
|
+
{
|
|
9
|
+
key: 'UpChangeStyle',
|
|
10
|
+
title: 'Up Change Style',
|
|
11
|
+
description: 'Style applied when a cell value increases',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
key: 'DownChangeStyle',
|
|
15
|
+
title: 'Down Change Style',
|
|
16
|
+
description: 'Style applied when a cell value decreases',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
key: 'NeutralChangeStyle',
|
|
20
|
+
title: 'Neutral Change Style',
|
|
21
|
+
description: 'Style applied when a cell value changes but not up or down (e.g. text edits)',
|
|
22
|
+
},
|
|
23
|
+
];
|
|
8
24
|
export const FlashingAlertStyleWizardSection = (props) => {
|
|
9
25
|
let { data: flashingAlert, api } = useOnePageAdaptableWizardContext();
|
|
10
26
|
flashingAlert = flashingAlert ?? props.flashingAlert;
|
|
11
|
-
return (_jsx(
|
|
27
|
+
return (_jsx(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: FLASH_STYLE_CARDS.map(({ key, title, description }) => (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: title }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: description })] }), _jsx(Card.Body, { children: _jsx(StyleComponent, { headless: true, api: api, Style: flashingAlert[key] ?? {}, UpdateStyle: (style) => props.onStyleChange(key, style) }) })] }, key))) }));
|
|
12
28
|
};
|
|
13
29
|
export const FlashingCellStyle = (props) => {
|
|
14
30
|
const { data, ...boxProps } = props;
|
|
@@ -63,7 +63,7 @@ export const FlashingCellWizard = (props) => {
|
|
|
63
63
|
{
|
|
64
64
|
details: 'Set Name, Duration and Target Properties',
|
|
65
65
|
isValid: isSettingsValid,
|
|
66
|
-
render: () =>
|
|
66
|
+
render: () => _jsx(FlashingAlertSettingsWizardSection, { onChange: setFlashingCell }),
|
|
67
67
|
renderSummary: renderFlashingAlertSettingsSummary,
|
|
68
68
|
title: 'Settings',
|
|
69
69
|
},
|
|
@@ -83,9 +83,9 @@ export const FlashingCellWizard = (props) => {
|
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
details: 'Choose Flash Styles for Up, Down and Neutral Changes',
|
|
86
|
-
render: () => (_jsx(
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
render: () => (_jsx(FlashingAlertStyleWizardSection, { onStyleChange: (styleName, style) => {
|
|
87
|
+
updateStyles[styleName](style);
|
|
88
|
+
} })),
|
|
89
89
|
renderSummary: renderFlashingAlertStyleSummary,
|
|
90
90
|
title: 'Flash Styles',
|
|
91
91
|
},
|
|
@@ -10,7 +10,14 @@ export interface FormatColumnFormatWizardState {
|
|
|
10
10
|
DisplayFormat: AdaptableFormat;
|
|
11
11
|
NumericFormat?: 'Percent' | 'Thousand' | 'Million' | 'Dollar' | 'Sterling' | undefined;
|
|
12
12
|
}
|
|
13
|
+
type DisplayFormatSummaryItem = {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const getFormatColumnDisplayFormatSummaryItems: (data: FormatColumn) => DisplayFormatSummaryItem[];
|
|
18
|
+
export declare const hasFormatColumnDisplayFormat: (data: FormatColumn) => boolean;
|
|
13
19
|
export declare const getFormatColumnFormatSummaryValue: (data: FormatColumn) => string;
|
|
14
20
|
export declare const renderFormatColumnFormatSummary: (data: FormatColumn) => React.JSX.Element;
|
|
15
21
|
export declare const getFormatDisplayTypeForScope: (scope: ColumnScope, api: AdaptableApi) => "number" | "date" | "text" | undefined;
|
|
16
22
|
export declare const FormatColumnFormatWizardSection: (props: FormatColumnFormatWizardSectionProps) => React.JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -31,24 +31,122 @@ const DateFormatPresets = [
|
|
|
31
31
|
'yyyyMMdd',
|
|
32
32
|
'HH:mm:ss',
|
|
33
33
|
];
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const NUMERIC_PRESET_LABELS = {
|
|
35
|
+
Percentage: 'Percentage',
|
|
36
|
+
Thousand: 'K (Thousand)',
|
|
37
|
+
Million: 'M (Million)',
|
|
38
|
+
Billion: 'B (Billion)',
|
|
39
|
+
BasisPoints: 'bps (Basis Pts)',
|
|
40
|
+
Dollar: 'Dollar',
|
|
41
|
+
Sterling: 'Sterling',
|
|
42
|
+
Euro: 'Euro',
|
|
43
|
+
Yen: 'Yen',
|
|
44
|
+
Bitcoin: 'Bitcoin',
|
|
45
|
+
Integer: 'Integer',
|
|
46
|
+
Decimal: 'Decimal',
|
|
47
|
+
Accounting: 'Accounting',
|
|
48
|
+
FXRate: 'FX Rate',
|
|
49
|
+
Scientific: 'Scientific',
|
|
50
|
+
};
|
|
51
|
+
const appendDisplayFormatItem = (items, label, value) => {
|
|
52
|
+
if (value == null || value === '' || value === false) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
items.push({ label, value: String(value) });
|
|
56
|
+
};
|
|
57
|
+
const appendNumberFormatOptions = (items, options) => {
|
|
58
|
+
appendDisplayFormatItem(items, 'Fraction Digits', options.FractionDigits);
|
|
59
|
+
appendDisplayFormatItem(items, 'Fraction Separator', options.FractionSeparator);
|
|
60
|
+
appendDisplayFormatItem(items, 'Integer Digits', options.IntegerDigits);
|
|
61
|
+
appendDisplayFormatItem(items, 'Integer Separator', options.IntegerSeparator);
|
|
62
|
+
appendDisplayFormatItem(items, 'Prefix', options.Prefix);
|
|
63
|
+
appendDisplayFormatItem(items, 'Suffix', options.Suffix);
|
|
64
|
+
appendDisplayFormatItem(items, 'Content', options.Content);
|
|
65
|
+
if (options.Multiplier != null && options.Multiplier !== 1) {
|
|
66
|
+
items.push({ label: 'Multiplier', value: String(options.Multiplier) });
|
|
67
|
+
}
|
|
68
|
+
appendDisplayFormatItem(items, 'Parentheses', options.Parentheses);
|
|
69
|
+
appendDisplayFormatItem(items, 'Truncate', options.Truncate);
|
|
70
|
+
appendDisplayFormatItem(items, 'Absolute Value', options.Abs);
|
|
71
|
+
appendDisplayFormatItem(items, 'Ceiling', options.Ceiling);
|
|
72
|
+
appendDisplayFormatItem(items, 'Floor', options.Floor);
|
|
73
|
+
appendDisplayFormatItem(items, 'Round', options.Round);
|
|
74
|
+
appendDisplayFormatItem(items, 'Empty', options.Empty);
|
|
75
|
+
if (options.Notation === 'scientific') {
|
|
76
|
+
items.push({ label: 'Notation', value: 'Scientific' });
|
|
77
|
+
}
|
|
78
|
+
if (options.CustomDisplayFormats?.length) {
|
|
79
|
+
items.push({
|
|
80
|
+
label: 'Custom Formats',
|
|
81
|
+
value: options.CustomDisplayFormats.join(', '),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const appendStringFormatOptions = (items, options) => {
|
|
86
|
+
appendDisplayFormatItem(items, 'Case', options.Case);
|
|
87
|
+
appendDisplayFormatItem(items, 'Trim', options.Trim);
|
|
88
|
+
appendDisplayFormatItem(items, 'Prefix', options.Prefix);
|
|
89
|
+
appendDisplayFormatItem(items, 'Suffix', options.Suffix);
|
|
90
|
+
appendDisplayFormatItem(items, 'Content', options.Content);
|
|
91
|
+
appendDisplayFormatItem(items, 'Empty', options.Empty);
|
|
92
|
+
if (options.CustomDisplayFormats?.length) {
|
|
93
|
+
items.push({
|
|
94
|
+
label: 'Custom Formats',
|
|
95
|
+
value: options.CustomDisplayFormats.join(', '),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
export const getFormatColumnDisplayFormatSummaryItems = (data) => {
|
|
100
|
+
if (data.DisplayFormat == null) {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
if (isAdaptableNumericFormatPreset(data.DisplayFormat)) {
|
|
104
|
+
return [{ label: '', value: `${NUMERIC_PRESET_LABELS[data.DisplayFormat]} Preset` }];
|
|
105
|
+
}
|
|
36
106
|
const resolved = resolveDisplayFormat(data.DisplayFormat);
|
|
37
107
|
if (!resolved) {
|
|
38
|
-
|
|
108
|
+
return [];
|
|
39
109
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
110
|
+
const items = [];
|
|
111
|
+
if (resolved.Formatter === 'NumberFormatter') {
|
|
112
|
+
appendNumberFormatOptions(items, resolved.Options);
|
|
113
|
+
if (!items.length) {
|
|
114
|
+
items.push({ label: '', value: 'Number Format' });
|
|
43
115
|
}
|
|
44
|
-
|
|
45
|
-
|
|
116
|
+
return items;
|
|
117
|
+
}
|
|
118
|
+
if (resolved.Formatter === 'DateFormatter') {
|
|
119
|
+
const options = resolved.Options;
|
|
120
|
+
appendDisplayFormatItem(items, 'Pattern', options.Pattern);
|
|
121
|
+
if (options.CustomDisplayFormats?.length) {
|
|
122
|
+
items.push({
|
|
123
|
+
label: 'Custom Formats',
|
|
124
|
+
value: options.CustomDisplayFormats.join(', '),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (!items.length) {
|
|
128
|
+
items.push({ label: '', value: 'Date Format' });
|
|
46
129
|
}
|
|
47
|
-
|
|
48
|
-
|
|
130
|
+
return items;
|
|
131
|
+
}
|
|
132
|
+
if (resolved.Formatter === 'StringFormatter') {
|
|
133
|
+
appendStringFormatOptions(items, resolved.Options);
|
|
134
|
+
if (!items.length) {
|
|
135
|
+
items.push({ label: '', value: 'String Format' });
|
|
49
136
|
}
|
|
137
|
+
return items;
|
|
50
138
|
}
|
|
51
|
-
return
|
|
139
|
+
return items;
|
|
140
|
+
};
|
|
141
|
+
export const hasFormatColumnDisplayFormat = (data) => getFormatColumnDisplayFormatSummaryItems(data).length > 0;
|
|
142
|
+
export const getFormatColumnFormatSummaryValue = (data) => {
|
|
143
|
+
const items = getFormatColumnDisplayFormatSummaryItems(data);
|
|
144
|
+
if (!items.length) {
|
|
145
|
+
return 'No Display Format';
|
|
146
|
+
}
|
|
147
|
+
return items
|
|
148
|
+
.map(({ label, value }) => (label ? `${label}: ${value}` : value))
|
|
149
|
+
.join(', ');
|
|
52
150
|
};
|
|
53
151
|
const renderCustomFormatter = (data, customFormatter, setFormatOption) => {
|
|
54
152
|
const resolved = resolveDisplayFormat(data.DisplayFormat);
|
|
@@ -64,7 +162,14 @@ const renderCustomFormatter = (data, customFormatter, setFormatOption) => {
|
|
|
64
162
|
} }) }, customFormatter.id));
|
|
65
163
|
};
|
|
66
164
|
export const renderFormatColumnFormatSummary = (data) => {
|
|
67
|
-
|
|
165
|
+
const items = getFormatColumnDisplayFormatSummaryItems(data);
|
|
166
|
+
if (!items.length) {
|
|
167
|
+
return _jsx(Tag, { children: "No Display Format" });
|
|
168
|
+
}
|
|
169
|
+
if (items.length === 1 && !items[0].label) {
|
|
170
|
+
return _jsx(Tag, { children: items[0].value });
|
|
171
|
+
}
|
|
172
|
+
return (_jsx(Box, { className: "twa:flex twa:flex-col twa:gap-2", children: items.map(({ label, value }) => (_jsxs(Box, { children: [label, " ", _jsx(Tag, { children: value })] }, label))) }));
|
|
68
173
|
};
|
|
69
174
|
export const getFormatDisplayTypeForScope = (scope, api) => {
|
|
70
175
|
if (scope == undefined) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FormatColumn } from '../../../AdaptableState/FormatColumnState';
|
|
3
|
+
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
4
|
+
/** Today's date as sample text — no Display Format options applied. */
|
|
5
|
+
export declare const getFormatColumnPreviewDateSampleText: () => string;
|
|
6
|
+
export declare const getFormatColumnStylePreviewText: (formatColumn: FormatColumn, api: AdaptableApi) => string;
|
|
7
|
+
export declare const getFormatColumnPreviewSampleValue: (formatColumn: FormatColumn, api: AdaptableApi) => string | number;
|
|
8
|
+
export declare const getFormatColumnPreviewText: (formatColumn: FormatColumn, api: AdaptableApi) => string;
|
|
9
|
+
export declare const FormatColumnPreviewContent: React.FunctionComponent<{
|
|
10
|
+
formatColumn: FormatColumn;
|
|
11
|
+
api: AdaptableApi;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const renderFormatColumnPreviewSummary: (formatColumn: FormatColumn, api: AdaptableApi) => React.JSX.Element;
|
|
14
|
+
export declare const FormatColumnPreview: React.FunctionComponent;
|
|
15
|
+
export declare const FormatColumnPreviewSummaryCard: React.FunctionComponent;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { resolveDisplayFormat } from '../../../AdaptableState/Common/AdaptableFormatPresets';
|
|
3
|
+
import { DEFAULT_DOUBLE_DISPLAY_VALUE, DEFAULT_STRING_DISPLAY_VALUE, } from '../../../Utilities/Constants/GeneralConstants';
|
|
4
|
+
import FormatHelper from '../../../Utilities/Helpers/FormatHelper';
|
|
5
|
+
import { convertAdaptableStyleToCSS } from '../../../Utilities/Helpers/StyleHelper';
|
|
6
|
+
import { Card } from '../../../components/Card';
|
|
7
|
+
import { Box } from '../../../components/Flex';
|
|
8
|
+
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
9
|
+
import { getFormatDisplayTypeForScope } from './FormatColumnFormatWizardSection';
|
|
10
|
+
const toFormatColumnPreviewStyle = (formatColumn) => {
|
|
11
|
+
const style = formatColumn.Style ?? {};
|
|
12
|
+
return {
|
|
13
|
+
...convertAdaptableStyleToCSS(style),
|
|
14
|
+
borderWidth: style.BorderColor ? 2 : 0,
|
|
15
|
+
borderStyle: 'solid',
|
|
16
|
+
textAlign: style.Alignment ? style.Alignment.toLowerCase() : undefined,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
/** Today's date as sample text — no Display Format options applied. */
|
|
20
|
+
export const getFormatColumnPreviewDateSampleText = () => new Date().toLocaleDateString();
|
|
21
|
+
export const getFormatColumnStylePreviewText = (formatColumn, api) => {
|
|
22
|
+
const formatType = getFormatDisplayTypeForScope(formatColumn.Scope, api);
|
|
23
|
+
if (formatType === 'number') {
|
|
24
|
+
return String(DEFAULT_DOUBLE_DISPLAY_VALUE);
|
|
25
|
+
}
|
|
26
|
+
if (formatType === 'date') {
|
|
27
|
+
return getFormatColumnPreviewDateSampleText();
|
|
28
|
+
}
|
|
29
|
+
return DEFAULT_STRING_DISPLAY_VALUE;
|
|
30
|
+
};
|
|
31
|
+
export const getFormatColumnPreviewSampleValue = (formatColumn, api) => {
|
|
32
|
+
const formatType = getFormatDisplayTypeForScope(formatColumn.Scope, api);
|
|
33
|
+
if (formatType === 'number') {
|
|
34
|
+
return DEFAULT_DOUBLE_DISPLAY_VALUE;
|
|
35
|
+
}
|
|
36
|
+
if (formatType === 'date') {
|
|
37
|
+
return getFormatColumnPreviewDateSampleText();
|
|
38
|
+
}
|
|
39
|
+
return DEFAULT_STRING_DISPLAY_VALUE;
|
|
40
|
+
};
|
|
41
|
+
export const getFormatColumnPreviewText = (formatColumn, api) => {
|
|
42
|
+
const sample = getFormatColumnPreviewSampleValue(formatColumn, api);
|
|
43
|
+
const resolved = resolveDisplayFormat(formatColumn.DisplayFormat);
|
|
44
|
+
if (!resolved) {
|
|
45
|
+
return String(sample);
|
|
46
|
+
}
|
|
47
|
+
if (resolved.Formatter === 'NumberFormatter' && typeof sample === 'number') {
|
|
48
|
+
return FormatHelper.NumberFormatter(sample, resolved.Options) ?? String(sample);
|
|
49
|
+
}
|
|
50
|
+
if (resolved.Formatter === 'DateFormatter') {
|
|
51
|
+
return FormatHelper.DateFormatter(new Date(), resolved.Options) ?? String(sample);
|
|
52
|
+
}
|
|
53
|
+
if (resolved.Formatter === 'StringFormatter' && typeof sample === 'string') {
|
|
54
|
+
return FormatHelper.StringFormatter(sample, resolved.Options) ?? sample;
|
|
55
|
+
}
|
|
56
|
+
return String(sample);
|
|
57
|
+
};
|
|
58
|
+
export const FormatColumnPreviewContent = ({ formatColumn, api }) => (_jsx(Box, { className: "ab-FormatPreview twa:p-2 twa:inline-block", style: toFormatColumnPreviewStyle(formatColumn), children: getFormatColumnPreviewText(formatColumn, api) }));
|
|
59
|
+
export const renderFormatColumnPreviewSummary = (formatColumn, api) => _jsx(FormatColumnPreviewContent, { formatColumn: formatColumn, api: api });
|
|
60
|
+
export const FormatColumnPreview = () => {
|
|
61
|
+
const { data, api } = useOnePageAdaptableWizardContext();
|
|
62
|
+
return _jsx(FormatColumnPreviewContent, { formatColumn: data, api: api });
|
|
63
|
+
};
|
|
64
|
+
export const FormatColumnPreviewSummaryCard = () => {
|
|
65
|
+
return (_jsxs(Card, { shadow: false, children: [_jsx(Card.Title, { children: _jsx(Box, { className: "twa:font-medium", children: "Preview" }) }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(FormatColumnPreview, {}) })] }));
|
|
66
|
+
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FormatColumn } from '../../../../types';
|
|
3
|
+
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
3
4
|
type FormatColumnRuleWizardSectionProps = {
|
|
4
5
|
onChange: (data: FormatColumn) => void;
|
|
5
6
|
defaultPredicateId: string;
|
|
6
7
|
};
|
|
8
|
+
export declare const hasFormatColumnCondition: (formatColumn: FormatColumn) => boolean;
|
|
9
|
+
export declare const renderFormatColumnConditionSummary: (formatColumn: FormatColumn, api: AdaptableApi) => React.JSX.Element;
|
|
10
|
+
export declare const renderFormatColumnConditionWizardSummary: (formatColumn: FormatColumn) => React.JSX.Element;
|
|
7
11
|
export declare function FormatColumnRuleWizardSection(props: FormatColumnRuleWizardSectionProps): React.JSX.Element;
|
|
8
12
|
export {};
|
|
@@ -2,6 +2,36 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
3
3
|
import { EntityRulesEditor } from '../../Components/EntityRulesEditor';
|
|
4
4
|
import HelpBlock from '../../../components/HelpBlock';
|
|
5
|
+
import { Box } from '../../../components/Flex';
|
|
6
|
+
import { Tag } from '../../../components/Tag';
|
|
7
|
+
export const hasFormatColumnCondition = (formatColumn) => {
|
|
8
|
+
const rule = formatColumn.Rule;
|
|
9
|
+
if (!rule) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return Boolean(rule.Predicates?.length ||
|
|
13
|
+
rule.BooleanExpression ||
|
|
14
|
+
('ObservableExpression' in rule && rule.ObservableExpression) ||
|
|
15
|
+
('AggregatedBooleanExpression' in rule && rule.AggregatedBooleanExpression));
|
|
16
|
+
};
|
|
17
|
+
export const renderFormatColumnConditionSummary = (formatColumn, api) => {
|
|
18
|
+
if (formatColumn.Target === 'columnHeader') {
|
|
19
|
+
return _jsx(Tag, { children: "No Condition" });
|
|
20
|
+
}
|
|
21
|
+
if (!hasFormatColumnCondition(formatColumn)) {
|
|
22
|
+
return _jsx(Tag, { children: "No Condition" });
|
|
23
|
+
}
|
|
24
|
+
const rule = formatColumn.Rule;
|
|
25
|
+
if (rule?.Predicates?.length) {
|
|
26
|
+
return (_jsx(Box, { className: "twa:flex twa:flex-col twa:gap-2", children: rule.Predicates.map((predicate, index) => (_jsx(Tag, { children: api.predicateApi.predicateToString(predicate) }, index))) }));
|
|
27
|
+
}
|
|
28
|
+
const expressionText = api.internalApi.getAdaptableQueryExpressionText(rule);
|
|
29
|
+
return _jsx(Tag, { children: expressionText || 'No Condition' });
|
|
30
|
+
};
|
|
31
|
+
export const renderFormatColumnConditionWizardSummary = (formatColumn) => {
|
|
32
|
+
const { api } = useOnePageAdaptableWizardContext();
|
|
33
|
+
return renderFormatColumnConditionSummary(formatColumn, api);
|
|
34
|
+
};
|
|
5
35
|
export function FormatColumnRuleWizardSection(props) {
|
|
6
36
|
const { data, api, moduleInfo } = useOnePageAdaptableWizardContext();
|
|
7
37
|
if (data.Target && data.Target === 'columnHeader') {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { NewScopeComponent
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { NewScopeComponent } from '../../Components/NewScopeComponent';
|
|
3
3
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
4
|
+
import { useAdaptable } from '../../AdaptableContext';
|
|
5
|
+
import { getColumnTypeFriendlyName } from '../../../AdaptableState/Common/AdaptableColumn';
|
|
4
6
|
import { isScopeColumnIds } from '../../../AdaptableState/Common/ColumnScope';
|
|
5
7
|
import { Box, Flex } from '../../../components/Flex';
|
|
6
8
|
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
@@ -29,15 +31,18 @@ const isRowKindIncluded = (data, kind) => {
|
|
|
29
31
|
const collectIncludedRowKinds = (data) => {
|
|
30
32
|
return FORMAT_COLUMN_ROW_KINDS.filter((k) => isRowKindIncluded(data, k));
|
|
31
33
|
};
|
|
32
|
-
|
|
34
|
+
const FormatColumnScopeSummaryContent = ({ data, }) => {
|
|
35
|
+
const adaptable = useAdaptable();
|
|
36
|
+
const scopeApi = adaptable.api.columnScopeApi;
|
|
37
|
+
const scope = data.Scope;
|
|
38
|
+
const columnsInScope = scopeApi.getColumnsInScope(scope);
|
|
33
39
|
const showRows = data.Target === 'cell';
|
|
34
40
|
const includedKinds = collectIncludedRowKinds(data);
|
|
35
41
|
const allKinds = includedKinds.length === 4;
|
|
36
|
-
return (_jsxs(Box, { className: "twa:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}) }), showRows && (_jsxs(Box, { className: "twa:mt-3", children: ["Rows:", ' ', allKinds ? (_jsx(Tag, { children: "All" })) : includedKinds.length === 0 ? (_jsx(Tag, { children: "None" })) : (includedKinds.map((k) => (_jsx(Tag, { className: "twa:mr-1", children: k }, k))))] }))] }));
|
|
42
|
+
return (_jsxs(Box, { className: "twa:flex twa:flex-col twa:gap-3", children: [_jsx(Box, { children: scopeApi.scopeIsAll(scope) ? (_jsxs(_Fragment, { children: ["Columns ", _jsx(Tag, { children: "All" })] })) : 'ColumnIds' in scope ? (_jsxs(_Fragment, { children: ["Columns", ' ', columnsInScope.length ? (columnsInScope.map((column) => (_jsx(Tag, { className: "twa:mr-1", children: column.friendlyName }, column.columnId)))) : (_jsx(Tag, { children: "None" }))] })) : 'DataTypes' in scope ? (_jsxs(_Fragment, { children: ["Data Types", ' ', scope.DataTypes.length ? (scope.DataTypes.map((dataType) => (_jsx(Tag, { className: "twa:mr-1", children: getColumnTypeFriendlyName(dataType) }, dataType)))) : (_jsx(Tag, { children: "None" }))] })) : null }), showRows && (_jsxs(Box, { children: ["Rows", ' ', allKinds ? (_jsx(Tag, { children: "All" })) : includedKinds.length === 0 ? (_jsx(Tag, { children: "None" })) : (includedKinds.map((k) => (_jsx(Tag, { className: "twa:mr-1", children: k }, k))))] }))] }));
|
|
43
|
+
};
|
|
44
|
+
export const renderFormatColumnScopeSummary = (data) => {
|
|
45
|
+
return _jsx(FormatColumnScopeSummaryContent, { data: data });
|
|
41
46
|
};
|
|
42
47
|
// ---------------------------------------------------------------------------
|
|
43
48
|
// Section
|
|
@@ -8,7 +8,7 @@ import { Card } from '../../../components/Card';
|
|
|
8
8
|
import Input from '../../../components/Input';
|
|
9
9
|
import { TypeRadio } from '../../Wizard/TypeRadio';
|
|
10
10
|
export const renderFormatColumnSettingsSummary = (data) => {
|
|
11
|
-
return (_jsxs(
|
|
11
|
+
return (_jsxs(Flex, { flexWrap: "wrap", alignItems: "center", className: "twa:gap-x-4 twa:gap-y-2", children: [_jsxs(Box, { children: ["Name ", _jsx(Tag, { children: data.Name })] }), _jsxs(Box, { children: ["Target", ' ', _jsx(Tag, { children: !data.Target || data.Target === 'cell' ? 'Column Cells' : 'Column Header' })] }), _jsxs(Box, { children: ["Column Groups", ' ', _jsx(Tag, { children: !data.ColumnGroupScope || data.ColumnGroupScope === 'Both'
|
|
12
12
|
? 'Always'
|
|
13
13
|
: data.ColumnGroupScope })] })] }));
|
|
14
14
|
};
|
|
@@ -5,7 +5,9 @@ export declare const isFormatColumnStyleValid: (data: FormatColumn, api: Adaptab
|
|
|
5
5
|
type FormatColumnStyleWizardSectionProps = {
|
|
6
6
|
onChange: (data: FormatColumn) => void;
|
|
7
7
|
};
|
|
8
|
+
export declare const hasFormatColumnStyle: (formatColumn: FormatColumn) => boolean;
|
|
9
|
+
export declare const getFormatColumnStyleViewValues: (formatColumn: FormatColumn) => string[];
|
|
8
10
|
export declare const renderFormatColumnStyleWizardSummary: (data: FormatColumn) => React.JSX.Element;
|
|
9
|
-
export declare const renderFormatColumnStyleSummary: (data: FormatColumn,
|
|
11
|
+
export declare const renderFormatColumnStyleSummary: (data: FormatColumn, _api: AdaptableApi) => React.JSX.Element;
|
|
10
12
|
export declare function FormatColumnStyleWizardSection(props: FormatColumnStyleWizardSectionProps): React.JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { convertAdaptableStyleToCSS } from '../../../Utilities/Helpers/StyleHelper';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { StyleComponent } from '../../Components/StyleComponent';
|
|
4
3
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
5
4
|
import UIHelper from '../../UIHelper';
|
|
5
|
+
import StringExtensions from '../../../Utilities/Extensions/StringExtensions';
|
|
6
6
|
import { Box } from '../../../components/Flex';
|
|
7
|
+
import { Tag } from '../../../components/Tag';
|
|
8
|
+
import { getFormatColumnStylePreviewText } from './FormatColumnPreview';
|
|
7
9
|
export const isFormatColumnStyleValid = (data, api) => {
|
|
8
10
|
if (data.Style &&
|
|
9
11
|
UIHelper.IsEmptyStyle(data.Style) &&
|
|
@@ -13,25 +15,72 @@ export const isFormatColumnStyleValid = (data, api) => {
|
|
|
13
15
|
}
|
|
14
16
|
return true;
|
|
15
17
|
};
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
18
|
+
const getFormatColumnStyleSummaryItems = (formatColumn) => {
|
|
19
|
+
const style = formatColumn.Style;
|
|
20
|
+
if (!style) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
if (StringExtensions.IsNotNullOrEmpty(style.ClassName)) {
|
|
24
|
+
return [{ label: 'Class Name', value: style.ClassName }];
|
|
25
|
+
}
|
|
26
|
+
const items = [];
|
|
27
|
+
if (style.BackColor) {
|
|
28
|
+
items.push({ label: 'Back Colour', value: style.BackColor });
|
|
29
|
+
}
|
|
30
|
+
if (style.ForeColor) {
|
|
31
|
+
items.push({ label: 'Fore Colour', value: style.ForeColor });
|
|
32
|
+
}
|
|
33
|
+
if (style.BorderColor) {
|
|
34
|
+
items.push({ label: 'Border Colour', value: style.BorderColor });
|
|
35
|
+
}
|
|
36
|
+
if (style.BorderRadius != null) {
|
|
37
|
+
items.push({ label: 'Border Radius', value: String(style.BorderRadius) });
|
|
38
|
+
}
|
|
39
|
+
if (style.FontWeight === 'Bold') {
|
|
40
|
+
items.push({ label: 'Font Weight', value: 'Bold' });
|
|
41
|
+
}
|
|
42
|
+
if (style.FontStyle === 'Italic') {
|
|
43
|
+
items.push({ label: 'Font Style', value: 'Italic' });
|
|
44
|
+
}
|
|
45
|
+
if (style.TextDecoration && style.TextDecoration !== 'None') {
|
|
46
|
+
items.push({ label: 'Text Decoration', value: style.TextDecoration });
|
|
47
|
+
}
|
|
48
|
+
if (style.FontSize) {
|
|
49
|
+
items.push({ label: 'Font Size', value: style.FontSize });
|
|
50
|
+
}
|
|
51
|
+
if (style.Alignment && style.Alignment !== 'Default') {
|
|
52
|
+
items.push({ label: 'Alignment', value: style.Alignment });
|
|
53
|
+
}
|
|
54
|
+
return items;
|
|
55
|
+
};
|
|
56
|
+
export const hasFormatColumnStyle = (formatColumn) => {
|
|
57
|
+
if (formatColumn.Style == null || UIHelper.IsEmptyStyle(formatColumn.Style)) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return getFormatColumnStyleSummaryItems(formatColumn).length > 0;
|
|
61
|
+
};
|
|
62
|
+
export const getFormatColumnStyleViewValues = (formatColumn) => {
|
|
63
|
+
return getFormatColumnStyleSummaryItems(formatColumn).map(({ label, value }) => `${label}: ${value}`);
|
|
24
64
|
};
|
|
25
65
|
export const renderFormatColumnStyleWizardSummary = (data) => {
|
|
26
66
|
const { api } = useOnePageAdaptableWizardContext();
|
|
27
67
|
return renderFormatColumnStyleSummary(data, api);
|
|
28
68
|
};
|
|
29
|
-
export const renderFormatColumnStyleSummary = (data,
|
|
30
|
-
|
|
69
|
+
export const renderFormatColumnStyleSummary = (data, _api) => {
|
|
70
|
+
const hasStyle = data.Style != null && UIHelper.IsNotEmptyStyle(data.Style);
|
|
71
|
+
if (!hasStyle) {
|
|
72
|
+
return _jsx(Tag, { children: "No Style" });
|
|
73
|
+
}
|
|
74
|
+
const items = getFormatColumnStyleSummaryItems(data);
|
|
75
|
+
if (!items.length) {
|
|
76
|
+
return _jsx(Tag, { children: "No Style" });
|
|
77
|
+
}
|
|
78
|
+
return (_jsx(Box, { className: "twa:grid twa:grid-cols-2 twa:gap-2", children: items.map(({ label, value }) => (_jsxs(Box, { children: [label, " ", _jsx(Tag, { children: value })] }, label))) }));
|
|
31
79
|
};
|
|
32
80
|
export function FormatColumnStyleWizardSection(props) {
|
|
33
81
|
const { data, api } = useOnePageAdaptableWizardContext();
|
|
34
|
-
|
|
82
|
+
const previewText = getFormatColumnStylePreviewText(data, api);
|
|
83
|
+
return (_jsx(StyleComponent, { headless: true, api: api, previewText: previewText, Style: data.Style ?? {}, UpdateStyle: (Style) => {
|
|
35
84
|
props.onChange({ ...data, Style });
|
|
36
85
|
} }));
|
|
37
86
|
}
|
|
@@ -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 { useState } from 'react';
|
|
4
4
|
import { OnePageAdaptableWizard, OnePageWizardSummary } from '../../Wizard/OnePageAdaptableWizard';
|
|
@@ -15,11 +15,12 @@ import { useDispatch } from 'react-redux';
|
|
|
15
15
|
import * as FormatColumnRedux from '../../../Redux/ActionsReducers/FormatColumnRedux';
|
|
16
16
|
import { ObjectTagsWizardSection, renderObjectTagsSummary, } from '../../Wizard/ObjectTagsWizardSection';
|
|
17
17
|
import { isAdaptableRuleValid } from '../../Components/EntityRulesEditor/Utilities';
|
|
18
|
-
import { FormatColumnRuleWizardSection } from './FormatColumnRuleWizardSection';
|
|
18
|
+
import { FormatColumnRuleWizardSection, renderFormatColumnConditionWizardSummary } from './FormatColumnRuleWizardSection';
|
|
19
19
|
import { DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN } from './constants';
|
|
20
20
|
import { isObjectEmpty } from '../../../Utilities/Extensions/ObjectExtensions';
|
|
21
21
|
import { isAdaptableNumericFormatPreset, } from '../../../AdaptableState/Common/AdaptableFormatPresets';
|
|
22
22
|
import { Box, Flex } from '../../../components/Flex';
|
|
23
|
+
import { FormatColumnPreviewSummaryCard } from './FormatColumnPreview';
|
|
23
24
|
const adjustDisplayFormat = (fc, api) => {
|
|
24
25
|
const formatColumn = { ...fc };
|
|
25
26
|
let formatDataType = getFormatDisplayTypeForScope(formatColumn.Scope, api);
|
|
@@ -153,6 +154,7 @@ export function FormatColumnWizard(props) {
|
|
|
153
154
|
},
|
|
154
155
|
title: 'Condition',
|
|
155
156
|
details: 'Build a Rule when the Format Column should be applied',
|
|
157
|
+
renderSummary: renderFormatColumnConditionWizardSummary,
|
|
156
158
|
render: () => {
|
|
157
159
|
return (_jsx(FormatColumnRuleWizardSection, { onChange: setFormatColumn, defaultPredicateId: DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN }));
|
|
158
160
|
},
|
|
@@ -185,7 +187,7 @@ export function FormatColumnWizard(props) {
|
|
|
185
187
|
{
|
|
186
188
|
details: 'Review the Format Column',
|
|
187
189
|
render: () => {
|
|
188
|
-
return (
|
|
190
|
+
return (_jsxs(Box, { className: "twa:p-2 twa:flex twa:flex-col twa:gap-3", children: [_jsx(OnePageWizardSummary, {}), _jsx(FormatColumnPreviewSummaryCard, {})] }));
|
|
189
191
|
},
|
|
190
192
|
title: 'Summary',
|
|
191
193
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const getFreeTextColumnSettingsTags = (settings) => {
|
|
2
|
+
const { DataType, Width, Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable } = settings ?? {};
|
|
3
|
+
const colTypes = settings?.ColumnTypes ? settings.ColumnTypes.join(', ') : '';
|
|
4
|
+
return [
|
|
5
|
+
DataType ? `DataType: ${DataType}` : null,
|
|
6
|
+
Width ? `Width: ${Width}px` : null,
|
|
7
|
+
Pivotable ? 'Pivotable' : null,
|
|
8
|
+
Filterable ? 'Filterable' : null,
|
|
9
|
+
Resizable ? 'Resizable' : null,
|
|
10
|
+
Groupable ? 'Groupable' : null,
|
|
11
|
+
Sortable ? 'Sortable' : null,
|
|
12
|
+
Aggregatable ? 'Aggregatable' : null,
|
|
13
|
+
colTypes ? `Column Types: ${colTypes}` : null,
|
|
14
|
+
].filter(Boolean);
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FreeTextColumn } from '../../../AdaptableState/FreeTextColumnState';
|
|
3
|
+
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
4
|
+
export type FreeTextColumnDefinitionWizardSectionProps = {
|
|
5
|
+
onChange: (data: FreeTextColumn) => void;
|
|
6
|
+
isEdit: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const renderFreeTextColumnDefinitionSummary: (data: FreeTextColumn) => React.JSX.Element;
|
|
9
|
+
export declare const isValidFreeTextColumnDefinition: (data: FreeTextColumn, api: AdaptableApi) => true | string;
|
|
10
|
+
export declare const FreeTextColumnDefinitionWizardSection: (props: FreeTextColumnDefinitionWizardSectionProps) => React.JSX.Element;
|