@adaptabletools/adaptable 12.1.5 → 12.1.8-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 +11 -49
- package/bundle.cjs.js +106 -106
- package/index.css +13 -60
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -4
- package/src/AdaptableOptions/ColumnOptions.d.ts +2 -4
- package/src/AdaptableOptions/FilterOptions.d.ts +19 -0
- package/src/AdaptableOptions/FinancePluginOptions.d.ts +22 -1
- package/src/AdaptableOptions/StateOptions.d.ts +25 -12
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +31 -24
- package/src/Api/ColumnApi.d.ts +6 -1
- package/src/Api/ExportApi.d.ts +5 -0
- package/src/Api/FilterApi.d.ts +29 -0
- package/src/Api/FlashingCellApi.d.ts +8 -0
- package/src/Api/GridApi.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -1
- package/src/Api/Implementation/ColumnApiImpl.js +7 -2
- package/src/Api/Implementation/DataSetApiImpl.js +1 -1
- package/src/Api/Implementation/ExportApiImpl.d.ts +3 -1
- package/src/Api/Implementation/ExportApiImpl.js +19 -3
- package/src/Api/Implementation/FilterApiImpl.d.ts +6 -0
- package/src/Api/Implementation/FilterApiImpl.js +42 -4
- package/src/Api/Implementation/FlashingCellApiImpl.d.ts +1 -0
- package/src/Api/Implementation/FlashingCellApiImpl.js +4 -0
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/GridApiImpl.js +4 -4
- package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
- package/src/Api/Implementation/InternalApiImpl.js +0 -3
- package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -1
- package/src/Api/Implementation/LayoutApiImpl.js +4 -3
- package/src/Api/Implementation/PredicateApiImpl.js +4 -0
- package/src/Api/Implementation/QueryApiImpl.js +1 -1
- package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -1
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -1
- package/src/Api/InternalApi.d.ts +0 -1
- package/src/Api/LayoutApi.d.ts +1 -1
- package/src/Api/SystemStatusApi.d.ts +1 -1
- package/src/Api/ToolPanelApi.d.ts +1 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptableColumn.js +3 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +30 -10
- 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/Common/SpecialColumnSettings.d.ts +6 -6
- 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/ActionsReducers/SystemRedux.d.ts +1 -2
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -2
- package/src/Redux/Store/AdaptableStore.js +30 -16
- package/src/Strategy/AlertModule.d.ts +1 -0
- package/src/Strategy/AlertModule.js +20 -0
- package/src/Strategy/CalculatedColumnModule.js +2 -2
- 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/FlashingCellModule.js +2 -2
- package/src/Strategy/Interface/IModule.d.ts +4 -0
- package/src/Strategy/LayoutModule.js +20 -20
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +16 -1
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +15 -11
- 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 +23 -7
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +0 -1
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +6 -54
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +17 -5
- package/src/Utilities/Extensions/ArrayExtensions.js +6 -0
- package/src/Utilities/Helpers/CalendarHelper.js +10 -7
- package/src/Utilities/Helpers/DateHelper.d.ts +0 -26
- package/src/Utilities/Helpers/DateHelper.js +2 -32
- package/src/Utilities/Interface/MessagePopups.d.ts +0 -4
- package/src/Utilities/ObjectFactory.d.ts +6 -4
- package/src/Utilities/ObjectFactory.js +30 -17
- 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 +6 -3
- package/src/Utilities/Services/QueryLanguageService.d.ts +6 -3
- package/src/Utilities/Services/QueryLanguageService.js +23 -6
- package/src/Utilities/Services/ReportService.js +47 -46
- package/src/View/AdaptableView.js +1 -2
- package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingsTags.d.ts +2 -0
- package/src/View/CalculatedColumn/Utilities/{getCalculatedColumnSettingTags.js → getCalculatedColumnSettingsTags.js} +5 -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 +21 -15
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.d.ts +1 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +10 -53
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +14 -3
- package/src/View/Components/AdaptableDateInput/index.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +42 -6
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
- package/src/View/Components/EntityRulesEditor/index.js +26 -5
- package/src/View/Components/FilterForm/FilterForm.js +10 -5
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -0
- package/src/View/Components/FilterForm/QuickFilterForm.js +12 -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/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/Export/ExportViewPanel.d.ts +1 -2
- package/src/View/Export/ExportViewPanel.js +2 -6
- 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/ReportSettingsWizard.js +1 -2
- package/src/View/Filter/FilterViewPanel.js +20 -4
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +1 -1
- 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/agGrid/Adaptable.d.ts +12 -3
- package/src/agGrid/Adaptable.js +225 -152
- 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/components/ExpressionEditor/BaseEditorInput.d.ts +1 -0
- package/src/components/ExpressionEditor/BaseEditorInput.js +2 -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 +26 -5
- package/src/components/ProgressIndicator/ProgressIndicator.js +10 -12
- package/src/metamodel/adaptable.metamodel.d.ts +129 -7
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +1 -1
- 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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.weightedAverage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const StringExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/StringExtensions"));
|
|
6
|
+
const weightedAverage = (params, columnId, weightColumnId) => {
|
|
7
|
+
let weightedColumnValueSum = 0;
|
|
8
|
+
let columnValueSum = 0;
|
|
9
|
+
params.values.forEach((value) => {
|
|
10
|
+
if (!value) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
// when editing values become string
|
|
14
|
+
const rawColumnValue = value[columnId];
|
|
15
|
+
if (typeof rawColumnValue === 'object') {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const columnValue = StringExtensions_1.default.IsNotNullOrEmpty(rawColumnValue)
|
|
19
|
+
? Number(value[columnId])
|
|
20
|
+
: null;
|
|
21
|
+
const rawWeightedColumnValue = value[weightColumnId];
|
|
22
|
+
if (typeof rawWeightedColumnValue === 'object') {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const weightedColumnValue = StringExtensions_1.default.IsNotNullOrEmpty(rawWeightedColumnValue)
|
|
26
|
+
? Number(value[weightColumnId])
|
|
27
|
+
: null;
|
|
28
|
+
if (params.rowNode.leafGroup) {
|
|
29
|
+
if (weightedColumnValue !== null) {
|
|
30
|
+
weightedColumnValueSum += weightedColumnValue;
|
|
31
|
+
}
|
|
32
|
+
if (columnValue !== null && weightedColumnValue !== null) {
|
|
33
|
+
columnValueSum += weightedColumnValue * columnValue;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
if (weightedColumnValue !== null) {
|
|
38
|
+
weightedColumnValueSum += weightedColumnValue;
|
|
39
|
+
}
|
|
40
|
+
if (columnValue !== null) {
|
|
41
|
+
columnValueSum += columnValue;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
toString: () => {
|
|
47
|
+
const rez = columnValueSum / weightedColumnValueSum;
|
|
48
|
+
// 0 / 0 = NaN
|
|
49
|
+
if (isNaN(rez)) {
|
|
50
|
+
return '';
|
|
51
|
+
}
|
|
52
|
+
return rez;
|
|
53
|
+
},
|
|
54
|
+
valueOf: () => {
|
|
55
|
+
const rez = columnValueSum / weightedColumnValueSum;
|
|
56
|
+
// 0 / 0 = NaN
|
|
57
|
+
if (isNaN(rez)) {
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
return rez;
|
|
61
|
+
},
|
|
62
|
+
[columnId]: columnValueSum,
|
|
63
|
+
[weightColumnId]: weightedColumnValueSum,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
exports.weightedAverage = weightedAverage;
|
|
@@ -2,6 +2,7 @@ import { ExpressionFunction, ExpressionFunctionMap } from '../../parser/src/type
|
|
|
2
2
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
3
|
import { CSSProperties } from 'react';
|
|
4
4
|
interface BaseEditorInputProps {
|
|
5
|
+
type: 'main' | 'secondary';
|
|
5
6
|
value: string;
|
|
6
7
|
onChange: (value: string) => void;
|
|
7
8
|
disabled?: boolean;
|
|
@@ -19,7 +19,7 @@ const DocumentationLinkConstants_1 = require("../../Utilities/Constants/Document
|
|
|
19
19
|
const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
|
|
20
20
|
const icons_1 = require("../icons");
|
|
21
21
|
function BaseEditorInput(props) {
|
|
22
|
-
const { expressionFunctions, testData, style } = props;
|
|
22
|
+
const { expressionFunctions, testData, style, type } = props;
|
|
23
23
|
const { ref: textAreaRefCallback, selectionStart, selectionEnd } = useSelectionRange_1.useSelectionRange();
|
|
24
24
|
const cursor = selectionStart === selectionEnd ? selectionStart : null;
|
|
25
25
|
let result;
|
|
@@ -87,7 +87,6 @@ function BaseEditorInput(props) {
|
|
|
87
87
|
props.onSelectedFunctionChange(selectedFunctionName ? expressionFunctions[selectedFunctionName] : null);
|
|
88
88
|
}
|
|
89
89
|
}, [selectedFunctionName]);
|
|
90
|
-
const [functionsDropdownExpanded, setFunctionsDropdownExpanded] = react_1.useState(false);
|
|
91
90
|
const functionsDropdown = (React.createElement(OverlayTrigger_1.default, { render: () => (React.createElement(rebass_1.Flex, { flexDirection: "column", p: 2, style: {
|
|
92
91
|
fontSize: 'var(--ab-font-size-2)',
|
|
93
92
|
border: '1px solid var(--ab-color-primarydark)',
|
|
@@ -124,7 +123,7 @@ function BaseEditorInput(props) {
|
|
|
124
123
|
background: 'var(--ab-color-action-add)',
|
|
125
124
|
marginRight: 5,
|
|
126
125
|
}, tooltip: 'Learn how to use the Expression Editor', onClick: () => window.open(DocumentationLinkConstants_1.ExpressionEditorDocsLink, '_blank') })))),
|
|
127
|
-
React.createElement(Textarea_1.default, { ref: textAreaRefCallback, value: props.value || '', placeholder: props.placeholder || 'Create Query', disabled: props.disabled || false, className: "ab-ExpressionEditor__textarea", autoFocus: true, spellCheck: "false", onChange: (event) => {
|
|
126
|
+
React.createElement(Textarea_1.default, { "data-name": `expression-input-${type}`, ref: textAreaRefCallback, value: props.value || '', placeholder: props.placeholder || 'Create Query', disabled: props.disabled || false, className: "ab-ExpressionEditor__textarea", autoFocus: true, spellCheck: "false", onChange: (event) => {
|
|
128
127
|
props.onChange(event.target.value);
|
|
129
128
|
}, style: Object.assign({ width: '100%', minHeight: 100, fontFamily: 'monospace', resize: 'vertical', fontSize: '1rem', padding: 'var(--ab-space-2)' }, style) }),
|
|
130
129
|
props.isFullExpression !== true && (React.createElement(HelpBlock_1.default, { mt: 2, mb: 2, p: 2, style: { fontSize: 'var(--ab-font-size-3)' } },
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
3
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
4
4
|
interface EditorInputProps {
|
|
5
|
-
type: 'boolean' | 'scalar' | 'aggregatedScalar';
|
|
5
|
+
type: 'boolean' | 'scalar' | 'aggregatedScalar' | 'cumulativeAggregatedScalar';
|
|
6
6
|
module: AdaptableModule;
|
|
7
7
|
value: string;
|
|
8
8
|
onChange: (value: string) => void;
|
|
@@ -7,15 +7,35 @@ const editorButtonsSearch_1 = require("./editorButtonsSearch");
|
|
|
7
7
|
const EditorContext_1 = require("./EditorContext");
|
|
8
8
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
9
9
|
const editorButtonsAggregatedScalar_1 = require("./editorButtonsAggregatedScalar");
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const aggregatedScalarExpressionFunctions_1 = require("../../Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions");
|
|
12
|
+
const editorButtonsCumulativeAggregatedScalar_1 = require("./editorButtonsCumulativeAggregatedScalar");
|
|
10
13
|
function EditorInput(props) {
|
|
11
14
|
const moduleExpressionFunctions = props.api.internalApi
|
|
12
15
|
.getQueryLanguageService()
|
|
13
16
|
.getModuleExpressionFunctions(props.module);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
const getFilteredAggregatedExpressionFunctions = (availableAggregatedExpressionFunctions, type) => {
|
|
18
|
+
const sourceExpressionFunctions = type === 'aggregatedScalar'
|
|
19
|
+
? aggregatedScalarExpressionFunctions_1.aggregatedExpressionFunctions
|
|
20
|
+
: aggregatedScalarExpressionFunctions_1.cumulativeAggregatedExpressionFunctions;
|
|
21
|
+
return Object.keys(availableAggregatedExpressionFunctions)
|
|
22
|
+
.filter((key) => sourceExpressionFunctions.includes(key))
|
|
23
|
+
.reduce((obj, key) => {
|
|
24
|
+
obj[key] = availableAggregatedExpressionFunctions[key];
|
|
25
|
+
return obj;
|
|
26
|
+
}, {});
|
|
27
|
+
};
|
|
28
|
+
const expressionFunctions = react_1.useMemo(() => {
|
|
29
|
+
return props.type === 'aggregatedScalar' || props.type === 'cumulativeAggregatedScalar'
|
|
30
|
+
? getFilteredAggregatedExpressionFunctions(moduleExpressionFunctions.aggregatedScalarFunctions, props.type)
|
|
31
|
+
: Object.assign(Object.assign({}, moduleExpressionFunctions.booleanFunctions), moduleExpressionFunctions.scalarFunctions);
|
|
32
|
+
}, [props.type]);
|
|
17
33
|
const { setSelectedFunction } = EditorContext_1.useExpressionEditor();
|
|
18
34
|
const queryName = `${StringExtensions_1.default.CapitaliseFirstLetter(props.type)}Query`;
|
|
19
|
-
return (React.createElement(BaseEditorInput_1.BaseEditorInput, { value: props.value, placeholder: `Create ${queryName}`, onChange: props.onChange, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: expressionFunctions, editorButtons: props.type === 'aggregatedScalar'
|
|
35
|
+
return (React.createElement(BaseEditorInput_1.BaseEditorInput, { type: 'main', value: props.value, placeholder: `Create ${queryName}`, onChange: props.onChange, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: expressionFunctions, editorButtons: props.type === 'aggregatedScalar'
|
|
36
|
+
? editorButtonsAggregatedScalar_1.editorButtonsAggregatedScalar
|
|
37
|
+
: props.type === 'cumulativeAggregatedScalar'
|
|
38
|
+
? editorButtonsCumulativeAggregatedScalar_1.editorButtonsCumulativeAggregatedScalar
|
|
39
|
+
: editorButtonsSearch_1.editorButtonsSearch, testData: props.testData, isFullExpression: props.isFullExpression, hideResultPreview: props.type === 'aggregatedScalar' || props.type === 'cumulativeAggregatedScalar', api: props.api }));
|
|
20
40
|
}
|
|
21
41
|
exports.default = EditorInput;
|
package/src/components/ExpressionEditor/{EditorInputReactive.d.ts → EditorInputWithWhereClause.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
3
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
4
|
-
interface
|
|
4
|
+
interface EditorInputWithWhereClauseProps {
|
|
5
5
|
type: 'observable' | 'aggregatedBoolean';
|
|
6
6
|
module: AdaptableModule;
|
|
7
7
|
value: string;
|
|
@@ -10,5 +10,5 @@ interface EditorInputReactiveProps {
|
|
|
10
10
|
isFullExpression?: boolean;
|
|
11
11
|
api: AdaptableApi;
|
|
12
12
|
}
|
|
13
|
-
declare function
|
|
14
|
-
export default
|
|
13
|
+
declare function EditorInputWithWhereClause(props: EditorInputWithWhereClauseProps): JSX.Element;
|
|
14
|
+
export default EditorInputWithWhereClause;
|
package/src/components/ExpressionEditor/{EditorInputReactive.js → EditorInputWithWhereClause.js}
RENAMED
|
@@ -8,10 +8,11 @@ const rebass_1 = require("rebass");
|
|
|
8
8
|
const editorButtonsSearch_1 = require("./editorButtonsSearch");
|
|
9
9
|
const useProperty_1 = tslib_1.__importDefault(require("../utils/useProperty"));
|
|
10
10
|
const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
|
|
11
|
-
const
|
|
11
|
+
const editorButtonsObservable_1 = require("./editorButtonsObservable");
|
|
12
12
|
const CheckBox_1 = require("../CheckBox");
|
|
13
13
|
const EditorContext_1 = require("./EditorContext");
|
|
14
|
-
|
|
14
|
+
const editorButtonsAggregatedBoolean_1 = require("./editorButtonsAggregatedBoolean");
|
|
15
|
+
function EditorInputWithWhereClause(props) {
|
|
15
16
|
const moduleExpressionFunctions = props.api.internalApi
|
|
16
17
|
.getQueryLanguageService()
|
|
17
18
|
.getModuleExpressionFunctions(props.module);
|
|
@@ -45,7 +46,7 @@ function EditorInputReactive(props) {
|
|
|
45
46
|
const [showWhereClause, setShowWhereClause] = react_1.useState(StringExtensions_1.IsNotNullOrEmptyOrWhiteSpace(whereClauseValue));
|
|
46
47
|
const queryName = `${StringExtensions_1.CapitaliseFirstLetter(props.type)}Query`;
|
|
47
48
|
return (React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "start" },
|
|
48
|
-
React.createElement(BaseEditorInput_1.BaseEditorInput, { value: reactiveValue || '', placeholder: `Create ${queryName}`, onChange: updateReactiveValue, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: reactiveExpressionFns, editorButtons:
|
|
49
|
+
React.createElement(BaseEditorInput_1.BaseEditorInput, { type: 'main', value: reactiveValue || '', placeholder: `Create ${queryName}`, onChange: updateReactiveValue, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: reactiveExpressionFns, editorButtons: props.type === 'observable' ? editorButtonsObservable_1.editorButtonsObservable : editorButtonsAggregatedBoolean_1.editorButtonsAggregatedBoolean, testData: props.testData, isFullExpression: true, hideResultPreview: true, api: props.api, style: { height: '75px' } }),
|
|
49
50
|
React.createElement(CheckBox_1.CheckBox, { disabled: StringExtensions_1.IsNullOrEmptyOrWhiteSpace(reactiveValue), checked: showWhereClause, style: { alignItems: 'center' }, onChange: (checked) => {
|
|
50
51
|
setShowWhereClause(checked);
|
|
51
52
|
if (!checked) {
|
|
@@ -53,6 +54,6 @@ function EditorInputReactive(props) {
|
|
|
53
54
|
updateWhereClauseValue(null);
|
|
54
55
|
}
|
|
55
56
|
}, pl: 3 }, "WHERE"),
|
|
56
|
-
showWhereClause && (React.createElement(BaseEditorInput_1.BaseEditorInput, { disabled: StringExtensions_1.IsNullOrEmptyOrWhiteSpace(reactiveValue), value: whereClauseValue || '', placeholder: `Create BooleanQuery which narrows down the scope of the ${queryName}`, onChange: updateWhereClauseValue, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: whereClauseExpressionsFns, editorButtons: editorButtonsSearch_1.editorButtonsSearch, testData: props.testData, isFullExpression: true, hideResultPreview: true, api: props.api, style: { height: '75px' } }))));
|
|
57
|
+
showWhereClause && (React.createElement(BaseEditorInput_1.BaseEditorInput, { type: 'secondary', disabled: StringExtensions_1.IsNullOrEmptyOrWhiteSpace(reactiveValue), value: whereClauseValue || '', placeholder: `Create BooleanQuery which narrows down the scope of the ${queryName}`, onChange: updateWhereClauseValue, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: whereClauseExpressionsFns, editorButtons: editorButtonsSearch_1.editorButtonsSearch, testData: props.testData, isFullExpression: true, hideResultPreview: true, api: props.api, style: { height: '75px' } }))));
|
|
57
58
|
}
|
|
58
|
-
exports.default =
|
|
59
|
+
exports.default = EditorInputWithWhereClause;
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.editorButtonsAggregatedBoolean = void 0;
|
|
4
|
+
exports.editorButtonsAggregatedBoolean = [
|
|
5
5
|
{
|
|
6
6
|
functionName: 'SUM',
|
|
7
7
|
data: 'SUM()',
|
|
8
8
|
text: 'Sum',
|
|
9
9
|
},
|
|
10
|
+
{
|
|
11
|
+
functionName: 'MIN',
|
|
12
|
+
data: 'MIN()',
|
|
13
|
+
text: 'Min',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
functionName: 'MAX',
|
|
17
|
+
data: 'MAX()',
|
|
18
|
+
text: 'Max',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
functionName: 'AVG',
|
|
22
|
+
data: 'AVG()',
|
|
23
|
+
text: 'Average',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
functionName: 'GROUP_BY',
|
|
27
|
+
data: 'GROUP_BY()',
|
|
28
|
+
text: 'GroupBy',
|
|
29
|
+
},
|
|
10
30
|
{
|
|
11
31
|
functionName: 'EQ',
|
|
12
32
|
data: '=',
|
|
@@ -37,39 +57,4 @@ exports.editorButtonsReactive = [
|
|
|
37
57
|
data: '>=',
|
|
38
58
|
icon: 'greater-than-or-equal',
|
|
39
59
|
},
|
|
40
|
-
{
|
|
41
|
-
functionName: 'ROW_CHANGE',
|
|
42
|
-
data: 'ROW_CHANGE()',
|
|
43
|
-
text: 'RowChange',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
functionName: 'GRID_CHANGE',
|
|
47
|
-
data: 'GRID_CHANGE()',
|
|
48
|
-
text: 'GridChange',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
functionName: 'COUNT',
|
|
52
|
-
data: 'COUNT()',
|
|
53
|
-
text: 'Count',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
functionName: 'NONE',
|
|
57
|
-
data: 'NONE()',
|
|
58
|
-
text: 'None',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
functionName: 'MIN',
|
|
62
|
-
data: 'MIN()',
|
|
63
|
-
text: 'Min',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
functionName: 'MAX',
|
|
67
|
-
data: 'MAX()',
|
|
68
|
-
text: 'Max',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
functionName: 'TIMEFRAME',
|
|
72
|
-
data: 'TIMEFRAME()',
|
|
73
|
-
text: 'Timeframe',
|
|
74
|
-
},
|
|
75
60
|
];
|
|
@@ -32,19 +32,14 @@ exports.editorButtonsAggregatedScalar = [
|
|
|
32
32
|
data: 'QUANT()',
|
|
33
33
|
text: 'Quantile',
|
|
34
34
|
},
|
|
35
|
+
{
|
|
36
|
+
functionName: 'WEIGHT',
|
|
37
|
+
data: 'WEIGHT()',
|
|
38
|
+
text: 'Weight',
|
|
39
|
+
},
|
|
35
40
|
{
|
|
36
41
|
functionName: 'GROUP_BY',
|
|
37
42
|
data: 'GROUP_BY()',
|
|
38
43
|
text: 'GroupBy',
|
|
39
44
|
},
|
|
40
|
-
{
|
|
41
|
-
functionName: 'CUMUL',
|
|
42
|
-
data: 'CUMUL()',
|
|
43
|
-
text: 'Cumulate',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
functionName: 'OVER',
|
|
47
|
-
data: 'OVER()',
|
|
48
|
-
text: 'Over',
|
|
49
|
-
},
|
|
50
45
|
];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editorButtonsCumulativeAggregatedScalar = void 0;
|
|
4
|
+
exports.editorButtonsCumulativeAggregatedScalar = [
|
|
5
|
+
{
|
|
6
|
+
functionName: 'CUMUL',
|
|
7
|
+
data: 'CUMUL()',
|
|
8
|
+
text: 'Cumulate',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
functionName: 'SUM',
|
|
12
|
+
data: 'SUM()',
|
|
13
|
+
text: 'Sum',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
functionName: 'PERCENTAGE',
|
|
17
|
+
data: 'PERCENTAGE()',
|
|
18
|
+
text: 'Percentage',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
functionName: 'AVG',
|
|
22
|
+
data: 'AVG()',
|
|
23
|
+
text: 'Average',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
functionName: 'MIN',
|
|
27
|
+
data: 'MIN()',
|
|
28
|
+
text: 'Min',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
functionName: 'MAX',
|
|
32
|
+
data: 'MAX()',
|
|
33
|
+
text: 'Max',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
functionName: 'OVER',
|
|
37
|
+
data: 'OVER()',
|
|
38
|
+
text: 'Over',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
functionName: 'WEIGHT',
|
|
42
|
+
data: 'WEIGHT()',
|
|
43
|
+
text: 'Weight',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
functionName: 'GROUP_BY',
|
|
47
|
+
data: 'GROUP_BY()',
|
|
48
|
+
text: 'GroupBy',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editorButtonsObservable = void 0;
|
|
4
|
+
exports.editorButtonsObservable = [
|
|
5
|
+
{
|
|
6
|
+
functionName: 'ROW_CHANGE',
|
|
7
|
+
data: 'ROW_CHANGE()',
|
|
8
|
+
text: 'RowChange',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
functionName: 'GRID_CHANGE',
|
|
12
|
+
data: 'GRID_CHANGE()',
|
|
13
|
+
text: 'GridChange',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
functionName: 'COUNT',
|
|
17
|
+
data: 'COUNT()',
|
|
18
|
+
text: 'Count',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
functionName: 'NONE',
|
|
22
|
+
data: 'NONE()',
|
|
23
|
+
text: 'None',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
functionName: 'MIN',
|
|
27
|
+
data: 'MIN()',
|
|
28
|
+
text: 'Min',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
functionName: 'MAX',
|
|
32
|
+
data: 'MAX()',
|
|
33
|
+
text: 'Max',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
functionName: 'TIMEFRAME',
|
|
37
|
+
data: 'TIMEFRAME()',
|
|
38
|
+
text: 'Timeframe',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AdaptableApi, AdaptableColumn, AdaptableModule } from '../../types';
|
|
3
3
|
import { NamedQuery } from '../../PredefinedConfig/QueryState';
|
|
4
|
-
declare type ExpressionEditorType = 'boolean' | 'scalar' | 'observable' | 'aggregatedBoolean' | 'aggregatedScalar';
|
|
4
|
+
declare type ExpressionEditorType = 'boolean' | 'scalar' | 'observable' | 'aggregatedBoolean' | 'aggregatedScalar' | 'cumulativeAggregatedScalar';
|
|
5
5
|
interface ExpressionEditorProps {
|
|
6
6
|
value: string;
|
|
7
7
|
onChange: (value: string) => void;
|
|
@@ -13,7 +13,7 @@ const EditorButton_1 = tslib_1.__importDefault(require("./EditorButton"));
|
|
|
13
13
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../../View/Components/AdaptableInput"));
|
|
14
14
|
const Radio_1 = tslib_1.__importDefault(require("../Radio"));
|
|
15
15
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
|
|
16
|
-
const
|
|
16
|
+
const EditorInputWithWhereClause_1 = tslib_1.__importDefault(require("./EditorInputWithWhereClause"));
|
|
17
17
|
const EditorInput_1 = tslib_1.__importDefault(require("./EditorInput"));
|
|
18
18
|
const EditorContext_1 = require("./EditorContext");
|
|
19
19
|
const ExpressionFunctionDocumentation_1 = require("./ExpressionFunctionDocumentation");
|
|
@@ -24,6 +24,7 @@ const CodeBlock_1 = require("../CodeBlock");
|
|
|
24
24
|
const NamedQueryContext_1 = require("./NamedQueryContext");
|
|
25
25
|
const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
|
|
26
26
|
const DateHelper_1 = require("../../Utilities/Helpers/DateHelper");
|
|
27
|
+
const AdaptableFormControlTextClear_1 = require("../../View/Components/Forms/AdaptableFormControlTextClear");
|
|
27
28
|
function ExpressionEditor(props) {
|
|
28
29
|
var _a;
|
|
29
30
|
const { type, module } = props;
|
|
@@ -35,11 +36,11 @@ function ExpressionEditor(props) {
|
|
|
35
36
|
const { namedQuery, setNamedQuery } = NamedQueryContext_1.useNamedQueryContext();
|
|
36
37
|
const textAreaRef = react_1.useRef(null);
|
|
37
38
|
const allowSaveNamedQuery = (_a = props.allowSaveNamedQuery) !== null && _a !== void 0 ? _a : type === 'boolean';
|
|
38
|
-
const editorInput = type === 'observable' || type === 'aggregatedBoolean' ? (React.createElement(
|
|
39
|
+
const editorInput = type === 'observable' || type === 'aggregatedBoolean' ? (React.createElement(EditorInputWithWhereClause_1.default, { type: type, module: module, value: props.value, onChange: (value) => {
|
|
39
40
|
setExpressionText(value);
|
|
40
41
|
props.onChange(value);
|
|
41
42
|
}, testData: data, api: props.api })) : (
|
|
42
|
-
// 'boolean','scalar' or 'aggregatedScalar'
|
|
43
|
+
// 'boolean','scalar' or 'aggregatedScalar'/'cumulativeAggregatedScalar'
|
|
43
44
|
React.createElement(EditorInput_1.default, { type: type, module: module, value: props.value, onChange: (value) => {
|
|
44
45
|
setExpressionText(value);
|
|
45
46
|
props.onChange(value);
|
|
@@ -99,6 +100,7 @@ function ExpressionEditor(props) {
|
|
|
99
100
|
? new Date(colValue).toISOString().substr(0, 10)
|
|
100
101
|
: '';
|
|
101
102
|
};
|
|
103
|
+
const [searchInputValue, setSearchInputValue] = React.useState('');
|
|
102
104
|
const dataTableEditor = (React.createElement(React.Fragment, null,
|
|
103
105
|
React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "start", style: { marginTop: 2 } },
|
|
104
106
|
React.createElement(CheckBox_1.CheckBox, { checked: showColumnIds, onChange: (checked) => setShowColumnIds(checked), style: {
|
|
@@ -106,8 +108,17 @@ function ExpressionEditor(props) {
|
|
|
106
108
|
margin: 0,
|
|
107
109
|
paddingTop: 'var(--ab-space-1)',
|
|
108
110
|
paddingBottom: 'var(--ab-space-1)',
|
|
109
|
-
} }, 'Show Column IDs')
|
|
110
|
-
|
|
111
|
+
} }, 'Show Column IDs'),
|
|
112
|
+
React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Filter columns...", style: { flex: 1, marginBottom: 3 } })),
|
|
113
|
+
React.createElement(FormLayout_1.default, { className: "ab-ExpressionEditor__columns", gridColumnGap: "var(--ab-space-1)", gridRowGap: "var(--ab-space-1)", sizes: ['auto', '100px'], style: { alignItems: 'stretch' } }, queryableColumns
|
|
114
|
+
.filter((column) => {
|
|
115
|
+
if (!searchInputValue) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
return (column.columnId.includes(searchInputValue) ||
|
|
119
|
+
column.friendlyName.includes(searchInputValue));
|
|
120
|
+
})
|
|
121
|
+
.map((column) => (React.createElement(FormLayout_1.FormRow, { key: column.columnId, label: React.createElement(EditorButton_1.default, { width: "100%", height: "100%", style: {
|
|
111
122
|
background: 'var(--ab-color-primary)',
|
|
112
123
|
cursor: 'grab',
|
|
113
124
|
marginRight: 'var(--ab-space-1)',
|
|
@@ -219,6 +230,15 @@ const renderQueryHints = (type) => {
|
|
|
219
230
|
examples.push({
|
|
220
231
|
code: 'AVG([stargazers_count], GROUP_BY([language]))',
|
|
221
232
|
description: 'Average popularity (number of stars) of all the Github repositories, grouped by programming language',
|
|
233
|
+
}, {
|
|
234
|
+
code: 'MAX([PnL]), GROUP_BY([currency], [country])',
|
|
235
|
+
description: "The maximum 'PnL' value, grouped by currency and country",
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
if (type === 'cumulativeAggregatedScalar') {
|
|
239
|
+
examples.push({
|
|
240
|
+
code: 'CUMUL(AVG([stargazers_count], GROUP_BY([language])), OVER([TradeDate]))',
|
|
241
|
+
description: "The cumulative average popularity (number of stars) of all the Github repositories, grouped by programming language in the order given by the 'TradeDate' column",
|
|
222
242
|
}, {
|
|
223
243
|
code: 'CUMUL( SUM([PnL]), OVER([TradeDate]))',
|
|
224
244
|
description: "The cumulative sum of all 'PnL' columns in the order given by the 'TradeDate' column",
|
|
@@ -247,4 +267,5 @@ const queryDocumentationLinks = {
|
|
|
247
267
|
observable: DocumentationLinkConstants_1.ObservableQueryDocsLink,
|
|
248
268
|
aggregatedBoolean: DocumentationLinkConstants_1.AggregatedBooleanQueryDocsLink,
|
|
249
269
|
aggregatedScalar: DocumentationLinkConstants_1.AggregatedScalarQueryDocsLink,
|
|
270
|
+
cumulativeAggregatedScalar: DocumentationLinkConstants_1.CumulativeAggregatedScalarQueryDocsLink,
|
|
250
271
|
};
|
|
@@ -17,31 +17,29 @@ const ProgressIndicator = () => {
|
|
|
17
17
|
width: 0,
|
|
18
18
|
});
|
|
19
19
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
20
|
-
const
|
|
21
|
-
const gridContainerRef = react_1.useRef(adaptable.getAgGridContainerElement());
|
|
22
|
-
const disableAdaptableGrid = (elemRef, disabled) => {
|
|
20
|
+
const disableAdaptableGrid = (containerElement, disabled) => {
|
|
23
21
|
const DISABLING_CSS_CLASS = 'ab-wait-for-progress-indicator';
|
|
24
|
-
if (!
|
|
22
|
+
if (!containerElement) {
|
|
25
23
|
return;
|
|
26
24
|
}
|
|
27
25
|
if (disabled) {
|
|
28
|
-
|
|
26
|
+
containerElement.classList.add(DISABLING_CSS_CLASS);
|
|
29
27
|
}
|
|
30
28
|
else {
|
|
31
|
-
|
|
29
|
+
containerElement.classList.remove(DISABLING_CSS_CLASS);
|
|
32
30
|
}
|
|
33
31
|
};
|
|
34
|
-
const updateGridContainerCoordinates = () => {
|
|
35
|
-
if (!
|
|
32
|
+
const updateGridContainerCoordinates = (containerElement) => {
|
|
33
|
+
if (!containerElement) {
|
|
36
34
|
return;
|
|
37
35
|
}
|
|
38
|
-
const { top, left, height, width } =
|
|
36
|
+
const { top, left, height, width } = containerElement.getBoundingClientRect();
|
|
39
37
|
setProgressIndicatorCoordinates({ top, left, height, width });
|
|
40
38
|
};
|
|
41
39
|
react_1.useEffect(() => {
|
|
42
|
-
disableAdaptableGrid(
|
|
43
|
-
disableAdaptableGrid(
|
|
44
|
-
updateGridContainerCoordinates();
|
|
40
|
+
disableAdaptableGrid(adaptable.getAdaptableContainerElement(), active);
|
|
41
|
+
disableAdaptableGrid(adaptable.getAgGridContainerElement(), active);
|
|
42
|
+
updateGridContainerCoordinates(adaptable.getAdaptableContainerElement());
|
|
45
43
|
// without RAF the progress indicator would be rendered instantly, without the 'transition-delay' defined via CSS
|
|
46
44
|
requestAnimationFrame(() => {
|
|
47
45
|
setVisible(active);
|