@adaptabletools/adaptable-cjs 23.0.0-canary.4 → 23.0.0-canary.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +117 -62
- package/package.json +9 -4
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
- package/src/AdaptableState/Common/AggregationColumns.js +30 -3
- package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
- package/src/AdaptableState/Common/Enums.d.ts +5 -5
- package/src/AdaptableState/Common/Enums.js +4 -4
- package/src/AdaptableState/PlusMinusState.d.ts +3 -3
- package/src/AdaptableState/ShortcutState.d.ts +2 -6
- package/src/AdaptableState/StyledColumnState.d.ts +3 -5
- package/src/AdaptableState/ThemeState.d.ts +33 -28
- package/src/Api/EventApi.d.ts +14 -1
- package/src/Api/Events/ThemeChanged.d.ts +6 -0
- package/src/Api/Events/ThemeSelected.d.ts +11 -0
- package/src/Api/Events/ThemeSelected.js +2 -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 +19 -8
- package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
- package/src/Api/Implementation/ThemeApiImpl.js +19 -15
- package/src/Api/Internal/EventInternalApi.d.ts +2 -0
- package/src/Api/Internal/EventInternalApi.js +8 -1
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
- package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
- package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
- package/src/Api/Internal/ThemeInternalApi.js +0 -10
- package/src/Api/LayoutApi.d.ts +1 -8
- package/src/Api/ThemeApi.d.ts +6 -2
- package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
- package/src/Strategy/FormatColumnModule.js +12 -5
- package/src/Strategy/LayoutModule.js +13 -8
- package/src/Strategy/StyledColumnModule.js +58 -30
- 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 +68 -0
- package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +212 -1
- package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
- package/src/Utilities/Helpers/ThemeHelpers.js +43 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.js +155 -0
- package/src/Utilities/ObjectFactory.d.ts +1 -3
- package/src/Utilities/ObjectFactory.js +0 -9
- package/src/Utilities/Services/ThemeService.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +113 -102
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +12 -13
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +54 -54
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +4 -3
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +29 -37
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +2 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +28 -15
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +2 -2
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +32 -41
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +26 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +9 -6
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +0 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +3 -1
- package/src/View/Components/ModuleProfile.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +1 -2
- package/src/View/Components/RangesComponent.d.ts +7 -2
- package/src/View/Components/RangesComponent.js +94 -22
- package/src/View/Components/StyleComponent.d.ts +1 -0
- package/src/View/Components/StyleComponent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +70 -57
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +5 -4
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +2 -1
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +4 -15
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -27
- package/src/View/Export/Wizard/ReportNameWizardSection.js +8 -11
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +19 -22
- package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
- package/src/View/Export/Wizard/ScheduledReportSettings.js +12 -12
- package/src/View/Export/Wizard/ScheduledReportWizard.js +2 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +19 -20
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +19 -3
- 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 +120 -13
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +78 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +34 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +11 -6
- 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 +64 -13
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -1
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +19 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +60 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +35 -70
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +14 -10
- 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 +116 -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 +10 -10
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -51
- 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 +3 -4
- 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 +7 -12
- 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 +45 -12
- package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +10 -17
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +5 -21
- 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 +10 -17
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +16 -5
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +2 -2
- package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
- package/src/View/Shortcut/shortcutOperations.js +32 -1
- package/src/View/SpecialColumnSettingsWizardStep.js +7 -6
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +26 -16
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +100 -15
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +48 -25
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +109 -33
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +20 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +124 -23
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +35 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +88 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +125 -35
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -74
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +20 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +6 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +11 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +20 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +32 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +64 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +35 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +96 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +57 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +66 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +133 -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 +53 -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 +6 -20
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
- package/src/agGrid/AdaptableAgGrid.js +34 -24
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +27 -17
- package/src/agGrid/AgGridColumnAdapter.js +9 -15
- package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
- package/src/agGrid/AgGridMenuAdapter.js +20 -37
- package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
- package/src/agGrid/buildValueAggregationMenuItem.js +114 -0
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
- package/src/agGrid/cellRenderers/IconRenderer.js +46 -17
- package/src/agGrid/createAgGridIcon.d.ts +10 -0
- package/src/agGrid/createAgGridIcon.js +19 -0
- package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/components/Input/NumberInput.js +1 -1
- package/src/components/Panel/index.js +1 -1
- package/src/components/SimpleButton/index.js +4 -4
- package/src/components/Toggle/Toggle.js +1 -1
- package/src/components/Toggle/ToggleGroup.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.js +2 -9
- package/src/metamodel/adaptable.metamodel.d.ts +39 -29
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +5 -4
- package/themes/dark.css +1 -68
- package/themes/light.css +1 -5
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
- package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -74
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -58
- package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
- package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -143
- package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
- package/src/Aggregation/parameterizedAggregationHeader.js +0 -65
- package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
- package/src/Aggregation/parameterizedAggregationHelpers.js +0 -121
- package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
- package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -74
- package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
- package/src/Aggregation/validateParameterizedAggregations.js +0 -25
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -48
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -32
- package/src/View/Theme/VariantSelector.d.ts +0 -8
- package/src/View/Theme/VariantSelector.js +0 -25
|
@@ -6,8 +6,8 @@ const Icon_1 = require("../components/Icon");
|
|
|
6
6
|
const icons_1 = require("../components/icons");
|
|
7
7
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
|
|
8
8
|
const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const buildValueAggregationMenuItem_1 = require("./buildValueAggregationMenuItem");
|
|
10
|
+
const createAgGridIcon_1 = require("./createAgGridIcon");
|
|
11
11
|
class AgGridMenuAdapter {
|
|
12
12
|
_adaptableInstance;
|
|
13
13
|
constructor(_adaptableInstance) {
|
|
@@ -59,42 +59,25 @@ class AgGridMenuAdapter {
|
|
|
59
59
|
.filter(Boolean);
|
|
60
60
|
}
|
|
61
61
|
// 2. if not, return the default context menu
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
// AG Grid does not allow customizing the built-in `valueAggSubMenu`, so we
|
|
63
|
+
// replace it with an Adaptable-built equivalent that also offers a Weighted
|
|
64
|
+
// Average aggregation (with a submenu to pick the weight column).
|
|
65
|
+
// Weighted Average is never used in Pivot Layouts, so we leave the AG Grid
|
|
66
|
+
// default item untouched there.
|
|
67
|
+
const isPivotLayout = this.adaptableApi.layoutApi.isCurrentLayoutPivot();
|
|
68
|
+
const mappedAgGridMenuItems = agGridMenuItems.map((itemName) => itemName === 'valueAggSubMenu' && !isPivotLayout
|
|
69
|
+
? {
|
|
70
|
+
...(0, buildValueAggregationMenuItem_1.buildValueAggregationMenuItem)(this.adaptableApi, menuContext),
|
|
71
|
+
icon: (0, createAgGridIcon_1.createAgGridIcon)('aggregation'),
|
|
72
|
+
}
|
|
73
|
+
: itemName);
|
|
74
|
+
const defaultContextMenu = [
|
|
75
|
+
...mappedAgGridMenuItems,
|
|
64
76
|
'separator',
|
|
65
77
|
...defaultColumnMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
|
|
66
78
|
];
|
|
67
|
-
defaultContextMenu = this.injectParameterizedAggregationColumnMenuItems(defaultContextMenu, adaptableColumn);
|
|
68
79
|
return this.removeConsecutiveSeparators(defaultContextMenu);
|
|
69
80
|
}
|
|
70
|
-
injectParameterizedAggregationColumnMenuItems(menuItems, column) {
|
|
71
|
-
const consolidatedAggregationMenuItem = (0, parameterizedAggregationColumnMenu_1.buildConsolidatedAggregationColumnMenuItem)(this.adaptableApi, column, (columnId, parameterizedAgg) => {
|
|
72
|
-
this.adaptableApi.layoutApi.setColumnParameterizedAggregation(columnId, parameterizedAgg);
|
|
73
|
-
}, (columnId, aggFunc) => {
|
|
74
|
-
this.adaptableApi.layoutApi.updateCurrentLayout((layout) => {
|
|
75
|
-
if (aggFunc == null) {
|
|
76
|
-
(0, parameterizedAggregationHelpers_1.removeColumnAggregationFromLayout)(layout, columnId);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
(0, parameterizedAggregationHelpers_1.upsertColumnAggregationInLayout)(layout, columnId, aggFunc);
|
|
80
|
-
}
|
|
81
|
-
return layout;
|
|
82
|
-
});
|
|
83
|
-
this.adaptableApi.agGridApi.setColumnAggFunc(columnId, aggFunc);
|
|
84
|
-
});
|
|
85
|
-
if (!consolidatedAggregationMenuItem) {
|
|
86
|
-
return menuItems;
|
|
87
|
-
}
|
|
88
|
-
consolidatedAggregationMenuItem.icon = this.mapAdaptableIconToAgGridIcon({ name: 'equation' });
|
|
89
|
-
const originalValueAggMenuIndex = menuItems.findIndex((item) => (0, parameterizedAggregationColumnMenu_1.isValueAggregationMenuItem)(item));
|
|
90
|
-
const menuItemsWithoutValueAgg = menuItems.filter((item) => !(0, parameterizedAggregationColumnMenu_1.isValueAggregationMenuItem)(item));
|
|
91
|
-
const result = [...menuItemsWithoutValueAgg];
|
|
92
|
-
const insertIndex = originalValueAggMenuIndex !== -1
|
|
93
|
-
? Math.min(originalValueAggMenuIndex, result.length)
|
|
94
|
-
: (0, parameterizedAggregationColumnMenu_1.findParameterizedAggMenuInsertIndex)(menuItemsWithoutValueAgg);
|
|
95
|
-
result.splice(insertIndex, 0, consolidatedAggregationMenuItem);
|
|
96
|
-
return result;
|
|
97
|
-
}
|
|
98
81
|
buildContextMenu(params, originalGetContextMenuItems) {
|
|
99
82
|
if (!params.column) {
|
|
100
83
|
return [];
|
|
@@ -273,7 +256,7 @@ class AgGridMenuAdapter {
|
|
|
273
256
|
? () => this.adaptableApi.internalApi.dispatchReduxAction(fullMenuItem.reduxAction)
|
|
274
257
|
: undefined,
|
|
275
258
|
icon: this.mapAdaptableIconToAgGridIcon(fullMenuItem.icon, {
|
|
276
|
-
fill: 'var(--ab-color-
|
|
259
|
+
fill: 'var(--ab-color-primary-foreground)',
|
|
277
260
|
}),
|
|
278
261
|
subMenu: fullMenuItem.subItems?.map((subMenuItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(subMenuItem)),
|
|
279
262
|
};
|
|
@@ -286,7 +269,7 @@ class AgGridMenuAdapter {
|
|
|
286
269
|
return {
|
|
287
270
|
name: customMenuItem.label,
|
|
288
271
|
icon: this.mapAdaptableIconToAgGridIcon(customMenuItem.icon, {
|
|
289
|
-
fill: 'var(--ab-color-
|
|
272
|
+
fill: 'var(--ab-color-primary-foreground)',
|
|
290
273
|
}),
|
|
291
274
|
disabled: customMenuItem.disabled,
|
|
292
275
|
subMenu: !customMenuItem.disabled
|
|
@@ -314,7 +297,7 @@ class AgGridMenuAdapter {
|
|
|
314
297
|
name: userMenuItem.label,
|
|
315
298
|
action: () => (userMenuItem.onClick ? userMenuItem.onClick(menuContext) : null),
|
|
316
299
|
icon: this.mapAdaptableIconToAgGridIcon(userMenuItem.icon, {
|
|
317
|
-
fill: 'var(--ab-color-
|
|
300
|
+
fill: 'var(--ab-color-primary-foreground)',
|
|
318
301
|
}),
|
|
319
302
|
disabled: userMenuItem.disabled,
|
|
320
303
|
subMenu: userMenuItem.subMenuItems
|
|
@@ -739,7 +722,7 @@ class AgGridMenuAdapter {
|
|
|
739
722
|
}
|
|
740
723
|
else {
|
|
741
724
|
return (0, icons_1.iconToString)(icon, {
|
|
742
|
-
fill: 'var(--ab-color-
|
|
725
|
+
fill: 'var(--ab-color-primary-foreground)',
|
|
743
726
|
});
|
|
744
727
|
}
|
|
745
728
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MenuItemDef } from 'ag-grid-enterprise';
|
|
2
|
+
import { AdaptableApi } from '../types';
|
|
3
|
+
import { ColumnMenuContext } from '../AdaptableState/Common/Menu';
|
|
4
|
+
/**
|
|
5
|
+
* Builds the replacement for AG Grid's built-in `valueAggSubMenu` column menu item.
|
|
6
|
+
*
|
|
7
|
+
* AG Grid does not allow customizing the built-in submenu, so we rebuild an
|
|
8
|
+
* equivalent one: the column's existing aggregation functions plus a
|
|
9
|
+
* `Weighted Average` item whose submenu lists the numeric columns that can be
|
|
10
|
+
* used as the weight parameter.
|
|
11
|
+
*
|
|
12
|
+
* Both standard and weighted selections persist through the current Layout
|
|
13
|
+
* (`updateCurrentLayout`), so the existing `weightedAvg` aggFunc can read the
|
|
14
|
+
* chosen `weightedColumnId` back from the Layout.
|
|
15
|
+
*
|
|
16
|
+
* Weighted Average is never used in Pivot Layouts, so this only deals with the
|
|
17
|
+
* Table Layout aggregations and the caller skips it entirely in Pivot mode.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildValueAggregationMenuItem(adaptableApi: AdaptableApi, menuContext: ColumnMenuContext): MenuItemDef;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildValueAggregationMenuItem = buildValueAggregationMenuItem;
|
|
4
|
+
const AggregationColumns_1 = require("../AdaptableState/Common/AggregationColumns");
|
|
5
|
+
const toFuncLabel = (funcName) => {
|
|
6
|
+
if (funcName === 'avg') {
|
|
7
|
+
return 'Average';
|
|
8
|
+
}
|
|
9
|
+
if (funcName === 'weightedAvg') {
|
|
10
|
+
return 'Weighted Average';
|
|
11
|
+
}
|
|
12
|
+
return funcName ? funcName.charAt(0).toUpperCase() + funcName.slice(1) : funcName;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Builds the replacement for AG Grid's built-in `valueAggSubMenu` column menu item.
|
|
16
|
+
*
|
|
17
|
+
* AG Grid does not allow customizing the built-in submenu, so we rebuild an
|
|
18
|
+
* equivalent one: the column's existing aggregation functions plus a
|
|
19
|
+
* `Weighted Average` item whose submenu lists the numeric columns that can be
|
|
20
|
+
* used as the weight parameter.
|
|
21
|
+
*
|
|
22
|
+
* Both standard and weighted selections persist through the current Layout
|
|
23
|
+
* (`updateCurrentLayout`), so the existing `weightedAvg` aggFunc can read the
|
|
24
|
+
* chosen `weightedColumnId` back from the Layout.
|
|
25
|
+
*
|
|
26
|
+
* Weighted Average is never used in Pivot Layouts, so this only deals with the
|
|
27
|
+
* Table Layout aggregations and the caller skips it entirely in Pivot mode.
|
|
28
|
+
*/
|
|
29
|
+
function buildValueAggregationMenuItem(adaptableApi, menuContext) {
|
|
30
|
+
const column = menuContext.adaptableColumn;
|
|
31
|
+
const columnId = column.columnId;
|
|
32
|
+
const currentLayout = adaptableApi.layoutApi.getCurrentLayout();
|
|
33
|
+
const aggregationColumns = currentLayout.TableAggregationColumns || [];
|
|
34
|
+
const currentAggFunc = aggregationColumns.find((agg) => agg.ColumnId === columnId)?.AggFunc;
|
|
35
|
+
let activeAggFuncName;
|
|
36
|
+
if (currentAggFunc != null) {
|
|
37
|
+
const aggFuncName = (0, AggregationColumns_1.getAggFuncName)(currentAggFunc);
|
|
38
|
+
activeAggFuncName = aggFuncName === true ? column.aggregationFunction : aggFuncName;
|
|
39
|
+
}
|
|
40
|
+
const activeWeightColumnId = (0, AggregationColumns_1.isWeightedAverageAggregation)(currentAggFunc)
|
|
41
|
+
? currentAggFunc.weightedColumnId
|
|
42
|
+
: undefined;
|
|
43
|
+
const applyAggregation = (aggFuncValue) => {
|
|
44
|
+
const upsert = (cols) => {
|
|
45
|
+
const list = cols ? [...cols] : [];
|
|
46
|
+
const index = list.findIndex((col) => col.ColumnId === columnId);
|
|
47
|
+
if (index >= 0) {
|
|
48
|
+
list[index] = { ...list[index], AggFunc: aggFuncValue };
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
list.push({ ColumnId: columnId, AggFunc: aggFuncValue });
|
|
52
|
+
}
|
|
53
|
+
return list;
|
|
54
|
+
};
|
|
55
|
+
adaptableApi.layoutApi.updateCurrentLayout((layout) => {
|
|
56
|
+
const tableLayout = layout;
|
|
57
|
+
return {
|
|
58
|
+
...tableLayout,
|
|
59
|
+
TableAggregationColumns: upsert(tableLayout.TableAggregationColumns),
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
const removeAggregation = () => {
|
|
64
|
+
adaptableApi.layoutApi.updateCurrentLayout((layout) => {
|
|
65
|
+
const tableLayout = layout;
|
|
66
|
+
return {
|
|
67
|
+
...tableLayout,
|
|
68
|
+
TableAggregationColumns: (tableLayout.TableAggregationColumns || []).filter((col) => col.ColumnId !== columnId),
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
// 'None' clears any aggregation for the column and is checked when none is set
|
|
73
|
+
const subMenu = [
|
|
74
|
+
{
|
|
75
|
+
name: 'None',
|
|
76
|
+
checked: activeAggFuncName == null,
|
|
77
|
+
action: () => removeAggregation(),
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
// getDisplayAggFuncNames already positions weightedAvg right after 'avg'
|
|
81
|
+
// (and only includes it when the column is eligible)
|
|
82
|
+
const aggFuncItems = (0, AggregationColumns_1.getDisplayAggFuncNames)(column).map((funcName) => {
|
|
83
|
+
// Weighted Average needs a weight column parameter, so instead of a plain
|
|
84
|
+
// action it gets a submenu listing the numeric columns usable as the weight.
|
|
85
|
+
if (funcName === AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME) {
|
|
86
|
+
const weightColumnItems = adaptableApi.columnApi
|
|
87
|
+
.getNumericColumns()
|
|
88
|
+
.filter((numericColumn) => numericColumn.columnId !== columnId)
|
|
89
|
+
.map((numericColumn) => ({
|
|
90
|
+
name: numericColumn.friendlyName ?? numericColumn.columnId,
|
|
91
|
+
checked: activeWeightColumnId === numericColumn.columnId,
|
|
92
|
+
action: () => applyAggregation({
|
|
93
|
+
type: 'weightedAverage',
|
|
94
|
+
weightedColumnId: numericColumn.columnId,
|
|
95
|
+
}),
|
|
96
|
+
}));
|
|
97
|
+
return {
|
|
98
|
+
name: 'Weighted Average',
|
|
99
|
+
checked: activeAggFuncName === AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME,
|
|
100
|
+
subMenu: weightColumnItems,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
name: toFuncLabel(funcName),
|
|
105
|
+
checked: activeAggFuncName === funcName,
|
|
106
|
+
action: () => applyAggregation(funcName),
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
subMenu.push(...aggFuncItems);
|
|
110
|
+
return {
|
|
111
|
+
name: 'Value Aggregation',
|
|
112
|
+
subMenu,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
@@ -18,6 +18,12 @@ import { AdaptableColumn } from '../../AdaptableState/Common/AdaptableColumn';
|
|
|
18
18
|
* is configured for case-insensitive matching.
|
|
19
19
|
*/
|
|
20
20
|
export declare const resolveEffectiveIconStyleMappings: (iconStyle: IconStyle | undefined) => IconStyleMapping[];
|
|
21
|
+
/**
|
|
22
|
+
* Mapping list for wizard / settings summaries: custom mappings first so
|
|
23
|
+
* user-authored entries are always visible, then any remaining preset
|
|
24
|
+
* entries (after override filtering).
|
|
25
|
+
*/
|
|
26
|
+
export declare const resolveIconStyleMappingsForSummaryPreview: (iconStyle: IconStyle | undefined) => IconStyleMapping[];
|
|
21
27
|
export declare const getIconRendererForColumn: (styledColumn: StyledColumn, abColumn: AdaptableColumn, api: AdaptableApi) => any;
|
|
22
28
|
/** Helper exposed for the tooltip getter in `AgGridColumnAdapter`. */
|
|
23
29
|
export declare const findIconStyleMappingForValue: (iconStyle: IconStyle | undefined, cellValue: any) => IconStyleMapping | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findIconStyleMappingForValue = exports.getIconRendererForColumn = exports.resolveEffectiveIconStyleMappings = void 0;
|
|
3
|
+
exports.findIconStyleMappingForValue = exports.getIconRendererForColumn = exports.resolveIconStyleMappingsForSummaryPreview = exports.resolveEffectiveIconStyleMappings = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const Icon_1 = require("../../components/Icon");
|
|
@@ -12,6 +12,25 @@ const iconStyledColumnColumnSupport_1 = require("../../Utilities/Helpers/iconSty
|
|
|
12
12
|
const AdaptableLogger_1 = require("../AdaptableLogger");
|
|
13
13
|
const DEFAULT_SIZE = 18;
|
|
14
14
|
const DEFAULT_GAP = 4;
|
|
15
|
+
const normaliseIconMappingKey = (key, matchMode) => {
|
|
16
|
+
if (typeof key === 'string' && matchMode === 'CaseInsensitive') {
|
|
17
|
+
return key.toLowerCase();
|
|
18
|
+
}
|
|
19
|
+
return key;
|
|
20
|
+
};
|
|
21
|
+
const resolveIconStyleMappingParts = (iconStyle) => {
|
|
22
|
+
const presetMappings = iconStyle.Preset
|
|
23
|
+
? (0, IconStylePresets_1.getIconStylePresetMappings)(iconStyle.Preset)
|
|
24
|
+
: [];
|
|
25
|
+
const userMappings = iconStyle.Mappings ?? [];
|
|
26
|
+
if (presetMappings.length === 0 || userMappings.length === 0) {
|
|
27
|
+
return { presetMappings, userMappings };
|
|
28
|
+
}
|
|
29
|
+
const matchMode = iconStyle.MatchMode ?? 'Exact';
|
|
30
|
+
const overrideKeys = new Set(userMappings.map((m) => normaliseIconMappingKey(m.Key, matchMode)));
|
|
31
|
+
const filteredPreset = presetMappings.filter((p) => !overrideKeys.has(normaliseIconMappingKey(p.Key, matchMode)));
|
|
32
|
+
return { presetMappings: filteredPreset, userMappings };
|
|
33
|
+
};
|
|
15
34
|
/**
|
|
16
35
|
* Resolve the **effective** mapping list for an `IconStyle`:
|
|
17
36
|
*
|
|
@@ -31,26 +50,36 @@ const DEFAULT_GAP = 4;
|
|
|
31
50
|
const resolveEffectiveIconStyleMappings = (iconStyle) => {
|
|
32
51
|
if (!iconStyle)
|
|
33
52
|
return [];
|
|
34
|
-
const presetMappings = iconStyle
|
|
35
|
-
? (0, IconStylePresets_1.getIconStylePresetMappings)(iconStyle.Preset)
|
|
36
|
-
: [];
|
|
37
|
-
const userMappings = iconStyle.Mappings ?? [];
|
|
53
|
+
const { presetMappings, userMappings } = resolveIconStyleMappingParts(iconStyle);
|
|
38
54
|
if (presetMappings.length === 0)
|
|
39
55
|
return userMappings;
|
|
40
|
-
if (userMappings.length === 0)
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (typeof k === 'string' && matchMode === 'CaseInsensitive') {
|
|
45
|
-
return k.toLowerCase();
|
|
46
|
-
}
|
|
47
|
-
return k;
|
|
48
|
-
};
|
|
49
|
-
const overrideKeys = new Set(userMappings.map((m) => normaliseKey(m.Key)));
|
|
50
|
-
const filteredPreset = presetMappings.filter((p) => !overrideKeys.has(normaliseKey(p.Key)));
|
|
51
|
-
return [...filteredPreset, ...userMappings];
|
|
56
|
+
if (userMappings.length === 0) {
|
|
57
|
+
return iconStyle.Preset ? (0, IconStylePresets_1.getIconStylePresetMappings)(iconStyle.Preset) : [];
|
|
58
|
+
}
|
|
59
|
+
return [...presetMappings, ...userMappings];
|
|
52
60
|
};
|
|
53
61
|
exports.resolveEffectiveIconStyleMappings = resolveEffectiveIconStyleMappings;
|
|
62
|
+
/**
|
|
63
|
+
* Mapping list for wizard / settings summaries: custom mappings first so
|
|
64
|
+
* user-authored entries are always visible, then any remaining preset
|
|
65
|
+
* entries (after override filtering).
|
|
66
|
+
*/
|
|
67
|
+
const resolveIconStyleMappingsForSummaryPreview = (iconStyle) => {
|
|
68
|
+
if (!iconStyle)
|
|
69
|
+
return [];
|
|
70
|
+
const { presetMappings, userMappings } = resolveIconStyleMappingParts(iconStyle);
|
|
71
|
+
if (userMappings.length === 0) {
|
|
72
|
+
if (presetMappings.length > 0) {
|
|
73
|
+
return presetMappings;
|
|
74
|
+
}
|
|
75
|
+
return iconStyle.Preset ? (0, IconStylePresets_1.getIconStylePresetMappings)(iconStyle.Preset) : [];
|
|
76
|
+
}
|
|
77
|
+
if (presetMappings.length === 0) {
|
|
78
|
+
return userMappings;
|
|
79
|
+
}
|
|
80
|
+
return [...userMappings, ...presetMappings];
|
|
81
|
+
};
|
|
82
|
+
exports.resolveIconStyleMappingsForSummaryPreview = resolveIconStyleMappingsForSummaryPreview;
|
|
54
83
|
/**
|
|
55
84
|
* Look up `cellValue` in the mapping list using the configured match mode.
|
|
56
85
|
*
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates an AG Grid icon element for the given icon name.
|
|
3
|
+
*
|
|
4
|
+
* Mimics AG Grid's internal icon creation, producing a
|
|
5
|
+
* `<span class="ag-icon ag-icon-{name}" role="presentation" unselectable="on">`
|
|
6
|
+
* so the icon picks up AG Grid's own icon font/theme styling.
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/ag-grid/ag-grid/blob/5ca14e73188f6f52fd7d545d595c067bf1b72168/packages/ag-grid-community/src/utils/icon.ts#L139
|
|
9
|
+
*/
|
|
10
|
+
export declare function createAgGridIcon(name: string): HTMLElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAgGridIcon = createAgGridIcon;
|
|
4
|
+
/**
|
|
5
|
+
* Creates an AG Grid icon element for the given icon name.
|
|
6
|
+
*
|
|
7
|
+
* Mimics AG Grid's internal icon creation, producing a
|
|
8
|
+
* `<span class="ag-icon ag-icon-{name}" role="presentation" unselectable="on">`
|
|
9
|
+
* so the icon picks up AG Grid's own icon font/theme styling.
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/ag-grid/ag-grid/blob/5ca14e73188f6f52fd7d545d595c067bf1b72168/packages/ag-grid-community/src/utils/icon.ts#L139
|
|
12
|
+
*/
|
|
13
|
+
function createAgGridIcon(name) {
|
|
14
|
+
const element = document.createElement('span');
|
|
15
|
+
element.className = `ag-icon ag-icon-${name}`;
|
|
16
|
+
element.setAttribute('role', 'presentation');
|
|
17
|
+
element.setAttribute('unselectable', 'on');
|
|
18
|
+
return element;
|
|
19
|
+
}
|
|
@@ -23,6 +23,6 @@ function UnusedItem({ unusedItem, disabled }) {
|
|
|
23
23
|
const title = currentItem ? currentItem.Title : unusedItem;
|
|
24
24
|
return ((0, jsx_runtime_1.jsx)(dnd_1.DragList.DraggableItem, { id: unusedItem, children: (itemDomProps) => {
|
|
25
25
|
const { onPointerDown, ...restDomProps } = itemDomProps;
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)("div", { "data-name": "unused-item", ...restDomProps, ...(disabled ? {} : { onPointerDown }), className: (0, clsx_1.default)('twa:rounded-md twa:text-sm twa:text-
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)("div", { "data-name": "unused-item", ...restDomProps, ...(disabled ? {} : { onPointerDown }), className: (0, clsx_1.default)('twa:rounded-md twa:text-sm twa:text-primary-foreground twa:p-2 twa:select-none', 'twa:bg-primary', restDomProps.className), children: title }));
|
|
27
27
|
} }));
|
|
28
28
|
}
|
|
@@ -155,7 +155,7 @@ const FunctionsDropdown = ({ expressionFunctions, baseClassName }) => {
|
|
|
155
155
|
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { onMouseEnter: () => setOverFunction(functionName), onClick: () => hidePopup(), children: functionName === 'VAR' ? ((0, jsx_runtime_1.jsx)(VarEditorButton, { className: buttonClassName }, functionName)) : ((0, jsx_runtime_1.jsx)(EditorButton_1.default, { data: getEditorButtonData(functionName), className: buttonClassName, children: functionName }, functionName)) }, functionName));
|
|
156
156
|
})
|
|
157
157
|
.filter(Boolean);
|
|
158
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: (0, clsx_1.default)('twa:mb-2 twa:mx-1', fns.length === 0 ? 'twa:hidden' : ''), children: [(0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:mb-1 twa:bg-primarylight twa:text-
|
|
158
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: (0, clsx_1.default)('twa:mb-2 twa:mx-1', fns.length === 0 ? 'twa:hidden' : ''), children: [(0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:mb-1 twa:bg-primarylight twa:text-primary-foreground twa:w-full", children: StringExtensions_1.default.Humanize(groupName) }), fns] }, groupName));
|
|
159
159
|
}) })] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: (0, clsx_1.default)(`${baseClassName}__dropdown-functions-description `, `twa:flex-1 twa:p-2 twa:w-[600px] twa:max-w-[60vw]`, `twa:rounded-standard twa:shadow-sm twa:overflow-auto twa:h-auto`, 'twa:bg-primarylight twa:text-primary-foreground'), children: overFunction ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:bg-accent twa:text-accent-foreground", children: overFunction }), (0, jsx_runtime_1.jsx)(ExpressionFunctionDocumentation_1.ExpressionFunctionDocumentation, { expressionFunction: expressionFunctions[overFunction] })] })) : ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: "twa:size-full twa:items-center twa:justify-center twa:text-2 twa:italic", children: (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["Hover over a Function to learn more", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {})] }), (0, jsx_runtime_1.jsx)("li", { children: "Click a Function to add it to the Expression in the Editor" })] }) })) })] })] })), children: (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { "data-name": "expression-dropdown", icon: "arrow-down", iconPosition: 'end', className: "twa:mr-1", children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: "twa:mr-1 twa:text-2", children: (0, jsx_runtime_1.jsx)(icons_1.Icon, { name: "equation" }) }) }) }));
|
|
160
160
|
};
|
|
161
161
|
function BaseEditorInput(props) {
|
|
@@ -4,7 +4,7 @@ exports.ExpressionFunctionDocumentation = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const Tag_1 = require("../Tag");
|
|
6
6
|
const Flex_1 = require("../Flex");
|
|
7
|
-
const signatureClassName = 'twa:m-0 twa:whitespace-pre-wrap twa:bg-primary twa:text-
|
|
7
|
+
const signatureClassName = 'twa:m-0 twa:whitespace-pre-wrap twa:bg-primary twa:text-primary-foreground twa:rounded-standard twa:p-1 twa:inline-block';
|
|
8
8
|
const ExpressionFunctionDocumentation = (props) => {
|
|
9
9
|
return props.expressionFunction ? ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { "data-name": "expression-editor-documentation", className: "twa:my-2 twa:p-2 twa:rounded-standard twa:leading-normal", children: [props.expressionFunction.description && ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:mb-3 twa:font-bold twa:whitespace-pre-wrap", "data-name": "expression-editor-documentation-description", children: props.expressionFunction.description })), props.expressionFunction.signatures && ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { "data-name": "expression-editor-documentation-signatures", children: [(0, jsx_runtime_1.jsx)("b", { children: "Signatures" }), (0, jsx_runtime_1.jsx)("ul", { className: "twa:flex twa:flex-col twa:gap-1", children: props.expressionFunction.signatures.map((signature, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("pre", { className: signatureClassName, children: signature }) }, index))) })] })), props.expressionFunction.examples && ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { "data-name": "expression-editor-documentation-examples", children: [(0, jsx_runtime_1.jsx)("b", { children: "Examples" }), (0, jsx_runtime_1.jsx)("ul", { className: "twa:flex twa:flex-col twa:gap-1", children: props.expressionFunction.examples.map((example, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("pre", { className: signatureClassName, children: example }) }, index))) })] })), props.expressionFunction.returnType && ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { "data-name": "expression-editor-documentation-examples", children: [(0, jsx_runtime_1.jsx)("b", { children: "Return Type" }), (0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:bg-accentlight twa:text-accent twa:ml-3 twa:rounded-full twa:py-1", children: props.expressionFunction.returnType })] }))] })) : null;
|
|
10
10
|
};
|
|
@@ -23,7 +23,7 @@ const Body = ({ children, bodyScroll, variant, className, style, }) => {
|
|
|
23
23
|
bodyScroll = 'auto';
|
|
24
24
|
}
|
|
25
25
|
const bodyCls = (0, clsx_1.default)(DEFAULT_BODY_CLS, `${exports.baseClassName}__body`, variant && `${exports.baseClassName}__body--variant-${variant}`, bodyScroll ? `twa:overflow-auto` : null, {
|
|
26
|
-
'twa:bg-primarylight twa:text-
|
|
26
|
+
'twa:bg-primarylight twa:text-primary-foreground twa:border-0': variant === 'modern',
|
|
27
27
|
}, className);
|
|
28
28
|
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { style: style, className: bodyCls, children: children }));
|
|
29
29
|
};
|
|
@@ -82,11 +82,11 @@ const SimpleButton = React.forwardRef((givenProps, theRef) => {
|
|
|
82
82
|
'twa:*:z-1',
|
|
83
83
|
// all svgs inside should be aligned middle
|
|
84
84
|
'twa:[&_svg]:align-middle',
|
|
85
|
-
// 'twa:text-
|
|
85
|
+
// 'twa:text-primary-foreground',
|
|
86
86
|
// the text variant has the background applied on the before pseudo element
|
|
87
87
|
// so let's configure the before pseudo element for all buttons here
|
|
88
88
|
'twa:before:content-[""] twa:before:absolute twa:before:inset-0 twa:before:block', 'twa:before:z-0 twa:before:pointer-events-none twa:before:rounded-[inherit]', 'twa:outline-none twa:focus-visible:border-ring twa:focus-visible:ring-3 twa:focus-visible:ring-ring/50', disabled ? `${exports.baseClassName}--disabled` : '', `${exports.baseClassName}--variant-${variant}`, `${exports.baseClassName}--tone-${tone}`, 'twa:transition-opacity twa:duration-200', {
|
|
89
|
-
'twa:text-
|
|
89
|
+
'twa:text-primary-foreground': tone == 'neutral',
|
|
90
90
|
'twa:text-inherit': tone === 'none',
|
|
91
91
|
'twa:text-success': tone === 'success',
|
|
92
92
|
'twa:text-accent': tone === 'accent',
|
|
@@ -99,11 +99,11 @@ const SimpleButton = React.forwardRef((givenProps, theRef) => {
|
|
|
99
99
|
? 'twa:bg-background twa:border-input-border twa:border'
|
|
100
100
|
: '', variant === 'raised'
|
|
101
101
|
? {
|
|
102
|
-
'twa:text-
|
|
102
|
+
'twa:text-primary-foreground twa:shadow-(--ab-cmp-simple-button__box-shadow) twa:hover:not-disabled:shadow-(--ab-cmp-simple-button__hover-box-shadow) twa:transition-(--ab-cmp-simple-button__transition) twa:duration-200 twa:focus:shadow-(--ab-focus__box-shadow)': true,
|
|
103
103
|
'twa:bg-success twa:text-text-on-success': tone == 'success',
|
|
104
104
|
'twa:bg-accent twa:text-accent-foreground': tone == 'accent',
|
|
105
105
|
'twa:bg-transparent': tone == 'none',
|
|
106
|
-
'twa:bg-primary twa:text-
|
|
106
|
+
'twa:bg-primary twa:text-primary-foreground': tone == 'neutral',
|
|
107
107
|
'twa:bg-error twa:text-text-on-error': tone == 'error',
|
|
108
108
|
'twa:bg-warn twa:text-text-on-warn': tone == 'warning',
|
|
109
109
|
'twa:bg-info twa:text-text-on-info': tone == 'info',
|
|
@@ -44,7 +44,7 @@ const Toggle = ({ onPressedChange, pressed, icon, children, ...rest }) => {
|
|
|
44
44
|
// backgrounds
|
|
45
45
|
{
|
|
46
46
|
'twa:text-inherit twa:bg-transparent': !pressed,
|
|
47
|
-
'twa:hover:bg-primarylight twa:hover:text-
|
|
47
|
+
'twa:hover:bg-primarylight twa:hover:text-primary-foreground': !pressed,
|
|
48
48
|
[`${baseClassName}--pressed`]: pressed,
|
|
49
49
|
'twa:bg-accent twa:hover:bg-accent/90 twa:text-accent-foreground': pressed,
|
|
50
50
|
}, {
|
|
@@ -24,7 +24,7 @@ const ToggleGroup = (props) => {
|
|
|
24
24
|
activeIndex: index,
|
|
25
25
|
}));
|
|
26
26
|
}, []);
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(exports.ToggleGroupContext.Provider, { value: context, children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { ref: ref, tabIndex: 0, className: (0, clsx_1.default)('ab-Toggle-Group twa:shadow-sm', 'twa:bg-primary twa:text-
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(exports.ToggleGroupContext.Provider, { value: context, children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { ref: ref, tabIndex: 0, className: (0, clsx_1.default)('ab-Toggle-Group twa:shadow-sm', 'twa:bg-primary twa:text-primary-foreground', 'twa:rounded-standard twa:overflow-hidden', 'twa:inline-flex twa:w-fit', 'twa:focus:outline-0',
|
|
28
28
|
// make the shadow of child Toggle buttons invisible when the group is not focused
|
|
29
29
|
'twa:not-focus-within:[--ab-focus-light__box-shadow:none]', 'twa:not-focus-within:[--ab-focus__box-shadow:none]'), onMouseDown: (event) => {
|
|
30
30
|
const index = context.toggleButtons.findIndex((btn) => (0, contains_1.default)(btn.node, event.target));
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "23.0.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1781163743848 || Date.now(),
|
|
6
|
+
VERSION: "23.0.0-canary.6" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -13,7 +13,6 @@ const destructurePivotColumnId_1 = require("./destructurePivotColumnId");
|
|
|
13
13
|
const isPivotAggTotalColumn_1 = require("./isPivotAggTotalColumn");
|
|
14
14
|
const isPivotGrandTotal_1 = require("./isPivotGrandTotal");
|
|
15
15
|
const isPivotColumnTotal_1 = require("./isPivotColumnTotal");
|
|
16
|
-
const ParameterizedAggregationRegistry_1 = require("../../Aggregation/ParameterizedAggregationRegistry");
|
|
17
16
|
const devTools_1 = require("../../devTools");
|
|
18
17
|
exports.PIVOT_ANY_TOTAL_COL_TYPE = 'pivotAnyTotal';
|
|
19
18
|
exports.PIVOT_GRAND_TOTAL_COL_TYPE = 'pivotGrandTotal';
|
|
@@ -526,24 +525,18 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
526
525
|
});
|
|
527
526
|
}
|
|
528
527
|
if (gridState.aggregation) {
|
|
529
|
-
TableAggregationColumns = gridState.aggregation.aggregationModel
|
|
530
|
-
.map((agg) => {
|
|
528
|
+
TableAggregationColumns = gridState.aggregation.aggregationModel.map((agg) => {
|
|
531
529
|
const prevAggForColumn = prevAggColumnsMap?.[agg.colId];
|
|
532
530
|
if (prevAggForColumn && prevAggForColumn.AggFunc.aggFunc === agg.aggFunc) {
|
|
533
531
|
return prevAggForColumn;
|
|
534
532
|
}
|
|
535
|
-
// Parameterized aggs require layout metadata (e.g. weight column); ignore incomplete picks.
|
|
536
|
-
if ((0, ParameterizedAggregationRegistry_1.isParameterizedAggFuncName)(agg.aggFunc)) {
|
|
537
|
-
return prevAggForColumn ?? null;
|
|
538
|
-
}
|
|
539
533
|
return {
|
|
540
534
|
ColumnId: agg.colId,
|
|
541
535
|
AggFunc: {
|
|
542
536
|
aggFunc: agg.aggFunc,
|
|
543
537
|
},
|
|
544
538
|
};
|
|
545
|
-
})
|
|
546
|
-
.filter(Boolean);
|
|
539
|
+
});
|
|
547
540
|
}
|
|
548
541
|
// if there's a current layout set
|
|
549
542
|
// we want to only return the AG Grid columns that are also in the current layout
|
|
@@ -792,15 +792,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
792
792
|
};
|
|
793
793
|
AdaptableTheme: {
|
|
794
794
|
k: string;
|
|
795
|
-
p: ({
|
|
796
|
-
n: string;
|
|
797
|
-
k: string;
|
|
798
|
-
o: boolean;
|
|
799
|
-
} | {
|
|
800
|
-
n: string;
|
|
801
|
-
k: string;
|
|
802
|
-
o?: undefined;
|
|
803
|
-
})[];
|
|
804
795
|
};
|
|
805
796
|
AdaptableToolPanel: {
|
|
806
797
|
k: string;
|
|
@@ -3808,6 +3799,9 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3808
3799
|
o: boolean;
|
|
3809
3800
|
}[];
|
|
3810
3801
|
};
|
|
3802
|
+
NumberScopeDataType: {
|
|
3803
|
+
k: string;
|
|
3804
|
+
};
|
|
3811
3805
|
NumericStyledColumn: {
|
|
3812
3806
|
k: string;
|
|
3813
3807
|
p: ({
|
|
@@ -3860,9 +3854,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3860
3854
|
k: string;
|
|
3861
3855
|
}[];
|
|
3862
3856
|
};
|
|
3863
|
-
ParameterizedAggFunc: {
|
|
3864
|
-
k: string;
|
|
3865
|
-
};
|
|
3866
3857
|
PercentBarStyle: {
|
|
3867
3858
|
k: string;
|
|
3868
3859
|
p: ({
|
|
@@ -3983,11 +3974,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3983
3974
|
k: string;
|
|
3984
3975
|
o: boolean;
|
|
3985
3976
|
r: string;
|
|
3986
|
-
} | {
|
|
3987
|
-
n: string;
|
|
3988
|
-
k: string;
|
|
3989
|
-
r: string;
|
|
3990
|
-
o?: undefined;
|
|
3991
3977
|
})[];
|
|
3992
3978
|
};
|
|
3993
3979
|
PlusMinusOptions: {
|
|
@@ -4655,9 +4641,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4655
4641
|
k: string;
|
|
4656
4642
|
}[];
|
|
4657
4643
|
};
|
|
4658
|
-
ShortcutScopeDataType: {
|
|
4659
|
-
k: string;
|
|
4660
|
-
};
|
|
4661
4644
|
ShortcutState: {
|
|
4662
4645
|
k: string;
|
|
4663
4646
|
p: {
|
|
@@ -4918,6 +4901,26 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4918
4901
|
o?: undefined;
|
|
4919
4902
|
})[];
|
|
4920
4903
|
};
|
|
4904
|
+
SystemThemeEntry: {
|
|
4905
|
+
k: string;
|
|
4906
|
+
};
|
|
4907
|
+
SystemThemeName: {
|
|
4908
|
+
k: string;
|
|
4909
|
+
};
|
|
4910
|
+
SystemThemeOptions: {
|
|
4911
|
+
k: string;
|
|
4912
|
+
p: ({
|
|
4913
|
+
n: string;
|
|
4914
|
+
k: string;
|
|
4915
|
+
o: boolean;
|
|
4916
|
+
r?: undefined;
|
|
4917
|
+
} | {
|
|
4918
|
+
n: string;
|
|
4919
|
+
k: string;
|
|
4920
|
+
r: string;
|
|
4921
|
+
o?: undefined;
|
|
4922
|
+
})[];
|
|
4923
|
+
};
|
|
4921
4924
|
TableAggregationColumns: {
|
|
4922
4925
|
k: string;
|
|
4923
4926
|
};
|
|
@@ -5010,14 +5013,28 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
5010
5013
|
k: string;
|
|
5011
5014
|
}[];
|
|
5012
5015
|
};
|
|
5013
|
-
|
|
5016
|
+
ThemeSelectedInfo: {
|
|
5014
5017
|
k: string;
|
|
5015
5018
|
p: {
|
|
5016
5019
|
n: string;
|
|
5017
5020
|
k: string;
|
|
5018
|
-
|
|
5021
|
+
r: string;
|
|
5019
5022
|
}[];
|
|
5020
5023
|
};
|
|
5024
|
+
ThemeState: {
|
|
5025
|
+
k: string;
|
|
5026
|
+
p: ({
|
|
5027
|
+
n: string;
|
|
5028
|
+
k: string;
|
|
5029
|
+
o: boolean;
|
|
5030
|
+
r: string;
|
|
5031
|
+
} | {
|
|
5032
|
+
n: string;
|
|
5033
|
+
k: string;
|
|
5034
|
+
o: boolean;
|
|
5035
|
+
r?: undefined;
|
|
5036
|
+
})[];
|
|
5037
|
+
};
|
|
5021
5038
|
ToastPositions: {
|
|
5022
5039
|
k: string;
|
|
5023
5040
|
};
|
|
@@ -5180,13 +5197,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
5180
5197
|
VueFrameworkComponent: {
|
|
5181
5198
|
k: string;
|
|
5182
5199
|
};
|
|
5183
|
-
WeightedAverageAggregation: {
|
|
5184
|
-
k: string;
|
|
5185
|
-
p: {
|
|
5186
|
-
n: string;
|
|
5187
|
-
k: string;
|
|
5188
|
-
}[];
|
|
5189
|
-
};
|
|
5190
5200
|
WindowPosition: {
|
|
5191
5201
|
k: string;
|
|
5192
5202
|
};
|