@adaptabletools/adaptable 12.1.7 → 12.2.0-canary.0
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/base.css +127 -71
- package/bundle.cjs.js +108 -108
- package/index.css +145 -83
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +44 -10
- package/src/AdaptableOptions/FilterOptions.d.ts +12 -0
- package/src/AdaptableOptions/FinancePluginOptions.d.ts +22 -1
- package/src/AdaptableOptions/LayoutOptions.d.ts +10 -1
- package/src/AdaptableOptions/StateOptions.d.ts +25 -12
- package/src/Api/ColumnApi.d.ts +5 -0
- package/src/Api/ExportApi.d.ts +5 -0
- package/src/Api/FilterApi.d.ts +23 -0
- package/src/Api/GridApi.d.ts +1 -0
- package/src/Api/Implementation/AlertApiImpl.js +1 -2
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +5 -0
- package/src/Api/Implementation/ExportApiImpl.d.ts +3 -1
- package/src/Api/Implementation/ExportApiImpl.js +19 -3
- package/src/Api/Implementation/FilterApiImpl.d.ts +5 -0
- package/src/Api/Implementation/FilterApiImpl.js +25 -2
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -2
- package/src/Api/Implementation/InternalApiImpl.js +34 -3
- package/src/Api/Implementation/PredicateApiImpl.js +4 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +1 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.js +14 -1
- package/src/Api/InternalApi.d.ts +6 -2
- package/src/Api/QueryLanguageApi.d.ts +5 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +16 -4
- package/src/PredefinedConfig/Common/AdaptableQuery.js +1 -1
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +6 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +4 -0
- package/src/PredefinedConfig/Common/ColumnFilter.d.ts +2 -2
- package/src/PredefinedConfig/Common/Enums.d.ts +0 -15
- package/src/PredefinedConfig/Common/Enums.js +1 -18
- package/src/PredefinedConfig/ExportState.d.ts +12 -4
- package/src/PredefinedConfig/LayoutState.d.ts +2 -1
- package/src/PredefinedConfig/PopupState.d.ts +1 -2
- package/src/Redux/ActionsReducers/AlertRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/AlertRedux.js +1 -1
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +1 -1
- package/src/Redux/ActionsReducers/CustomSortRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/CustomSortRedux.js +1 -1
- package/src/Redux/ActionsReducers/FlashingCellRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +1 -1
- package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +1 -1
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +28 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +80 -2
- package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +1 -1
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +0 -2
- package/src/Redux/ActionsReducers/PopupRedux.js +1 -28
- package/src/Redux/ActionsReducers/ScheduleRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/ScheduleRedux.js +5 -5
- package/src/Redux/ActionsReducers/ShortcutRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/ShortcutRedux.js +1 -1
- package/src/Redux/Store/AdaptableStore.js +15 -6
- package/src/Strategy/AlertModule.d.ts +1 -0
- package/src/Strategy/AlertModule.js +20 -0
- package/src/Strategy/BulkUpdateModule.d.ts +1 -1
- package/src/Strategy/CalculatedColumnModule.js +3 -3
- package/src/Strategy/ExportModule.d.ts +0 -1
- package/src/Strategy/ExportModule.js +0 -16
- package/src/Strategy/FilterModule.js +6 -0
- package/src/Strategy/Interface/IModule.d.ts +4 -0
- package/src/Strategy/LayoutModule.js +20 -20
- package/src/Strategy/QueryModule.js +1 -1
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +0 -13
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +16 -1
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +15 -11
- package/src/Strategy/Utilities/getExpressionViewItems.d.ts +3 -4
- package/src/Strategy/Utilities/getExpressionViewItems.js +3 -3
- package/src/Strategy/Utilities/getRuleViewItems.js +1 -1
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +2 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -0
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +12 -2
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +30 -66
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +22 -6
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +423 -220
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +7 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +25 -7
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +0 -1
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +6 -54
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +31 -5
- package/src/Utilities/Interface/MessagePopups.d.ts +0 -4
- package/src/Utilities/ObjectFactory.d.ts +4 -2
- package/src/Utilities/ObjectFactory.js +16 -3
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +25 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +103 -0
- package/src/Utilities/Services/AlertService.d.ts +0 -1
- package/src/Utilities/Services/AlertService.js +5 -17
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +4 -4
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +29 -154
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +2 -2
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +8 -3
- package/src/Utilities/Services/QueryLanguageService.d.ts +8 -4
- package/src/Utilities/Services/QueryLanguageService.js +68 -25
- package/src/Utilities/Services/ReportService.js +48 -48
- package/src/View/AdaptableView.js +1 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +10 -10
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.d.ts +3 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.js +9 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +14 -15
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +7 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +280 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/index.d.ts +1 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/index.js +5 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +4 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +2 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +3 -3
- package/src/View/AdaptableWizardView/Wizard.js +2 -2
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +0 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -8
- package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingsTags.d.ts +2 -0
- package/src/View/CalculatedColumn/Utilities/{getCalculatedColumnSettingTags.js → getCalculatedColumnSettingsTags.js} +3 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +80 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +24 -14
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.d.ts +1 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +9 -52
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +17 -6
- package/src/View/Components/AdaptableObjectCollection/index.d.ts +3 -4
- package/src/View/Components/AdaptableObjectCollection/index.js +7 -8
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +42 -6
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
- package/src/View/Components/AdaptableObjectRow/index.js +1 -4
- package/src/View/Components/EntityRulesEditor/index.js +28 -7
- package/src/View/Components/FilterForm/FilterForm.js +8 -4
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -0
- package/src/View/Components/FilterForm/QuickFilterForm.js +19 -7
- package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.d.ts +9 -0
- package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.js +28 -0
- package/src/View/Components/PermittedValuesSelector/index.d.ts +1 -0
- package/src/View/Components/PermittedValuesSelector/index.js +5 -0
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.d.ts +1 -0
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +2 -1
- package/src/View/Components/Popups/AdaptableToaster.js +2 -7
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +1 -4
- package/src/View/Components/ValueSelector/index.js +8 -19
- package/src/View/CustomSort/CustomSortSummary.js +1 -1
- package/src/View/Dashboard/DashboardPopup.js +11 -10
- package/src/View/Export/ExportViewPanel.d.ts +1 -2
- package/src/View/Export/ExportViewPanel.js +4 -8
- package/src/View/Export/Wizard/ReportColumnTypeWizard.d.ts +1 -2
- package/src/View/Export/Wizard/ReportColumnTypeWizard.js +11 -12
- package/src/View/Export/Wizard/ReportRowTypeWizard.d.ts +1 -2
- package/src/View/Export/Wizard/ReportRowTypeWizard.js +12 -13
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +4 -3
- package/src/View/Export/Wizard/ReportSettingsWizard.js +1 -2
- package/src/View/Filter/FilterViewPanel.js +21 -4
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/GridInfo/AdaptableObjectsSummary.js +5 -3
- package/src/View/GridInfo/AdaptableOptionsComponent.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +6 -7
- package/src/View/Layout/Wizard/{LayoutEditor → Components}/ColumnLabels.d.ts +0 -0
- package/src/View/Layout/Wizard/{LayoutEditor → Components}/ColumnLabels.js +0 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +1 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +69 -8
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
- package/src/View/Query/QueryViewPanel.js +1 -1
- package/src/View/Query/Wizard/NamedQueryExpressionWizardSection.js +3 -4
- package/src/View/StateManagement/StateManagementPopup.js +18 -19
- package/src/agGrid/Adaptable.d.ts +12 -3
- package/src/agGrid/Adaptable.js +264 -148
- package/src/agGrid/agGridHelper.d.ts +1 -0
- package/src/agGrid/agGridHelper.js +5 -3
- package/src/agGrid/agGridMenuHelper.d.ts +1 -0
- package/src/agGrid/agGridMenuHelper.js +4 -2
- package/src/agGrid/weightedAverage.d.ts +6 -0
- package/src/agGrid/weightedAverage.js +66 -0
- package/src/bundle-dependencies/bundles/react-toastify/index.js +1 -1
- package/src/components/DragAndDropContext/ModuleManager.js +3 -4
- package/src/components/DragAndDropContext/TabList.js +9 -30
- package/src/components/DragAndDropContext/UnusedPanel.js +1 -7
- package/src/components/DropdownButton/index.js +2 -2
- package/src/components/EmptyContent/index.js +2 -2
- package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -0
- package/src/components/ExpressionEditor/BaseEditorInput.js +3 -3
- package/src/components/ExpressionEditor/EditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.js +24 -4
- package/src/components/ExpressionEditor/{EditorInputReactive.d.ts → EditorInputWithWhereClause.d.ts} +3 -3
- package/src/components/ExpressionEditor/{EditorInputReactive.js → EditorInputWithWhereClause.js} +6 -5
- package/src/components/ExpressionEditor/editorButtonsAggregatedBoolean.d.ts +2 -0
- package/src/components/ExpressionEditor/{editorButtonsReactive.js → editorButtonsAggregatedBoolean.js} +22 -37
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -10
- package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.d.ts +2 -0
- package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.js +50 -0
- package/src/components/ExpressionEditor/editorButtonsObservable.d.ts +2 -0
- package/src/components/ExpressionEditor/editorButtonsObservable.js +40 -0
- package/src/components/ExpressionEditor/index.d.ts +1 -1
- package/src/components/ExpressionEditor/index.js +50 -19
- package/src/metamodel/adaptable.metamodel.d.ts +86 -5
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +14 -10
- package/src/types.d.ts +4 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingTags.d.ts +0 -2
- package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +0 -3
- package/src/View/Layout/LayoutEditorStandalonePopup.js +0 -78
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.d.ts +0 -27
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +0 -86
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.d.ts +0 -16
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +0 -89
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.d.ts +0 -15
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +0 -70
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.d.ts +0 -15
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +0 -70
- package/src/View/Layout/Wizard/LayoutEditor/droppableIds.d.ts +0 -7
- package/src/View/Layout/Wizard/LayoutEditor/droppableIds.js +0 -11
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.d.ts +0 -6
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +0 -26
- package/src/View/Layout/Wizard/LayoutEditor/index.d.ts +0 -9
- package/src/View/Layout/Wizard/LayoutEditor/index.js +0 -367
- package/src/View/Layout/Wizard/LayoutEditor/reducer.d.ts +0 -28
- package/src/View/Layout/Wizard/LayoutEditor/reducer.js +0 -46
- package/src/View/Layout/Wizard/LayoutEditor/utils.d.ts +0 -10
- package/src/View/Layout/Wizard/LayoutEditor/utils.js +0 -14
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +0 -30
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +0 -132
- package/src/components/ExpressionEditor/editorButtonsReactive.d.ts +0 -2
|
File without changes
|
|
File without changes
|
|
@@ -112,6 +112,7 @@ const LayoutWizard = (props) => {
|
|
|
112
112
|
title: 'Aggregations',
|
|
113
113
|
details: 'Select Column Aggregations',
|
|
114
114
|
renderSummary: () => React.createElement(AggregationsSection_1.AggregationsSectionSummary, null),
|
|
115
|
+
isValid: (data) => AggregationsSection_1.isAggregationsSectionValid(data),
|
|
115
116
|
render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
|
|
116
117
|
React.createElement(AggregationsSection_1.AggregationsSection, { onChange: setLayout }))),
|
|
117
118
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Layout } from '../../../../../types';
|
|
3
|
+
export declare const isAggregationsSectionValid: (data: Layout) => true | string;
|
|
3
4
|
export declare const AggregationsSectionSummary: React.FunctionComponent;
|
|
4
5
|
interface AggregationsSectionProps {
|
|
5
6
|
onChange: (data: Layout) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AggregationsSection = exports.AggregationsSectionSummary = void 0;
|
|
3
|
+
exports.AggregationsSection = exports.AggregationsSectionSummary = exports.isAggregationsSectionValid = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
@@ -14,6 +14,17 @@ const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
|
14
14
|
const ValueSelector_1 = require("../../../Components/ValueSelector");
|
|
15
15
|
const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
|
|
16
16
|
const Utilities_1 = require("./Utilities");
|
|
17
|
+
const WEIGHTED_AVERAGE_AGG_FN_NAME = 'weightedAvg';
|
|
18
|
+
const isAggregationsSectionValid = (data) => {
|
|
19
|
+
const weightedAvg = data.AggregationColumns
|
|
20
|
+
? Object.values(data.AggregationColumns).find((agg) => typeof agg === 'object' && agg.type === 'weightedAverage')
|
|
21
|
+
: null;
|
|
22
|
+
if (weightedAvg && !weightedAvg.weightedColumnId) {
|
|
23
|
+
return 'Weighted Average aggregation requires a weighted column';
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
};
|
|
27
|
+
exports.isAggregationsSectionValid = isAggregationsSectionValid;
|
|
17
28
|
const AggregationsSectionSummary = () => {
|
|
18
29
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
19
30
|
const { data: layout } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
@@ -32,8 +43,13 @@ const AggregationsSectionSummary = () => {
|
|
|
32
43
|
exports.AggregationsSectionSummary = AggregationsSectionSummary;
|
|
33
44
|
const ColumnRow = (props) => {
|
|
34
45
|
var _a, _b;
|
|
46
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
35
47
|
const aggValue = (_b = (_a = props.layout) === null || _a === void 0 ? void 0 : _a.AggregationColumns) === null || _b === void 0 ? void 0 : _b[props.column.columnId];
|
|
36
|
-
const
|
|
48
|
+
const adaptableAggFunctions = [];
|
|
49
|
+
if (props.column.dataType === 'Number') {
|
|
50
|
+
adaptableAggFunctions.push(WEIGHTED_AVERAGE_AGG_FN_NAME);
|
|
51
|
+
}
|
|
52
|
+
const aggOptions = [...props.column.availableAggregationFunctions, ...adaptableAggFunctions].map((fnName) => {
|
|
37
53
|
return {
|
|
38
54
|
label: fnName,
|
|
39
55
|
onClick: () => {
|
|
@@ -41,14 +57,51 @@ const ColumnRow = (props) => {
|
|
|
41
57
|
if (!aggCols) {
|
|
42
58
|
return;
|
|
43
59
|
}
|
|
44
|
-
|
|
60
|
+
if (fnName === WEIGHTED_AVERAGE_AGG_FN_NAME) {
|
|
61
|
+
aggCols[props.column.columnId] = {
|
|
62
|
+
type: 'weightedAverage',
|
|
63
|
+
weightedColumnId: null,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
aggCols[props.column.columnId] = fnName;
|
|
68
|
+
}
|
|
45
69
|
props.onChangeAggFunction(aggCols);
|
|
46
70
|
},
|
|
47
71
|
};
|
|
48
72
|
});
|
|
49
|
-
|
|
73
|
+
const numericColumnsOptions = props.numberColumns
|
|
74
|
+
.filter((col) => col.columnId !== props.column.columnId)
|
|
75
|
+
.map((col) => {
|
|
76
|
+
return {
|
|
77
|
+
label: col.friendlyName,
|
|
78
|
+
onClick: () => {
|
|
79
|
+
const aggCols = Object.assign({}, props.layout.AggregationColumns);
|
|
80
|
+
if (!aggCols) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
aggCols[props.column.columnId] = {
|
|
84
|
+
type: 'weightedAverage',
|
|
85
|
+
weightedColumnId: col.columnId,
|
|
86
|
+
};
|
|
87
|
+
props.onChangeAggFunction(aggCols);
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
const currentAggFnName = props.aggregationColumnsMap[props.column.columnId];
|
|
92
|
+
let weightName = null;
|
|
93
|
+
if (typeof aggValue === 'object' && aggValue.type === 'weightedAverage') {
|
|
94
|
+
weightName = aggValue.weightedColumnId
|
|
95
|
+
? adaptable.api.columnApi.getFriendlyNameFromColumnId(aggValue.weightedColumnId)
|
|
96
|
+
: 'Select Weight';
|
|
97
|
+
}
|
|
98
|
+
return (React.createElement(rebass_1.Flex, { alignItems: "center" },
|
|
50
99
|
props.column.friendlyName,
|
|
51
|
-
aggValue && (React.createElement(DropdownButton_1.default, { columns: ['label'], items: aggOptions, ml: 2 },
|
|
100
|
+
aggValue && (React.createElement(DropdownButton_1.default, { columns: ['label'], items: aggOptions, ml: 2 }, currentAggFnName)),
|
|
101
|
+
currentAggFnName === WEIGHTED_AVERAGE_AGG_FN_NAME && (React.createElement(rebass_1.Flex, { backgroundColor: "primary", ml: 3, alignItems: "center" },
|
|
102
|
+
React.createElement(rebass_1.Text, null, "Weight"),
|
|
103
|
+
' ',
|
|
104
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: numericColumnsOptions, ml: 2 }, weightName)))));
|
|
52
105
|
};
|
|
53
106
|
const AggregationsSection = (props) => {
|
|
54
107
|
var _a, _b;
|
|
@@ -56,6 +109,7 @@ const AggregationsSection = (props) => {
|
|
|
56
109
|
const { data: layout } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
57
110
|
const allAggregableColumns = adaptable.api.columnApi.getAggregetableColumns();
|
|
58
111
|
const allColumns = adaptable.api.columnApi.getColumns();
|
|
112
|
+
const numberColumns = adaptable.api.columnApi.getNumericColumns();
|
|
59
113
|
const sortedAggregableColumns = React.useMemo(() => {
|
|
60
114
|
var _a, _b;
|
|
61
115
|
return sortWithOrder_1.sortWithOrderArray(allAggregableColumns.map((col) => col.columnId), (_b = Object.keys((_a = layout.AggregationColumns) !== null && _a !== void 0 ? _a : {})) !== null && _b !== void 0 ? _b : [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnFromId(colId));
|
|
@@ -79,10 +133,17 @@ const AggregationsSection = (props) => {
|
|
|
79
133
|
return Object.keys(layout.AggregationColumns || {}).reduce((acc, colId) => {
|
|
80
134
|
var _a;
|
|
81
135
|
let fn = (_a = layout.AggregationColumns) === null || _a === void 0 ? void 0 : _a[colId];
|
|
136
|
+
let fnName = '';
|
|
82
137
|
if (typeof fn === 'boolean') {
|
|
83
|
-
|
|
138
|
+
fnName = allColumnsMap[colId].aggregationFunction;
|
|
139
|
+
}
|
|
140
|
+
if (typeof fn === 'object' && fn.type === 'weightedAverage') {
|
|
141
|
+
fnName = WEIGHTED_AVERAGE_AGG_FN_NAME;
|
|
142
|
+
}
|
|
143
|
+
else if (typeof fn === 'string') {
|
|
144
|
+
fnName = fn;
|
|
84
145
|
}
|
|
85
|
-
acc[colId] =
|
|
146
|
+
acc[colId] = fnName;
|
|
86
147
|
return acc;
|
|
87
148
|
}, {});
|
|
88
149
|
}, [layout]);
|
|
@@ -95,7 +156,7 @@ const AggregationsSection = (props) => {
|
|
|
95
156
|
React.createElement(rebass_1.Flex, null,
|
|
96
157
|
React.createElement(FormLayout_1.default, null,
|
|
97
158
|
React.createElement(CheckBox_1.CheckBox, { checked: layout.SuppressAggFuncInHeader, onChange: handleSuppressAggFuncInHeader }, "Suppress Aggregation Function in Header"))),
|
|
98
|
-
React.createElement(ValueSelector_1.ValueSelector, { showFilterInput: true, showSelectedOnlyPosition: "top", filter: Utilities_1.columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => { var _a; return (_a = option.friendlyName) !== null && _a !== void 0 ? _a : option.columnId; }, toListLabel: (column) => (React.createElement(ColumnRow, { onChangeAggFunction: handleAggregationChange, layout: layout, column: column, aggregationColumnsMap: aggregationColumnsMap })), options: sortedAggregableColumns, value: (_b = Object.keys((_a = layout.AggregationColumns) !== null && _a !== void 0 ? _a : {})) !== null && _b !== void 0 ? _b : [], allowReorder: () => false, xSelectedLabel: () => {
|
|
159
|
+
React.createElement(ValueSelector_1.ValueSelector, { showFilterInput: true, showSelectedOnlyPosition: "top", filter: Utilities_1.columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => { var _a; return (_a = option.friendlyName) !== null && _a !== void 0 ? _a : option.columnId; }, toListLabel: (column) => (React.createElement(ColumnRow, { onChangeAggFunction: handleAggregationChange, layout: layout, column: column, aggregationColumnsMap: aggregationColumnsMap, numberColumns: numberColumns })), options: sortedAggregableColumns, value: (_b = Object.keys((_a = layout.AggregationColumns) !== null && _a !== void 0 ? _a : {})) !== null && _b !== void 0 ? _b : [], allowReorder: () => false, xSelectedLabel: () => {
|
|
99
160
|
return `Active aggregations:`;
|
|
100
161
|
}, onChange: handleColumnsSelectionChange }))));
|
|
101
162
|
};
|
|
@@ -16,11 +16,11 @@ const sortWithOrder_1 = require("../../../../Utilities/sortWithOrder");
|
|
|
16
16
|
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
17
17
|
const ValueSelector_1 = require("../../../Components/ValueSelector");
|
|
18
18
|
const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
|
|
19
|
-
const ColumnLabels_1 = require("../LayoutEditor/ColumnLabels");
|
|
20
19
|
const Utilities_1 = require("./Utilities");
|
|
21
20
|
const icons_1 = require("../../../../components/icons");
|
|
22
21
|
const CheckBox_1 = require("../../../../components/CheckBox");
|
|
23
22
|
const Helper_1 = require("../../../../Utilities/Helpers/Helper");
|
|
23
|
+
const ColumnLabels_1 = require("../Components/ColumnLabels");
|
|
24
24
|
const PropertyOrderText = (props) => (React.createElement(rebass_1.Text, { fontWeight: 600, fontSize: 2 }, props.children));
|
|
25
25
|
const ColumnsSectionSummary = () => {
|
|
26
26
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
@@ -88,7 +88,7 @@ class QueryViewPanelComponent extends React.Component {
|
|
|
88
88
|
const renderTextInput = () => {
|
|
89
89
|
return this.props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 600 },
|
|
90
90
|
React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.api.queryApi.expandCurrentQuery(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
|
|
91
|
-
React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { fontFamily: 'monospace', fontSize: 12 } }),
|
|
91
|
+
React.createElement(Input_1.default, { type: "text", "data-name": "query-input", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { fontFamily: 'monospace', fontSize: 12 } }),
|
|
92
92
|
isExpressionValid ? (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => this.runQuery(), tooltip: '', accessLevel: 'Full', variant: "text", tone: "neutral", disabled: this.state.expression == '' || this.state.expression == this.props.CurrentQuery, marginRight: 1 })) : (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Query", marginRight: 1 })),
|
|
93
93
|
' ',
|
|
94
94
|
this.props.CurrentQuery !== '' && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.clearQuery(), tooltip: "Clear Query", accessLevel: 'Full' })))) : (React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { width: '100%' } }));
|
|
@@ -6,7 +6,6 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
8
|
const ExpressionEditor_1 = require("../../../components/ExpressionEditor");
|
|
9
|
-
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
10
9
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
11
10
|
const ModuleConstants_1 = require("../../../Utilities/Constants/ModuleConstants");
|
|
12
11
|
const Tag_1 = require("../../../components/Tag");
|
|
@@ -22,14 +21,14 @@ const isValidNamedQueryExpression = (data, api) => {
|
|
|
22
21
|
};
|
|
23
22
|
exports.isValidNamedQueryExpression = isValidNamedQueryExpression;
|
|
24
23
|
const renderNamedQueryExpressionSummary = (data) => {
|
|
24
|
+
const { api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
25
25
|
return (React.createElement(rebass_1.Text, { fontSize: 2 },
|
|
26
26
|
"Expression: ",
|
|
27
|
-
React.createElement(Tag_1.Tag, null, data
|
|
27
|
+
React.createElement(Tag_1.Tag, null, api.internalApi.getAdaptableQueryExpressionText(data))));
|
|
28
28
|
};
|
|
29
29
|
exports.renderNamedQueryExpressionSummary = renderNamedQueryExpressionSummary;
|
|
30
30
|
const NamedQueryExpressionWizardSection = (props) => {
|
|
31
|
-
const { api } =
|
|
32
|
-
const { data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
31
|
+
const { data, moduleInfo, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
33
32
|
const initialData = react_1.useMemo(() => api.internalApi.getQueryPreviewData(), []);
|
|
34
33
|
return (React.createElement(ExpressionEditor_1.ExpressionEditor, { allowSaveNamedQuery: false, type: 'boolean', module: moduleInfo.ModuleName, value: data.BooleanExpression, onChange: (BooleanExpression) => {
|
|
35
34
|
props.onChange(Object.assign(Object.assign({}, data), { BooleanExpression }));
|
|
@@ -4,30 +4,29 @@ exports.StateManagementPopup = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
|
|
7
|
-
const rebass_1 = require("rebass");
|
|
8
7
|
const HelpBlock_1 = tslib_1.__importDefault(require("../../components/HelpBlock"));
|
|
9
8
|
const LoadButton_1 = require("./components/LoadButton");
|
|
10
9
|
const ClearButton_1 = require("./components/ClearButton");
|
|
11
10
|
const ExportDropdown_1 = require("./components/ExportDropdown");
|
|
12
11
|
const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
|
|
13
12
|
const StateManagementPopup = (props) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
const baseClassName = 'ab-ManageState';
|
|
14
|
+
return (React.createElement(PopupPanel_1.PopupPanel, { className: baseClassName, headerText: props.moduleInfo.FriendlyName, glyphicon: props.moduleInfo.Glyph, infoLink: props.moduleInfo.HelpPage, infoLinkDisabled: !props.api.internalApi.isDocumentationLinksDisplayed() },
|
|
15
|
+
React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "user-state", header: 'User State', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginRight: 2, mb: 2 },
|
|
16
|
+
React.createElement(HelpBlock_1.default, { marginBottom: 2 }, 'Clear all current user state that has been persisted.'),
|
|
17
|
+
React.createElement(HelpBlock_1.default, null, 'This will cause this window to close and any state you have previously created will be lost and the initial Predefined Config will then be reapplied.'),
|
|
18
|
+
React.createElement(ClearButton_1.ClearButton, { tone: "error", variant: "raised", marginTop: 2, accessLevel: props.accessLevel, onClick: () => props.api.configApi.reloadPredefinedConfig() }, "Clear User State")),
|
|
19
|
+
React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "predefined-config", header: 'Load Predefined Config', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2, mb: 2 },
|
|
20
|
+
React.createElement(HelpBlock_1.default, { marginTop: 2 }, 'Load Predefined Config (from a .json file). This will cause this window to close.'),
|
|
21
|
+
' ',
|
|
22
|
+
React.createElement(LoadButton_1.LoadButton, { tone: "info", variant: "raised", marginTop: 2, accessLevel: props.accessLevel, onLoad: (json) => props.api.configApi.reloadPredefinedConfig(json) }, "Load Predefined Config")),
|
|
23
|
+
React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "adaptable-state", header: 'Export Adaptable State', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2, mb: 2 },
|
|
24
|
+
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, 'Exports the currently persisted Adaptable state.'),
|
|
25
|
+
' ',
|
|
26
|
+
React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "adaptableState", marginRight: 3, style: { flex: 1, maxWidth: 'none' }, columns: ['label'] }, "Select Export Destination")),
|
|
27
|
+
React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "initial-predefined-config", header: 'Export Initial Predefined Config', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2, mb: 2 },
|
|
28
|
+
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, 'Exports the Predefined Config which was provided at design time.'),
|
|
29
|
+
' ',
|
|
30
|
+
React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "predefinedConfig", marginRight: 3, style: { flex: 1, maxWidth: 'none' }, columns: ['label'] }, "Select Export Destination"))));
|
|
32
31
|
};
|
|
33
32
|
exports.StateManagementPopup = StateManagementPopup;
|
|
@@ -201,6 +201,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
201
201
|
getVisibleRowNodes(): RowNode[];
|
|
202
202
|
getAllRowNodes(config?: {
|
|
203
203
|
includeGroupRows?: boolean;
|
|
204
|
+
filterFn?: (rowNode: RowNode) => boolean;
|
|
204
205
|
}): RowNode[];
|
|
205
206
|
getRowsInViewport(): RowNode[];
|
|
206
207
|
selectNodes(rowNodes: RowNode[], clearSelection: boolean): void;
|
|
@@ -225,12 +226,11 @@ export declare class Adaptable implements IAdaptable {
|
|
|
225
226
|
private mapColumnDefs;
|
|
226
227
|
private getColDefsForSpecialColumns;
|
|
227
228
|
getColDefsForFreeTextColumns(): ColDef[];
|
|
228
|
-
setupColumnValueGetter({ col }: ColumnSetupInfo): void;
|
|
229
|
+
setupColumnValueGetter({ col, abColumn }: ColumnSetupInfo): void;
|
|
229
230
|
setupColumnAggFunc({ col }: ColumnSetupInfo): void;
|
|
230
231
|
private getColDefsForRowEditColumns;
|
|
231
232
|
getColDefsForActionColumns(): ColDef[];
|
|
232
233
|
updateColDefsForSpecialColumns(): void;
|
|
233
|
-
private cleanupFloatingFilters_WORKAROUND;
|
|
234
234
|
private getColDefsForCalculatedColumns;
|
|
235
235
|
private isRegularColDef;
|
|
236
236
|
private isGroupColDef;
|
|
@@ -253,6 +253,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
253
253
|
buildStandaloneColumnHeader(adaptableColumn: AdaptableColumn): AdaptableMenuItem[];
|
|
254
254
|
prepareGrid(): void;
|
|
255
255
|
setupColumns(): void;
|
|
256
|
+
revertGridOptionsPropertiesToUserValue<T extends keyof GridOptions>(propertyNames: T[]): void;
|
|
256
257
|
setGridOptionsProperty<T extends keyof GridOptions>(propertyName: T, propertyGetter: (userPropertyValue: GridOptions[T]) => GridOptions[T] | undefined): void;
|
|
257
258
|
setColDefProperty<T extends keyof ColDef>(col: Column, propertyName: T, propertyGetter: (userPropertyValue: ColDef[T]) => ColDef[T] | undefined): void;
|
|
258
259
|
private getUserColDefProperty;
|
|
@@ -263,6 +264,9 @@ export declare class Adaptable implements IAdaptable {
|
|
|
263
264
|
setupColumnCellRenderer({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
264
265
|
setupColumnTooltipValueGetter({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
265
266
|
setupColumnQuickFilerText({ col, abColumn }: ColumnSetupInfo): void;
|
|
267
|
+
setupAllowedAggFuncs({ col, abColumn }: ColumnSetupInfo): void;
|
|
268
|
+
triggerSetupColumnKeyCreator(colId: string): void;
|
|
269
|
+
setupColumnKeyCreator(columnSetupInfo: ColumnSetupInfo): void;
|
|
266
270
|
setupColumnHeader({ col, abColumn }: ColumnSetupInfo): boolean;
|
|
267
271
|
setupColumnFilter({ col, colDef }: ColumnSetupInfo): void;
|
|
268
272
|
setupColumnFloatingFilter({ col, colDef }: ColumnSetupInfo): void;
|
|
@@ -271,7 +275,6 @@ export declare class Adaptable implements IAdaptable {
|
|
|
271
275
|
setupColumnValueSetter({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
272
276
|
setupColumnComparator({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
273
277
|
private applyCurrentTheme;
|
|
274
|
-
private getInitialGroupOrderComparator;
|
|
275
278
|
private applyFinalRendering;
|
|
276
279
|
private isModulePresent;
|
|
277
280
|
private getPreviousColDefInfo;
|
|
@@ -361,6 +364,12 @@ export declare class Adaptable implements IAdaptable {
|
|
|
361
364
|
initLicenseService(): LicenseService;
|
|
362
365
|
showCharts(charts: ChartModel[]): ChartRef[];
|
|
363
366
|
getChartModels(): ChartModel[];
|
|
367
|
+
private getActiveAdaptableAggFuncForCol;
|
|
368
|
+
private registerAdaptableAggFuncs;
|
|
369
|
+
/**
|
|
370
|
+
* When reading the state from the grid, we have to make sure 'avg' is not overriden with the 'avg' string.
|
|
371
|
+
*/
|
|
372
|
+
private handleUpdateWeightedAvgFromGrid;
|
|
364
373
|
}
|
|
365
374
|
export declare class AdaptableNoCodeWizard implements IAdaptableNoCodeWizard {
|
|
366
375
|
private init;
|