@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
|
@@ -4,7 +4,7 @@ import { Icon } from '../../components/icons';
|
|
|
4
4
|
export class ModuleProfile extends React.Component {
|
|
5
5
|
render() {
|
|
6
6
|
return (_jsxs("div", { children: [_jsx(Icon, { name: this.props.moduleInfo.Glyph, style: {
|
|
7
|
-
fill: 'var(--ab-color-
|
|
7
|
+
fill: 'var(--ab-color-primary-foreground)',
|
|
8
8
|
} }), ' ', this.props.moduleInfo.FriendlyName] }));
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { WindowPopupChildProps } from './WindowPopups';
|
|
2
2
|
export declare const WINDOW_GRID_FILTER_EDITOR = "WINDOW_GRID_FILTER_EDITOR";
|
|
3
3
|
export declare const SHOW_PIVOT_COLUMN_DETAILS = "SHOW_PIVOT_COLUMN_DETAILS";
|
|
4
|
-
export declare const SHOW_THEME_EDITOR = "SHOW_THEME_EDITOR";
|
|
5
4
|
export declare const WINDOW_SHOW_TRANSPOSED_VIEW = "WINDOW_SHOW_TRANSPOSED_VIEW";
|
|
6
5
|
export declare const COLUMN_FILTER_WINDOW = "COLUMN_FILTER_WINDOW";
|
|
7
6
|
export declare const windowFactory: Record<string, React.FunctionComponent<WindowPopupChildProps>>;
|
|
@@ -4,7 +4,6 @@ import { TransposedPopup } from '../../../Layout/TransposedPopup';
|
|
|
4
4
|
import { ColumnFilterWindow } from '../../ColumnFilter/ColumnFilterWindow';
|
|
5
5
|
export const WINDOW_GRID_FILTER_EDITOR = 'WINDOW_GRID_FILTER_EDITOR';
|
|
6
6
|
export const SHOW_PIVOT_COLUMN_DETAILS = 'SHOW_PIVOT_COLUMN_DETAILS';
|
|
7
|
-
export const SHOW_THEME_EDITOR = 'SHOW_THEME_EDITOR';
|
|
8
7
|
export const WINDOW_SHOW_TRANSPOSED_VIEW = 'WINDOW_SHOW_TRANSPOSED_VIEW';
|
|
9
8
|
export const COLUMN_FILTER_WINDOW = 'COLUMN_FILTER_WINDOW';
|
|
10
9
|
export const windowFactory = {
|
|
@@ -14,7 +14,7 @@ export interface RangesComponentProps extends React.ClassAttributes<RangesCompon
|
|
|
14
14
|
minMaxRangeValues: {
|
|
15
15
|
min: number;
|
|
16
16
|
max: number;
|
|
17
|
-
};
|
|
17
|
+
} | null;
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
/**
|
|
20
20
|
* When true, the user may delete every band so `ranges` becomes `[]`.
|
|
@@ -45,7 +45,7 @@ export interface RangesComponentProps extends React.ClassAttributes<RangesCompon
|
|
|
45
45
|
showRangeDirection?: boolean;
|
|
46
46
|
}
|
|
47
47
|
export interface RangesComponentState {
|
|
48
|
-
rangesType: 'NumberRange' | 'PercentageRange' | 'ZeroCentred' | 'ColumnComparison';
|
|
48
|
+
rangesType: 'None' | 'NumberRange' | 'PercentageRange' | 'ZeroCentred' | 'ColumnComparison';
|
|
49
49
|
}
|
|
50
50
|
export declare class RangesComponent extends React.Component<RangesComponentProps, RangesComponentState> {
|
|
51
51
|
constructor(props: RangesComponentProps);
|
|
@@ -60,6 +60,11 @@ export declare class RangesComponent extends React.Component<RangesComponentProp
|
|
|
60
60
|
setRangeColMin(range: CellColorRange): void;
|
|
61
61
|
setRangeColMax(range: CellColorRange): void;
|
|
62
62
|
addRange(): void;
|
|
63
|
+
/**
|
|
64
|
+
* When there is exactly one band spanning the full scale (Col-Min→Col-Max or
|
|
65
|
+
* 0→100), split at the midpoint instead of at the column maximum.
|
|
66
|
+
*/
|
|
67
|
+
private splitFullSpanRangeAtMidpoint;
|
|
63
68
|
changeColumnComparisonMinValue(value: number): void;
|
|
64
69
|
private onMinColumnSelectedChanged;
|
|
65
70
|
changeColumnComparisonMaxValue(value: number): void;
|
|
@@ -15,14 +15,16 @@ const DEFAULT_ZERO_CENTRED_COLORS = {
|
|
|
15
15
|
NegativeColor: 'rgba(220, 53, 69, 0.55)',
|
|
16
16
|
PositiveColor: 'rgba(40, 167, 69, 0.55)',
|
|
17
17
|
};
|
|
18
|
+
const hasConfiguredRanges = (ranges) => (ranges?.length ?? 0) > 0;
|
|
18
19
|
/**
|
|
19
|
-
* Decide which
|
|
20
|
+
* Decide which range tab should be active given the current props.
|
|
20
21
|
*
|
|
21
22
|
* Precedence:
|
|
22
23
|
* 1. `columnComparison` set → Column Comparison tab
|
|
23
24
|
* 2. Zero Centred set + supported → Zero Centred tab
|
|
24
|
-
* 3. `
|
|
25
|
-
* 4.
|
|
25
|
+
* 3. `allowEmptyRanges` + no bands → No Ranges tab
|
|
26
|
+
* 4. `rangeValueType === 'Percentage'` → Percentage Range tab
|
|
27
|
+
* 5. otherwise → Number Range tab (default for new styles)
|
|
26
28
|
*/
|
|
27
29
|
function deriveInitialRangesType(props) {
|
|
28
30
|
if (props.columnComparison) {
|
|
@@ -31,6 +33,9 @@ function deriveInitialRangesType(props) {
|
|
|
31
33
|
if (props.showZeroCentredTab && props.zeroCentred) {
|
|
32
34
|
return 'ZeroCentred';
|
|
33
35
|
}
|
|
36
|
+
if (props.allowEmptyRanges && !hasConfiguredRanges(props.ranges)) {
|
|
37
|
+
return 'None';
|
|
38
|
+
}
|
|
34
39
|
return props.rangeValueType === 'Percentage' ? 'PercentageRange' : 'NumberRange';
|
|
35
40
|
}
|
|
36
41
|
export class RangesComponent extends React.Component {
|
|
@@ -66,6 +71,7 @@ export class RangesComponent extends React.Component {
|
|
|
66
71
|
// vs Percentage Range tab) instead of an inline radio. The inner content
|
|
67
72
|
// is shared between the two range tabs and parameterised on this flag.
|
|
68
73
|
const isRangeValueTypeNumber = this.state.rangesType === 'NumberRange';
|
|
74
|
+
const renderNoneContent = () => (_jsx(Box, { className: "twa:text-2 twa:opacity-70 twa:py-2 twa:max-w-[520px]", children: "No coloured bands configured" }));
|
|
69
75
|
const renderRangesContent = () => (_jsxs(_Fragment, { children: [this.props.ranges?.map((range, index, list) => (_jsxs(Flex, { alignItems: "end", className: "twa:mb-2", "data-name": "percent-bar-range", children: [_jsxs(Flex, { flexDirection: "column", children: [isRangeValueTypeNumber && index === 0 && (_jsx(CheckBox, { onClick: () => this.setRangeColMin(range), checked: range.Min === 'Col-Min', className: "twa:mt-0 twa:mb-1 twa:text-3", disabled: this.props.disabled, children: "Col Min" })), _jsx(NumberInput, { disabled: this.props.disabled ||
|
|
70
76
|
range.Min === 'Col-Min' ||
|
|
71
77
|
(index === 0 && !isRangeValueTypeNumber), value: range.Min, onChange: (value) => {
|
|
@@ -97,7 +103,7 @@ export class RangesComponent extends React.Component {
|
|
|
97
103
|
const tabFlex = { flex: 1 };
|
|
98
104
|
const radioCls = 'twa:m-0 twa:align-baseline';
|
|
99
105
|
const renderTabRadio = (label, value) => (_jsx(Radio, { tabIndex: -1, className: radioCls, checked: this.state.rangesType === value, children: label }));
|
|
100
|
-
return (_jsxs(Tabs, { autoFocus: false, className: "twa:mt-2", value: this.state.rangesType, onValueChange: (v) => this.handleRangesModeTab(v), children: [_jsx(Tabs.Tab, { value: "NumberRange", style: tabFlex, children: renderTabRadio('Number Range', 'NumberRange') }), _jsx(Tabs.Tab, { value: "PercentageRange", style: tabFlex, children: renderTabRadio('Percentage Range', 'PercentageRange') }), this.props.showZeroCentredTab && (_jsx(Tabs.Tab, { value: "ZeroCentred", style: tabFlex, children: renderTabRadio('Zero Centred Range', 'ZeroCentred') })), !this.props.hideColumnComparison && (_jsx(Tabs.Tab, { value: "ColumnComparison", style: tabFlex, children: renderTabRadio('Column Comparison', 'ColumnComparison') })), _jsx(Tabs.Content, { value: "NumberRange", children: renderRangesContent() }), _jsx(Tabs.Content, { value: "PercentageRange", children: renderRangesContent() }), this.props.showZeroCentredTab && (_jsx(Tabs.Content, { value: "ZeroCentred", children: renderZeroCentredContent() })), !this.props.hideColumnComparison && (_jsx(Tabs.Content, { value: "ColumnComparison", children: renderColumnComparisonContent() }))] }));
|
|
106
|
+
return (_jsxs(Tabs, { autoFocus: false, className: "twa:mt-2", value: this.state.rangesType, onValueChange: (v) => this.handleRangesModeTab(v), children: [this.props.allowEmptyRanges && (_jsx(Tabs.Tab, { value: "None", style: tabFlex, children: renderTabRadio('No Ranges', 'None') })), _jsx(Tabs.Tab, { value: "NumberRange", style: tabFlex, children: renderTabRadio('Number Range', 'NumberRange') }), _jsx(Tabs.Tab, { value: "PercentageRange", style: tabFlex, children: renderTabRadio('Percentage Range', 'PercentageRange') }), this.props.showZeroCentredTab && (_jsx(Tabs.Tab, { value: "ZeroCentred", style: tabFlex, children: renderTabRadio('Zero Centred Range', 'ZeroCentred') })), !this.props.hideColumnComparison && (_jsx(Tabs.Tab, { value: "ColumnComparison", style: tabFlex, children: renderTabRadio('Column Comparison', 'ColumnComparison') })), this.props.allowEmptyRanges && (_jsx(Tabs.Content, { value: "None", children: renderNoneContent() })), _jsx(Tabs.Content, { value: "NumberRange", children: renderRangesContent() }), _jsx(Tabs.Content, { value: "PercentageRange", children: renderRangesContent() }), this.props.showZeroCentredTab && (_jsx(Tabs.Content, { value: "ZeroCentred", children: renderZeroCentredContent() })), !this.props.hideColumnComparison && (_jsx(Tabs.Content, { value: "ColumnComparison", children: renderColumnComparisonContent() }))] }));
|
|
101
107
|
}
|
|
102
108
|
componentDidUpdate(prevProps) {
|
|
103
109
|
const wasComparison = !!prevProps.columnComparison;
|
|
@@ -125,12 +131,31 @@ export class RangesComponent extends React.Component {
|
|
|
125
131
|
rangesType: this.props.rangeValueType === 'Percentage' ? 'PercentageRange' : 'NumberRange',
|
|
126
132
|
});
|
|
127
133
|
}
|
|
134
|
+
if (this.props.allowEmptyRanges) {
|
|
135
|
+
const hadRanges = hasConfiguredRanges(prevProps.ranges);
|
|
136
|
+
const hasRanges = hasConfiguredRanges(this.props.ranges);
|
|
137
|
+
if (!hadRanges && hasRanges && this.state.rangesType === 'None') {
|
|
138
|
+
this.setState({
|
|
139
|
+
rangesType: this.props.rangeValueType === 'Percentage' ? 'PercentageRange' : 'NumberRange',
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
else if (hadRanges &&
|
|
143
|
+
!hasRanges &&
|
|
144
|
+
this.state.rangesType !== 'ColumnComparison' &&
|
|
145
|
+
this.state.rangesType !== 'ZeroCentred') {
|
|
146
|
+
this.setState({ rangesType: 'None' });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
128
149
|
}
|
|
129
150
|
handleRangesModeTab(value) {
|
|
130
151
|
if (value === this.state.rangesType) {
|
|
131
152
|
return;
|
|
132
153
|
}
|
|
133
154
|
this.setState({ rangesType: value });
|
|
155
|
+
if (value === 'None') {
|
|
156
|
+
this.props.updateRanges([]);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
134
159
|
if (value === 'ColumnComparison') {
|
|
135
160
|
const columnComparison = {
|
|
136
161
|
Color: getGraySwatchColor(),
|
|
@@ -198,7 +223,9 @@ export class RangesComponent extends React.Component {
|
|
|
198
223
|
setRangeColMin(range) {
|
|
199
224
|
const newRanges = this.props.ranges.map((rangeItem) => {
|
|
200
225
|
if (rangeItem === range) {
|
|
201
|
-
let newMin = rangeItem.Min === 'Col-Min'
|
|
226
|
+
let newMin = rangeItem.Min === 'Col-Min'
|
|
227
|
+
? (this.props.minMaxRangeValues?.min ?? 0)
|
|
228
|
+
: 'Col-Min';
|
|
202
229
|
return {
|
|
203
230
|
...rangeItem,
|
|
204
231
|
Min: newMin,
|
|
@@ -232,32 +259,51 @@ export class RangesComponent extends React.Component {
|
|
|
232
259
|
const existingRanges = this.props.ranges ?? [];
|
|
233
260
|
if (existingRanges.length === 0) {
|
|
234
261
|
const isPercentage = this.props.rangeValueType === 'Percentage';
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
262
|
+
const seedRanges = this.props.allowEmptyRanges
|
|
263
|
+
? [
|
|
264
|
+
{
|
|
265
|
+
Min: isPercentage ? 0 : 'Col-Min',
|
|
266
|
+
Max: isPercentage ? 100 : 'Col-Max',
|
|
267
|
+
Color: getGraySwatchColor(),
|
|
268
|
+
},
|
|
269
|
+
]
|
|
270
|
+
: (() => {
|
|
271
|
+
const min = isPercentage ? 0 : this.props.minMaxRangeValues?.min ?? 0;
|
|
272
|
+
const max = isPercentage ? 100 : this.props.minMaxRangeValues?.max ?? 100;
|
|
273
|
+
const mid = Math.round((min + max) / 2);
|
|
274
|
+
return [
|
|
275
|
+
{
|
|
276
|
+
Min: isPercentage ? 0 : 'Col-Min',
|
|
277
|
+
Max: mid,
|
|
278
|
+
Color: 'rgba(128, 128, 128, 0.25)',
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
Min: mid,
|
|
282
|
+
Max: isPercentage ? 100 : 'Col-Max',
|
|
283
|
+
Color: 'rgba(128, 128, 128, 0.55)',
|
|
284
|
+
},
|
|
285
|
+
];
|
|
286
|
+
})();
|
|
250
287
|
this.props.updateRanges(seedRanges);
|
|
251
288
|
return;
|
|
252
289
|
}
|
|
290
|
+
// Splitting a single full-width band at the midpoint is easier to reason
|
|
291
|
+
// about than anchoring the break at the column maximum (e.g. tradeId 1–200 → 100).
|
|
292
|
+
if (existingRanges.length === 1) {
|
|
293
|
+
const splitAtMidpoint = this.splitFullSpanRangeAtMidpoint(existingRanges[0]);
|
|
294
|
+
if (splitAtMidpoint) {
|
|
295
|
+
this.props.updateRanges(splitAtMidpoint);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
253
299
|
const lastRange = existingRanges[existingRanges.length - 1];
|
|
254
300
|
let previousRange = lastRange;
|
|
255
301
|
let Min = null;
|
|
256
302
|
if (lastRange.Max === 'Col-Max') {
|
|
257
|
-
Min = this.props.minMaxRangeValues
|
|
303
|
+
Min = this.props.minMaxRangeValues?.max ?? 100;
|
|
258
304
|
previousRange = {
|
|
259
305
|
...previousRange,
|
|
260
|
-
Max: this.props.minMaxRangeValues
|
|
306
|
+
Max: this.props.minMaxRangeValues?.max ?? 100,
|
|
261
307
|
};
|
|
262
308
|
}
|
|
263
309
|
else {
|
|
@@ -271,6 +317,32 @@ export class RangesComponent extends React.Component {
|
|
|
271
317
|
const newRanges = [...existingRanges.slice(0, -1), previousRange, newRange];
|
|
272
318
|
this.props.updateRanges(newRanges);
|
|
273
319
|
}
|
|
320
|
+
/**
|
|
321
|
+
* When there is exactly one band spanning the full scale (Col-Min→Col-Max or
|
|
322
|
+
* 0→100), split at the midpoint instead of at the column maximum.
|
|
323
|
+
*/
|
|
324
|
+
splitFullSpanRangeAtMidpoint(onlyRange) {
|
|
325
|
+
const isPercentage = this.props.rangeValueType === 'Percentage';
|
|
326
|
+
if (isPercentage) {
|
|
327
|
+
if (onlyRange.Min !== 0 || onlyRange.Max !== 100) {
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
return [
|
|
331
|
+
{ ...onlyRange, Max: 50 },
|
|
332
|
+
{ Min: 50, Max: 100, Color: getGraySwatchColor() },
|
|
333
|
+
];
|
|
334
|
+
}
|
|
335
|
+
if (onlyRange.Min !== 'Col-Min' || onlyRange.Max !== 'Col-Max') {
|
|
336
|
+
return null;
|
|
337
|
+
}
|
|
338
|
+
const min = this.props.minMaxRangeValues?.min ?? 0;
|
|
339
|
+
const max = this.props.minMaxRangeValues?.max ?? 100;
|
|
340
|
+
const mid = Math.round((min + max) / 2);
|
|
341
|
+
return [
|
|
342
|
+
{ ...onlyRange, Max: mid },
|
|
343
|
+
{ Min: mid, Max: 'Col-Max', Color: getGraySwatchColor() },
|
|
344
|
+
];
|
|
345
|
+
}
|
|
274
346
|
changeColumnComparisonMinValue(value) {
|
|
275
347
|
const { columnComparison } = this.props;
|
|
276
348
|
columnComparison.MinValue = value;
|
|
@@ -15,6 +15,7 @@ export const ColumnSelector = function (props) {
|
|
|
15
15
|
return {
|
|
16
16
|
label,
|
|
17
17
|
textLabel,
|
|
18
|
+
tooltip: textLabel,
|
|
18
19
|
value: column.columnId,
|
|
19
20
|
};
|
|
20
21
|
})
|
|
@@ -31,7 +32,11 @@ export const ColumnSelector = function (props) {
|
|
|
31
32
|
virtualized: true,
|
|
32
33
|
items: options,
|
|
33
34
|
showClear: false,
|
|
35
|
+
showItemTooltip: true,
|
|
34
36
|
onValueChange: (colId) => {
|
|
37
|
+
if (colId === null) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
35
40
|
props.onChange(colId);
|
|
36
41
|
},
|
|
37
42
|
value: props.value,
|
|
@@ -187,5 +187,5 @@ export const StyleComponent = (props) => {
|
|
|
187
187
|
label: enumName,
|
|
188
188
|
value: enumName,
|
|
189
189
|
})),
|
|
190
|
-
], value: componentStyle.FontSize?.toString() ?? '', onValueChange: (value) => onFontSizeChange(value) }) }), _jsx("span", { children: "Alignment" }), _jsxs(ToggleGroup, { children: [_jsx(Toggle, { icon: "align-left", pressed: componentStyle.Alignment === 'Left', onPressedChange: (pressed) => pressed ? onAlignmentChange('Left') : onAlignmentChange('Default') }), _jsx(Toggle, { icon: "align-center", pressed: componentStyle.Alignment === 'Center', onPressedChange: (pressed) => pressed ? onAlignmentChange('Center') : onAlignmentChange('Default') }), _jsx(Toggle, { icon: "align-right", pressed: componentStyle.Alignment === 'Right', onPressedChange: (pressed) => pressed ? onAlignmentChange('Right') : onAlignmentChange('Default') })] })] }) }) })), !props.hidePreview && (_jsxs(Card, { shadow: false, children: [_jsx(Card.Title, { children: "Preview" }), _jsx(Card.Body, { className: "twa:grid twa:place-items-center", children: _jsx(Box, { className: "twa:p-2 twa:inline-block", children: _jsx(StylePreview, { className: "twa:mt-0", styleObject: componentStyle }) }) })] }))] }));
|
|
190
|
+
], value: componentStyle.FontSize?.toString() ?? '', onValueChange: (value) => onFontSizeChange(value) }) }), _jsx("span", { children: "Alignment" }), _jsxs(ToggleGroup, { children: [_jsx(Toggle, { icon: "align-left", pressed: componentStyle.Alignment === 'Left', onPressedChange: (pressed) => pressed ? onAlignmentChange('Left') : onAlignmentChange('Default') }), _jsx(Toggle, { icon: "align-center", pressed: componentStyle.Alignment === 'Center', onPressedChange: (pressed) => pressed ? onAlignmentChange('Center') : onAlignmentChange('Default') }), _jsx(Toggle, { icon: "align-right", pressed: componentStyle.Alignment === 'Right', onPressedChange: (pressed) => pressed ? onAlignmentChange('Right') : onAlignmentChange('Default') })] })] }) }) })), !props.hidePreview && (_jsxs(Card, { shadow: false, children: [_jsx(Card.Title, { children: "Preview" }), _jsx(Card.Body, { className: "twa:grid twa:place-items-center", children: _jsx(Box, { className: "twa:p-2 twa:inline-block", children: _jsx(StylePreview, { className: "twa:mt-0", styleObject: componentStyle, children: props.previewText }) }) })] }))] }));
|
|
191
191
|
};
|
|
@@ -46,40 +46,66 @@ export function ValueSelector(props) {
|
|
|
46
46
|
toIdentifier,
|
|
47
47
|
value,
|
|
48
48
|
});
|
|
49
|
-
const
|
|
50
|
-
|
|
49
|
+
const reorderEnabled = allowReorder !== false;
|
|
50
|
+
const commitSelection = useCallback((nextMap) => {
|
|
51
|
+
const newSelection = [...nextMap.keys()];
|
|
51
52
|
if (!newSelection.length && selectedOnly) {
|
|
52
53
|
setSelectedOnly(false);
|
|
53
54
|
}
|
|
54
|
-
onChange(newSelection,
|
|
55
|
-
}, [onChange, selectedOnly,
|
|
55
|
+
onChange(newSelection, nextMap);
|
|
56
|
+
}, [onChange, selectedOnly, setSelectedOnly]);
|
|
57
|
+
const updateSelection = useCallback((updater) => {
|
|
58
|
+
const nextMap = new Map(selectedMap);
|
|
59
|
+
updater(nextMap);
|
|
60
|
+
commitSelection(nextMap);
|
|
61
|
+
}, [commitSelection, selectedMap]);
|
|
62
|
+
const filteredOptions = useMemo(() => {
|
|
63
|
+
return options.filter((option) => {
|
|
64
|
+
let result = true;
|
|
65
|
+
if (filter) {
|
|
66
|
+
result = filter(option, searchInputValue);
|
|
67
|
+
}
|
|
68
|
+
result = result && (selectedOnly ? selectedMap.has(toIdentifier(option)) : true);
|
|
69
|
+
return result;
|
|
70
|
+
});
|
|
71
|
+
}, [filter, options, searchInputValue, selectedMap, selectedOnly, toIdentifier]);
|
|
72
|
+
const renderOptionRow = (option, index, reorderable, itemDomProps) => {
|
|
73
|
+
const identifier = toIdentifier(option);
|
|
74
|
+
const label = !reorderEnabled ? preparedToLabel(option) : null;
|
|
75
|
+
const { onPointerDown, className: itemClassName, ...restDomProps } = itemDomProps ?? {};
|
|
76
|
+
return (_jsx(Flex, { alignItems: "center", "data-index": index, "data-id": identifier, "data-name": "option", ...restDomProps, className: clsx('twa:bg-primary twa:text-primary-foreground twa:rounded-standard twa:p-2', {
|
|
77
|
+
'twa:mt-1': index,
|
|
78
|
+
'twa:mt-0': !index,
|
|
79
|
+
}, itemClassName, `${baseClassName}__option`), children: _jsxs(Flex, { flexDirection: "row", alignItems: "center", className: "twa:flex-1", children: [reorderable ? (_jsx(Box, { onPointerDown: onPointerDown, className: "twa:mr-3", children: _jsx(Icon, { name: "drag", style: { cursor: 'grab' } }) })) : null, singleSelect ? (_jsx(Radio, { checked: selectedMap.has(identifier), "data-name": identifier, onChange: (checked) => {
|
|
80
|
+
updateSelection((next) => {
|
|
81
|
+
next.clear();
|
|
82
|
+
if (checked) {
|
|
83
|
+
next.set(identifier, option);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}, children: label })) : (_jsx(CheckBox, { "data-name": identifier, disabled: disabled || (isOptionDisabled ? isOptionDisabled(option) : false), onChange: (checked) => {
|
|
87
|
+
updateSelection((next) => {
|
|
88
|
+
if (checked) {
|
|
89
|
+
next.set(identifier, option);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
next.delete(identifier);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}, checked: selectedMap.has(identifier), children: label })), _jsx(Box, { className: "twa:ml-2 twa:flex-1", children: reorderEnabled ? preparedToLabel(option) : null })] }) }));
|
|
96
|
+
};
|
|
56
97
|
const renderOption = (option, index) => {
|
|
57
98
|
const identifier = toIdentifier(option);
|
|
58
|
-
const label = !allowReorder ? preparedToLabel(option) : null;
|
|
59
99
|
const reorderable = typeof allowReorder === 'function' ? allowReorder(option) : allowReorder;
|
|
100
|
+
if (!reorderEnabled) {
|
|
101
|
+
return (_jsx(React.Fragment, { children: renderOptionRow(option, index, false) }, identifier));
|
|
102
|
+
}
|
|
60
103
|
return (_jsx(DragList.DraggableItem, { id: `${identifier}`, children: (itemDomProps) => {
|
|
61
104
|
const { onPointerDown, ...restDomProps } = itemDomProps;
|
|
62
|
-
return (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (checked) {
|
|
67
|
-
selectedMap.clear();
|
|
68
|
-
selectedMap.set(identifier, option);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
selectedMap.delete(identifier);
|
|
72
|
-
}
|
|
73
|
-
notifyChange();
|
|
74
|
-
}, children: label })) : (_jsx(CheckBox, { "data-name": identifier, disabled: disabled || (isOptionDisabled ? isOptionDisabled(option) : false), onChange: (checked) => {
|
|
75
|
-
if (checked) {
|
|
76
|
-
selectedMap.set(identifier, option);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
selectedMap.delete(identifier);
|
|
80
|
-
}
|
|
81
|
-
notifyChange();
|
|
82
|
-
}, checked: selectedMap.has(identifier), children: label })), _jsx(Box, { className: "twa:ml-2 twa:flex-1", children: allowReorder ? preparedToLabel(option) : null })] }) }));
|
|
105
|
+
return renderOptionRow(option, index, reorderable, {
|
|
106
|
+
onPointerDown: reorderable ? onPointerDown : undefined,
|
|
107
|
+
...restDomProps,
|
|
108
|
+
});
|
|
83
109
|
} }, identifier));
|
|
84
110
|
};
|
|
85
111
|
const showOnlySelectedCheckbox = (_jsx(CheckBox, { disabled: !value.length, checked: selectedOnly, onChange: setSelectedOnly, children: showSelectedOnlyLabel ?? 'Show Selected Only' }));
|
|
@@ -87,60 +113,47 @@ export function ValueSelector(props) {
|
|
|
87
113
|
...props,
|
|
88
114
|
showOnlySelectedCheckbox,
|
|
89
115
|
onSelectAll: () => {
|
|
90
|
-
|
|
91
|
-
|
|
116
|
+
updateSelection((next) => {
|
|
117
|
+
options.forEach((option) => {
|
|
118
|
+
next.set(toIdentifier(option), option);
|
|
119
|
+
});
|
|
92
120
|
});
|
|
93
|
-
notifyChange();
|
|
94
121
|
},
|
|
95
122
|
onClearOption: (id) => {
|
|
96
|
-
|
|
97
|
-
|
|
123
|
+
updateSelection((next) => {
|
|
124
|
+
next.delete(id);
|
|
125
|
+
});
|
|
98
126
|
},
|
|
99
127
|
onClear: () => {
|
|
100
|
-
|
|
101
|
-
|
|
128
|
+
updateSelection((next) => {
|
|
129
|
+
next.clear();
|
|
130
|
+
});
|
|
102
131
|
},
|
|
103
132
|
};
|
|
104
|
-
|
|
133
|
+
const optionList = (_jsx(Flex, { className: `${baseClassName}__body twa:flex-1 twa:overflow-auto`, flexDirection: "column", children: _jsx("div", { children: filteredOptions.map(renderOption) }) }));
|
|
134
|
+
return (_jsxs(Flex, { style: props.style, className: clsx('twa:flex-1', baseClassName), flexDirection: "column", children: [_jsx(Flex, { className: "twa:mb-1", children: showFilterInput && filter ? (_jsx(AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Type to search", inputClassName: "twa:p-3", className: "twa:flex-1 twa:m-[3px]" })) : (_jsx(Box, { className: "twa:flex-1" })) }), renderSelectionSection(selectionSectionProps), reorderEnabled ? (_jsx(DragDropProvider, { children: _jsx(Flex, { className: `${baseClassName}__body twa:flex-1 twa:overflow-auto`, flexDirection: "column", children: _jsx(DragList, { dragListId: "value-selector", orientation: "vertical", onDragProxyMove: defaultDragProxyMove, onDragProxySetup: ({ proxyElement }) => {
|
|
105
135
|
proxyElement.classList.add('twa:shadow-md');
|
|
106
136
|
}, onDrop: (_sortedIndexes) => {
|
|
107
137
|
const selection = [];
|
|
108
138
|
const extraKeys = [];
|
|
109
|
-
for (const [key,
|
|
110
|
-
if (
|
|
139
|
+
for (const [key, mapValue] of selectedMap) {
|
|
140
|
+
if (mapValue != null) {
|
|
111
141
|
selection.push(key);
|
|
112
142
|
}
|
|
113
143
|
else {
|
|
114
|
-
// null/non-existent keys have to be stored separately
|
|
115
144
|
extraKeys.push(key);
|
|
116
145
|
}
|
|
117
146
|
}
|
|
118
|
-
const clone = new Map(selectedMap);
|
|
119
|
-
// const newSelection: ID_TYPE[] = ArrayExtensions.reorderArray(
|
|
120
|
-
// selection,
|
|
121
|
-
// dragIndex,
|
|
122
|
-
// dropIndex
|
|
123
|
-
// );
|
|
124
147
|
const newSelection = _sortedIndexes
|
|
125
148
|
.map((index) => selection[index])
|
|
126
149
|
.filter((x) => x != null);
|
|
127
150
|
newSelection.push(...extraKeys);
|
|
128
|
-
|
|
151
|
+
const nextMap = new Map();
|
|
129
152
|
newSelection.forEach((key) => {
|
|
130
|
-
|
|
153
|
+
nextMap.set(key, selectedMap.get(key));
|
|
131
154
|
});
|
|
132
|
-
|
|
133
|
-
}, children: (listDomProps) =>
|
|
134
|
-
.filter((option) => {
|
|
135
|
-
let result = true;
|
|
136
|
-
if (filter) {
|
|
137
|
-
result = filter(option, searchInputValue);
|
|
138
|
-
}
|
|
139
|
-
result =
|
|
140
|
-
result && (selectedOnly ? selectedMap.has(toIdentifier(option)) : true);
|
|
141
|
-
return result;
|
|
142
|
-
})
|
|
143
|
-
.map(renderOption) })) }) }) })] }));
|
|
155
|
+
commitSelection(nextMap);
|
|
156
|
+
}, children: (listDomProps) => _jsx("div", { ...listDomProps, children: filteredOptions.map(renderOption) }) }) }) })) : (optionList)] }));
|
|
144
157
|
}
|
|
145
158
|
export const renderSelectionSection = (props) => {
|
|
146
159
|
const { value, options, disabled, singleSelect, toLabel, toIdentifier, } = props;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Tabs } from '../../../components/Tabs';
|
|
4
3
|
import { Tag } from '../../../components/Tag';
|
|
5
4
|
import { NewColumnSelector } from '../../Components/ColumnSelector';
|
|
6
5
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
7
6
|
import { Box, Flex } from '../../../components/Flex';
|
|
8
|
-
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
9
7
|
import Input from '../../../components/Input';
|
|
10
8
|
import { AdaptableFormControlTextClear } from '../../Components/Forms/AdaptableFormControlTextClear';
|
|
9
|
+
import { Card } from '../../../components/Card';
|
|
11
10
|
export const renderCustomSortColumn = (data) => {
|
|
12
11
|
const { api } = useOnePageAdaptableWizardContext();
|
|
13
12
|
return (_jsxs(Box, { className: "twa:text-2 twa:py-2 twa:pr-2", children: [_jsxs(Tag, { className: "twa:mr-2", children: ["Name: ", data.Name] }), _jsxs(Tag, { children: ["Column: ", api.columnApi.getFriendlyNameForColumnId(data.ColumnId)] })] }));
|
|
@@ -28,16 +27,12 @@ export const CustomSortColumnWizardSection = (props) => {
|
|
|
28
27
|
const { data, api } = useOnePageAdaptableWizardContext();
|
|
29
28
|
const sortableCols = React.useMemo(() => {
|
|
30
29
|
const sortableColumns = api.columnApi.getSortableColumns();
|
|
31
|
-
const nonComparerSortableColumns = sortableColumns.filter((c) => {
|
|
32
|
-
return api.customSortApi.internalApi.columnHasCustomSortComparer(c.columnId);
|
|
33
|
-
});
|
|
34
30
|
const customSorts = api.customSortApi.getCustomSorts();
|
|
35
31
|
const columnSortComparers = api.optionsApi.getCustomSortOptions().customSortComparers || [];
|
|
36
32
|
const usedColumnIds = [
|
|
37
33
|
...customSorts.map((customSort) => customSort.ColumnId),
|
|
38
34
|
...columnSortComparers.map((comparer) => api.columnScopeApi.getColumnIdsInScope(comparer.scope)),
|
|
39
35
|
];
|
|
40
|
-
// filter out used colum ids, but include the current one
|
|
41
36
|
return sortableColumns.filter((column) => {
|
|
42
37
|
if (api.customSortApi.internalApi.columnHasCustomSortComparer(column.columnId)) {
|
|
43
38
|
return false;
|
|
@@ -57,11 +52,11 @@ export const CustomSortColumnWizardSection = (props) => {
|
|
|
57
52
|
Name: event.target.value,
|
|
58
53
|
});
|
|
59
54
|
};
|
|
60
|
-
return (_jsxs(Flex, { flexDirection: "column",
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
return (_jsxs(Flex, { flexDirection: "column", className: "twa:h-full", children: [_jsx(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3 twa:shrink-0", children: _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Name" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Provide a unique name for the Custom Sort" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { className: "twa:max-w-[300px] twa:w-full", "data-name": "custom-sort-name", onChange: onNameChange, value: data?.Name ?? '' }) })] }) }), _jsxs(Flex, { flexDirection: "column", className: "twa:flex-1 twa:min-h-0", children: [_jsxs(Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:mb-2 twa:border-b-foreground/20", children: [_jsx(Box, { className: "twa:text-5 twa:font-medium", children: "Column" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:max-w-[520px]", children: "Select the column to apply the Custom Sort to" })] }), _jsx(Flex, { flexDirection: "row", alignItems: "center", className: "twa:px-2 twa:pb-2 twa:gap-2", children: _jsx(AdaptableFormControlTextClear, { value: columnsSearchText, OnTextChange: setColumnsSearchText, placeholder: "Type to search columns", className: "twa:flex-1" }) }), _jsx(Box, { className: "twa:flex-1 twa:min-h-0 twa:overflow-auto twa:px-2 twa:pb-2", children: _jsx(NewColumnSelector, { columnFilterText: columnsSearchText, availableColumns: sortableCols, selected: data.ColumnId ? [data.ColumnId] : [], singleSelect: true, onChange: (ids) => {
|
|
56
|
+
props.onChange({
|
|
57
|
+
...data,
|
|
58
|
+
SortedValues: [],
|
|
59
|
+
ColumnId: ids[0],
|
|
60
|
+
});
|
|
61
|
+
}, allowReorder: false }) })] })] }));
|
|
67
62
|
};
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useMemo, useEffect, useState } from 'react';
|
|
4
4
|
import { Loader } from '../../../components/Loader';
|
|
5
|
-
import { Tabs } from '../../../components/Tabs';
|
|
6
5
|
import join from '../../../components/utils/join';
|
|
7
6
|
import { runIfNotResolvedIn } from '../../../Utilities/runIfNotResolvedIn';
|
|
8
7
|
import { ValueSelector } from '../../Components/ValueSelector';
|
|
@@ -10,6 +9,8 @@ import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableW
|
|
|
10
9
|
import ArrayExtensions from '../../.././Utilities/Extensions/ArrayExtensions';
|
|
11
10
|
import { parseToISO } from '../../../Utilities/Helpers/DateHelper';
|
|
12
11
|
import { TagList } from '../../../components/Tag';
|
|
12
|
+
import { Box, Flex } from '../../../components/Flex';
|
|
13
|
+
import { Card } from '../../../components/Card';
|
|
13
14
|
export const isValidCustomSortOrder = (data) => {
|
|
14
15
|
if (!data.SortedValues || !data.SortedValues.length) {
|
|
15
16
|
return 'At least one value is required for the Custom Sort order.';
|
|
@@ -27,7 +28,6 @@ export const CustomSortValuesWizardSection = (props) => {
|
|
|
27
28
|
useEffect(() => {
|
|
28
29
|
let isMounted = true;
|
|
29
30
|
(async () => {
|
|
30
|
-
// for sync and very fast resolving promises does not make sense to show a loader
|
|
31
31
|
setDistinctValues([]);
|
|
32
32
|
const newValues = (await runIfNotResolvedIn(api.gridApi.internalApi.getDistinctValuesForColumn(data.ColumnId), () => isMounted && setIsDistinctValuesLoading(true))) ?? [];
|
|
33
33
|
if (!isMounted) {
|
|
@@ -70,10 +70,10 @@ export const CustomSortValuesWizardSection = (props) => {
|
|
|
70
70
|
}, [allowReorder, distinctValues, data.SortedValues]);
|
|
71
71
|
const baseClassName = 'ab-CustomSortWizard__SortOrder';
|
|
72
72
|
const className = join(baseClassName, isDistinctValuesLoading && `${baseClassName}--loading`);
|
|
73
|
-
return (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
return (_jsx(Flex, { flexDirection: "column", className: "twa:h-full twa:p-3", children: _jsxs(Card, { shadow: false, className: join('twa:flex-1 twa:min-h-0', className), children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Sort Order" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Specify the custom sort order \u2014 drag selected items to modify order" })] }), _jsxs(Card.Body, { className: "twa:flex-1 twa:min-h-0", children: [isDistinctValuesLoading && _jsx(Loader, { children: "Loading" }), _jsx(ValueSelector, { toIdentifier: toIdentifier, toLabel: toLabel, options: options, value: data.SortedValues, allowReorder: allowReorder, onChange: (SortedValues) => {
|
|
74
|
+
props.onChange({
|
|
75
|
+
...data,
|
|
76
|
+
SortedValues,
|
|
77
|
+
});
|
|
78
|
+
} })] })] }) }));
|
|
79
79
|
};
|
|
@@ -193,7 +193,7 @@ const buildGridOptions = (mainAdaptableInstance, changeHistoryLog) => {
|
|
|
193
193
|
const mainPrimaryKeyColumnHeader = mainAdaptableInstance.api.columnApi.getPrimaryKeyColumn()?.friendlyName ?? 'Row ID';
|
|
194
194
|
const options = {
|
|
195
195
|
loading: false,
|
|
196
|
-
overlayNoRowsTemplate: '<div style="font-size: var(--ab-font-size-2);color: var(--ab-color-
|
|
196
|
+
overlayNoRowsTemplate: '<div style="font-size: var(--ab-font-size-2);color: var(--ab-color-primary-foreground);">No Data Changes</div>',
|
|
197
197
|
defaultColDef: {
|
|
198
198
|
floatingFilter: true,
|
|
199
199
|
filter: true,
|