@adaptabletools/adaptable 12.0.9 → 12.1.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 +231 -120
- package/bundle.cjs.js +142 -114
- package/index.css +268 -130
- package/package.json +3 -3
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +1 -2
- package/src/Api/ColumnApi.d.ts +5 -0
- package/src/Api/FilterApi.d.ts +15 -1
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +2 -3
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ColumnApiImpl.js +10 -0
- package/src/Api/Implementation/FilterApiImpl.d.ts +6 -1
- package/src/Api/Implementation/FilterApiImpl.js +58 -0
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -1
- package/src/Api/Implementation/LayoutApiImpl.js +8 -16
- package/src/Api/Implementation/ScheduleApiImpl.js +4 -1
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +7 -2
- package/src/PredefinedConfig/LayoutState.d.ts +2 -0
- package/src/PredefinedConfig/ScheduleState.d.ts +4 -0
- package/src/Redux/Store/AdaptableStore.js +11 -5
- package/src/Strategy/AlertModule.js +2 -2
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/ExportModule.js +2 -2
- package/src/Strategy/FlashingCellModule.js +3 -3
- package/src/Strategy/FormatColumnModule.js +2 -2
- package/src/Strategy/LayoutModule.js +10 -17
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/Utilities/{getAlertBehaviourViewItems.d.ts → Alert/getAlertBehaviourViewItems.d.ts} +0 -0
- package/src/Strategy/Utilities/{getAlertBehaviourViewItems.js → Alert/getAlertBehaviourViewItems.js} +2 -2
- package/src/Strategy/Utilities/{getAlertPreviewViewItems.d.ts → Alert/getAlertPreviewViewItems.d.ts} +2 -2
- package/src/Strategy/Utilities/{getAlertPreviewViewItems.js → Alert/getAlertPreviewViewItems.js} +2 -2
- package/src/Strategy/Utilities/{getCustomSortColumnViewItems.d.ts → CustomSort/getCustomSortColumnViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getCustomSortColumnViewItems.js → CustomSort/getCustomSortColumnViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getCustomSortSortOrderViewItems.d.ts → CustomSort/getCustomSortSortOrderViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getCustomSortSortOrderViewItems.js → CustomSort/getCustomSortSortOrderViewItems.js} +0 -0
- package/src/Strategy/Utilities/Export/getExportColumnsViewItems.d.ts +3 -0
- package/src/Strategy/Utilities/{getExportColumnsViewItems.js → Export/getExportColumnsViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getExportRowsViewItems.d.ts → Export/getExportRowsViewItems.d.ts} +0 -0
- package/src/Strategy/Utilities/{getExportRowsViewItems.js → Export/getExportRowsViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getFlashingCellDurationViewItems.d.ts → FlashingCell/getFlashingCellDurationViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getFlashingCellDurationViewItems.js → FlashingCell/getFlashingCellDurationViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getFlashingCellStyleViewItems.d.ts → FlashingCell/getFlashingCellStyleViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getFlashingCellStyleViewItems.js → FlashingCell/getFlashingCellStyleViewItems.js} +1 -1
- package/src/Strategy/Utilities/{getFlashingTargetViewItems.d.ts → FlashingCell/getFlashingTargetViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getFlashingTargetViewItems.js → FlashingCell/getFlashingTargetViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getFormatColumnSettingsViewItems.d.ts → FormatColumn/getFormatColumnSettingsViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getFormatColumnSettingsViewItems.js → FormatColumn/getFormatColumnSettingsViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getFormatColumnStyleViewItems.d.ts → FormatColumn/getFormatColumnStyleViewItems.d.ts} +0 -0
- package/src/Strategy/Utilities/{getFormatColumnStyleViewItems.js → FormatColumn/getFormatColumnStyleViewItems.js} +1 -1
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.d.ts +5 -0
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +24 -0
- package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.d.ts +5 -0
- package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.js +14 -0
- package/src/Strategy/Utilities/{getShortcutSettingsViewItems.d.ts → Shortcut/getShortcutSettingsViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getShortcutSettingsViewItems.js → Shortcut/getShortcutSettingsViewItems.js} +0 -0
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +4 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +134 -0
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +6 -6
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +12 -11
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +24 -1
- package/src/View/AdaptableView.js +3 -2
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.d.ts +27 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +46 -36
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +5 -4
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +4 -2
- package/src/View/Components/Popups/AdaptableToaster.js +16 -33
- package/src/View/Components/ValueSelector/index.d.ts +10 -1
- package/src/View/Components/ValueSelector/index.js +16 -8
- package/src/View/FormatColumn/FormatColumnSummary.js +2 -1
- package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
- package/src/View/Layout/Wizard/LayoutWizard.d.ts +4 -7
- package/src/View/Layout/Wizard/LayoutWizard.js +127 -13
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +102 -0
- package/src/View/Layout/Wizard/sections/ColumnsSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +226 -0
- package/src/View/Layout/Wizard/sections/FilterSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/FilterSection.js +35 -0
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +39 -0
- package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +46 -0
- package/src/View/Layout/Wizard/sections/SettingsSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/SettingsSection.js +51 -0
- package/src/View/Layout/Wizard/sections/SortSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/SortSection.js +69 -0
- package/src/View/Layout/Wizard/sections/Utilities.d.ts +2 -0
- package/src/View/Layout/Wizard/sections/Utilities.js +5 -0
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +7 -2
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +2 -2
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +4 -0
- package/src/View/StatusBar/StatusBarPanel.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -0
- package/src/View/Wizard/OnePageAdaptableWizard.js +3 -3
- package/src/View/Wizard/OnePageWizards.d.ts +1 -0
- package/src/View/Wizard/OnePageWizards.js +1 -1
- package/src/agGrid/Adaptable.d.ts +2 -0
- package/src/agGrid/Adaptable.js +33 -9
- package/src/agGrid/agGridHelper.js +11 -1
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -0
- package/src/components/ExpressionEditor/index.js +1 -1
- package/src/components/Tabs/index.js +4 -2
- package/src/components/icons/arrow-down-long.d.ts +3 -0
- package/src/components/icons/arrow-down-long.js +7 -0
- package/src/components/icons/arrow-up-long.d.ts +3 -0
- package/src/components/icons/arrow-up-long.js +7 -0
- package/src/components/icons/index.js +4 -0
- package/src/metamodel/adaptable.metamodel.d.ts +9 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/Strategy/Utilities/getExportColumnsViewItems.d.ts +0 -3
- package/src/View/Layout/LayoutEntityRow.d.ts +0 -13
- package/src/View/Layout/LayoutEntityRow.js +0 -23
- package/src/View/Layout/LayoutPopup.d.ts +0 -32
- package/src/View/Layout/LayoutPopup.js +0 -153
|
File without changes
|
package/src/Strategy/Utilities/{getExportColumnsViewItems.js → Export/getExportColumnsViewItems.js}
RENAMED
|
File without changes
|
package/src/Strategy/Utilities/{getExportRowsViewItems.d.ts → Export/getExportRowsViewItems.d.ts}
RENAMED
|
File without changes
|
package/src/Strategy/Utilities/{getExportRowsViewItems.js → Export/getExportRowsViewItems.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AdaptableObjectItemView } from '
|
|
1
|
+
import { AdaptableObjectItemView } from '../../Interface/IModule';
|
|
2
2
|
export declare const getFlashingCellStyleViewItems: () => AdaptableObjectItemView;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFlashingCellStyleViewItems = void 0;
|
|
4
|
-
const FlashingCellStyle_1 = require("
|
|
4
|
+
const FlashingCellStyle_1 = require("../../../View/FlashingCell/FlashingCellStyle");
|
|
5
5
|
const getFlashingCellStyleViewItems = () => {
|
|
6
6
|
return {
|
|
7
7
|
name: 'Flash Styles',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlashingCellDefinition } from '../../../types';
|
|
2
2
|
export declare const getFlashingTargetViewItems: (flashingCell: FlashingCellDefinition) => {
|
|
3
3
|
name: string;
|
|
4
|
-
values: import("
|
|
4
|
+
values: import("../../../PredefinedConfig/FlashingCellState").FlashTargetTypes[];
|
|
5
5
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ exports.getFormatColumnStyleViewItems = 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");
|
|
7
|
-
const FormatColumnStyleWizardSection_1 = require("
|
|
7
|
+
const FormatColumnStyleWizardSection_1 = require("../../../View/FormatColumn/Wizard/FormatColumnStyleWizardSection");
|
|
8
8
|
const getFormatColumnStyleViewItems = (formatColumn, api) => {
|
|
9
9
|
return React.createElement(rebass_1.Box, { mt: 2 }, FormatColumnStyleWizardSection_1.renderFormatColumnStyleSummary(formatColumn, api));
|
|
10
10
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLayoutFilterViewItems = void 0;
|
|
4
|
+
const getLayoutFilterViewItems = (layout, api) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const columnIdToFriendlyName = (columnId) => {
|
|
7
|
+
return api.columnApi.getFriendlyNameFromColumnId(columnId);
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
name: 'Filter',
|
|
11
|
+
values: ((_a = layout.ColumnFilters) !== null && _a !== void 0 ? _a : []).map((customFilter) => `[${columnIdToFriendlyName(customFilter.ColumnId)}: ${customFilter.Predicate.PredicateId} ${customFilter.Predicate.Inputs.map((input) => {
|
|
12
|
+
if (typeof input === 'string') {
|
|
13
|
+
return input;
|
|
14
|
+
}
|
|
15
|
+
if (typeof (input === null || input === void 0 ? void 0 : input.toString) === 'function') {
|
|
16
|
+
return input.toString();
|
|
17
|
+
}
|
|
18
|
+
return '';
|
|
19
|
+
})
|
|
20
|
+
.filter(Boolean)
|
|
21
|
+
.join(', ')}]`),
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.getLayoutFilterViewItems = getLayoutFilterViewItems;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLayoutSortViewItems = void 0;
|
|
4
|
+
const getLayoutSortViewItems = (layout, api) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const columnIdToFriendlyName = (columnId) => {
|
|
7
|
+
return api.columnApi.getFriendlyNameFromColumnId(columnId);
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
name: 'Sort',
|
|
11
|
+
values: ((_a = layout.ColumnSorts) !== null && _a !== void 0 ? _a : []).map((customSort) => `[${columnIdToFriendlyName(customSort.ColumnId)}: ${customSort.SortOrder}]`),
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
exports.getLayoutSortViewItems = getLayoutSortViewItems;
|
|
File without changes
|
|
@@ -6,7 +6,7 @@ import { AggregateParams } from './scalarAggregationHelper';
|
|
|
6
6
|
* List of all the AggregatedScalar Functions available in AdaptableQL
|
|
7
7
|
*/
|
|
8
8
|
export declare type AggregatedScalarFunctionName = AggregationFunction | OperandFunction;
|
|
9
|
-
declare type AggregationFunction = 'SUM' | 'PERCENTAGE' | 'AVG' | 'MIN' | 'MAX' | 'CUMUL';
|
|
9
|
+
declare type AggregationFunction = 'SUM' | 'PERCENTAGE' | 'QUANT' | 'AVG' | 'MIN' | 'MAX' | 'CUMUL';
|
|
10
10
|
declare type OperandFunction = 'COL' | 'OVER' | 'GROUP_BY';
|
|
11
11
|
export interface AggregationParameter extends BaseParameter<'aggregation', AggregationFunction> {
|
|
12
12
|
value: AggregatedScalarExpressionEvaluation;
|
|
@@ -19,9 +19,11 @@ export interface GroupByParameter extends BaseParameter<'operand', 'GROUP_BY'> {
|
|
|
19
19
|
}
|
|
20
20
|
export interface AggregatedScalarExpressionEvaluation {
|
|
21
21
|
aggregationParams: AggregateParams<any, string | number>;
|
|
22
|
-
rowValueGetter?: (rowNode: RowNode,
|
|
22
|
+
rowValueGetter?: (rowNode: RowNode, aggregatedValue: any) => string | number | Date | boolean;
|
|
23
23
|
columnDependencies: string[];
|
|
24
24
|
cumulateOver?: string;
|
|
25
|
+
sortByColumn?: string;
|
|
26
|
+
filterUndefinedValues?: boolean;
|
|
25
27
|
}
|
|
26
28
|
export declare const aggregatedScalarExpressionFunctions: Record<AggregatedScalarFunctionName, ExpressionFunction>;
|
|
27
29
|
export {};
|
|
@@ -114,6 +114,140 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
114
114
|
'PERCENTAGE( [colNameA], SUM ( [colNameB], GROUP_BY( [colNameC] )))',
|
|
115
115
|
],
|
|
116
116
|
},
|
|
117
|
+
QUANT: {
|
|
118
|
+
handler(args, context) {
|
|
119
|
+
var _a, _b, _c;
|
|
120
|
+
const quantileColumnParameter = expressionFunctionUtils_1.extractColumnParameter('QUANT', args);
|
|
121
|
+
const quantileColumnName = quantileColumnParameter.value;
|
|
122
|
+
expressionFunctionUtils_1.validateColumnType(quantileColumnName, ['Number'], 'QUANT', context.adaptableApi);
|
|
123
|
+
const qNumber = args.find((arg) => typeof arg === 'number');
|
|
124
|
+
if (qNumber == null || qNumber <= 0) {
|
|
125
|
+
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('QUANT', 'expects a positive number as argument');
|
|
126
|
+
}
|
|
127
|
+
const groupByOperand = expressionFunctionUtils_1.extractParameter('QUANT', 'operand', ['GROUP_BY'], args, true);
|
|
128
|
+
const groupByColumnName = groupByOperand === null || groupByOperand === void 0 ? void 0 : groupByOperand.value;
|
|
129
|
+
let quantReducer;
|
|
130
|
+
if (groupByColumnName) {
|
|
131
|
+
// do the heavy-lifting in done()
|
|
132
|
+
quantReducer = {
|
|
133
|
+
initialValue: new WeakMap(),
|
|
134
|
+
reducer: (nodeValueMap, rowValue, rowNode, rowIndex) => {
|
|
135
|
+
if (!rowValue) {
|
|
136
|
+
return nodeValueMap;
|
|
137
|
+
}
|
|
138
|
+
nodeValueMap.set(rowNode, rowValue);
|
|
139
|
+
return nodeValueMap;
|
|
140
|
+
},
|
|
141
|
+
done: (nodeValueMap, groupItems) => {
|
|
142
|
+
var _a, _b;
|
|
143
|
+
const populationSize = (_b = (_a = groupItems === null || groupItems === void 0 ? void 0 : groupItems.filter((rowNode) => {
|
|
144
|
+
const rowValue = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, quantileColumnName);
|
|
145
|
+
return rowValue != undefined;
|
|
146
|
+
})) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
147
|
+
const bucketsMap = new Map();
|
|
148
|
+
for (let step = 1; step <= qNumber; step++) {
|
|
149
|
+
bucketsMap.set(step, populationSize * (step / qNumber));
|
|
150
|
+
}
|
|
151
|
+
const indexBucketMap = new Map();
|
|
152
|
+
for (let populationIndex = 0; populationIndex < populationSize; populationIndex++) {
|
|
153
|
+
for (let quantIndex = 1; quantIndex <= qNumber; quantIndex++) {
|
|
154
|
+
if (bucketsMap.get(quantIndex) < populationIndex + 1) {
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
indexBucketMap.set(populationIndex, quantIndex);
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const groupedRowBucketMap = new Map();
|
|
164
|
+
groupItems.forEach((subgroupRowNode, subgroupRowIndex) => {
|
|
165
|
+
const subgroupRowValue = nodeValueMap.get(subgroupRowNode);
|
|
166
|
+
if (subgroupRowValue) {
|
|
167
|
+
groupedRowBucketMap.set(subgroupRowValue, indexBucketMap.get(subgroupRowIndex));
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
return groupedRowBucketMap;
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
// in case of non-grouped quantiles, we are able to calculate the buckets beforehand (which is the most efficient)
|
|
176
|
+
const populationSize = (_c = (_b = (_a = context.adaptableApi.gridApi.getAllRowNodes()) === null || _a === void 0 ? void 0 : _a.filter((rowNode) => {
|
|
177
|
+
const rowValue = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, quantileColumnName);
|
|
178
|
+
return rowValue != undefined;
|
|
179
|
+
})) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
|
|
180
|
+
const bucketsMap = new Map();
|
|
181
|
+
for (let step = 1; step <= qNumber; step++) {
|
|
182
|
+
bucketsMap.set(step, populationSize * (step / qNumber));
|
|
183
|
+
}
|
|
184
|
+
const indexBucketMap = new Map();
|
|
185
|
+
for (let populationIndex = 0; populationIndex < populationSize; populationIndex++) {
|
|
186
|
+
for (let quantIndex = 1; quantIndex <= qNumber; quantIndex++) {
|
|
187
|
+
if (bucketsMap.get(quantIndex) < populationIndex + 1) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
indexBucketMap.set(populationIndex, quantIndex);
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
quantReducer = {
|
|
197
|
+
initialValue: new Map(),
|
|
198
|
+
reducer: (rowBucketMap, rowValue, rowNode, rowIndex) => {
|
|
199
|
+
if (!rowValue) {
|
|
200
|
+
return rowBucketMap;
|
|
201
|
+
}
|
|
202
|
+
rowBucketMap.set(rowValue, indexBucketMap.get(rowIndex));
|
|
203
|
+
return rowBucketMap;
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
const aggregationExpressionEvaluation = {
|
|
208
|
+
sortByColumn: quantileColumnName,
|
|
209
|
+
filterUndefinedValues: true,
|
|
210
|
+
aggregationParams: {
|
|
211
|
+
reducers: {
|
|
212
|
+
QUANT: Object.assign({ name: 'QUANT', field: quantileColumnName }, quantReducer),
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
rowValueGetter: (rowNode, rowBucketMap) => {
|
|
216
|
+
const rowValue = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, quantileColumnName);
|
|
217
|
+
if (rowValue == null) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
return rowBucketMap.get(rowValue);
|
|
221
|
+
},
|
|
222
|
+
columnDependencies: [quantileColumnName],
|
|
223
|
+
};
|
|
224
|
+
if (groupByColumnName) {
|
|
225
|
+
aggregationExpressionEvaluation.aggregationParams.groupBy = [
|
|
226
|
+
{
|
|
227
|
+
field: groupByColumnName,
|
|
228
|
+
},
|
|
229
|
+
];
|
|
230
|
+
aggregationExpressionEvaluation.columnDependencies.push(groupByColumnName);
|
|
231
|
+
}
|
|
232
|
+
const result = {
|
|
233
|
+
name: 'QUANT',
|
|
234
|
+
type: 'aggregation',
|
|
235
|
+
value: aggregationExpressionEvaluation,
|
|
236
|
+
};
|
|
237
|
+
return result;
|
|
238
|
+
},
|
|
239
|
+
description: 'Calculates the q-Quantiles of the given group and displays which q-quantile the given value is in\nCommon quantiles are 4-quantile or Quartile, 5-quantile or Quintile, 10-quantile or Decile and 100-quantile or Percentile',
|
|
240
|
+
signatures: [
|
|
241
|
+
'QUANT( [colName], q: number)',
|
|
242
|
+
'QUANT( COL(name: string), q: number)',
|
|
243
|
+
'QUANT( [colName1], q: number, GROUP_BY([colName2]) )',
|
|
244
|
+
],
|
|
245
|
+
examples: [
|
|
246
|
+
'QUANT( [col1], 5)',
|
|
247
|
+
`QUANT( COL('col1'), 100))`,
|
|
248
|
+
'QUANT( [col1], 4, GROUP_BY([col2]) )',
|
|
249
|
+
],
|
|
250
|
+
},
|
|
117
251
|
AVG: {
|
|
118
252
|
handler(args, context) {
|
|
119
253
|
const avgColumnParameter = expressionFunctionUtils_1.extractColumnParameter('AVG', args);
|
|
@@ -14,7 +14,7 @@ export declare type DataAggregationReducer<T, AggregationResultType> = {
|
|
|
14
14
|
field?: keyof T & string;
|
|
15
15
|
initialValue?: AggregationResultType;
|
|
16
16
|
getter?: (data: T) => any;
|
|
17
|
-
reducer: string | ((accumulator: any, value: any, data: T) => AggregationResultType | any);
|
|
17
|
+
reducer: string | ((accumulator: any, value: any, data: T, dataIndex: number) => AggregationResultType | any);
|
|
18
18
|
done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
|
|
19
19
|
};
|
|
20
20
|
export declare type DataAggregationResult<DataType, KeyType extends any> = {
|
|
@@ -28,11 +28,11 @@ function aggregate(aggregateParams, data) {
|
|
|
28
28
|
const { items: currentGroupItems, reducerResults } = deepMap.get(currentGroupKeys);
|
|
29
29
|
currentGroupItems.push(item);
|
|
30
30
|
if (reducers) {
|
|
31
|
-
computeReducersFor(item, reducers, reducerResults);
|
|
31
|
+
computeReducersFor(item, reducers, reducerResults, i);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
if (reducers) {
|
|
35
|
-
computeReducersFor(item, reducers, globalReducerResults);
|
|
35
|
+
computeReducersFor(item, reducers, globalReducerResults, i);
|
|
36
36
|
}
|
|
37
37
|
currentGroupKeys.length = 0;
|
|
38
38
|
}
|
|
@@ -77,11 +77,11 @@ function cumulate(aggregateParams, data) {
|
|
|
77
77
|
const { items: currentGroupItems, reducerResults } = deepMap.get(currentGroupKeys);
|
|
78
78
|
currentGroupItems.push(item);
|
|
79
79
|
if (reducers) {
|
|
80
|
-
computeReducersFor(item, reducers, reducerResults);
|
|
80
|
+
computeReducersFor(item, reducers, reducerResults, i);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
if (reducers) {
|
|
84
|
-
computeReducersFor(item, reducers, globalReducerResults);
|
|
84
|
+
computeReducersFor(item, reducers, globalReducerResults, i);
|
|
85
85
|
}
|
|
86
86
|
initialReducerValue = Object.assign({}, deepMap.get(currentGroupKeys).reducerResults);
|
|
87
87
|
currentGroupKeys.length = 0;
|
|
@@ -124,7 +124,7 @@ function initReducers(reducers) {
|
|
|
124
124
|
* @param reducerResults the results on which to operate
|
|
125
125
|
*
|
|
126
126
|
*/
|
|
127
|
-
function computeReducersFor(data, reducers, reducerResults) {
|
|
127
|
+
function computeReducersFor(data, reducers, reducerResults, dataIndex) {
|
|
128
128
|
var _a, _b;
|
|
129
129
|
if (!reducers || !Object.keys(reducers).length) {
|
|
130
130
|
return;
|
|
@@ -137,7 +137,7 @@ function computeReducersFor(data, reducers, reducerResults) {
|
|
|
137
137
|
}
|
|
138
138
|
const currentValue = reducerResults[key];
|
|
139
139
|
const value = reducer.field ? data[reducer.field] : (_b = (_a = reducer.getter) === null || _a === void 0 ? void 0 : _a.call(reducer, data)) !== null && _b !== void 0 ? _b : null;
|
|
140
|
-
reducerResults[key] = reducer.reducer(currentValue, value, data);
|
|
140
|
+
reducerResults[key] = reducer.reducer(currentValue, value, data, dataIndex);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
function completeReducers(reducers, reducerResults, items) {
|
|
@@ -25,7 +25,7 @@ import { SystemStatusMessageInfo } from '../PredefinedConfig/Common/SystemStatus
|
|
|
25
25
|
import { NotificationsOptions } from '../AdaptableOptions/NotificationsOptions';
|
|
26
26
|
import { CellSummmary } from '../PredefinedConfig/Common/CellSummary';
|
|
27
27
|
import { ColumnFilter, CustomDisplayFormatterContext, FlashingCellDefinition, GridDataChangedInfo, SystemFilterPredicateId } from '../types';
|
|
28
|
-
import { ToastOptions } from 'react-toastify';
|
|
28
|
+
import { ToastOptions } from 'react-toastify/dist/react-toastify.js';
|
|
29
29
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
30
30
|
import { AdaptableApi } from '../../types';
|
|
31
31
|
export declare function CreateEmptyCustomSort(): CustomSort;
|
|
@@ -4,7 +4,7 @@ exports.ObjectFactory = exports.CreateToastOptions = exports.CreateCustomDisplay
|
|
|
4
4
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
5
5
|
const GeneralConstants_1 = require("./Constants/GeneralConstants");
|
|
6
6
|
const Uuid_1 = require("../PredefinedConfig/Uuid");
|
|
7
|
-
const
|
|
7
|
+
const react_toastify_js_1 = require("react-toastify/dist/react-toastify.js");
|
|
8
8
|
function CreateEmptyCustomSort() {
|
|
9
9
|
return { Uuid: Uuid_1.createUuid(), ColumnId: GeneralConstants_1.EMPTY_STRING, SortedValues: [] };
|
|
10
10
|
}
|
|
@@ -146,6 +146,7 @@ function CreateEmptyReminderSchedule() {
|
|
|
146
146
|
Message: GeneralConstants_1.EMPTY_STRING,
|
|
147
147
|
MessageType: 'Info',
|
|
148
148
|
DisplayNotification: true,
|
|
149
|
+
DisplaySystemStatusMessage: false,
|
|
149
150
|
};
|
|
150
151
|
}
|
|
151
152
|
exports.CreateEmptyReminderSchedule = CreateEmptyReminderSchedule;
|
|
@@ -392,29 +393,29 @@ exports.CreateToastOptions = CreateToastOptions;
|
|
|
392
393
|
function getToastPosition(position) {
|
|
393
394
|
switch (position) {
|
|
394
395
|
case 'BottomLeft':
|
|
395
|
-
return
|
|
396
|
+
return react_toastify_js_1.toast.POSITION.BOTTOM_LEFT;
|
|
396
397
|
case 'BottomCenter':
|
|
397
|
-
return
|
|
398
|
+
return react_toastify_js_1.toast.POSITION.BOTTOM_CENTER;
|
|
398
399
|
case 'BottomRight':
|
|
399
|
-
return
|
|
400
|
+
return react_toastify_js_1.toast.POSITION.BOTTOM_RIGHT;
|
|
400
401
|
case 'TopLeft':
|
|
401
|
-
return
|
|
402
|
+
return react_toastify_js_1.toast.POSITION.TOP_LEFT;
|
|
402
403
|
case 'TopCenter':
|
|
403
|
-
return
|
|
404
|
+
return react_toastify_js_1.toast.POSITION.TOP_CENTER;
|
|
404
405
|
case 'TopRight':
|
|
405
|
-
return
|
|
406
|
+
return react_toastify_js_1.toast.POSITION.TOP_RIGHT;
|
|
406
407
|
}
|
|
407
408
|
}
|
|
408
409
|
function getToastTransition(transition) {
|
|
409
410
|
switch (transition) {
|
|
410
411
|
case 'Bounce':
|
|
411
|
-
return
|
|
412
|
+
return react_toastify_js_1.Bounce;
|
|
412
413
|
case 'Slide':
|
|
413
|
-
return
|
|
414
|
+
return react_toastify_js_1.Slide;
|
|
414
415
|
case 'Zoom':
|
|
415
|
-
return
|
|
416
|
+
return react_toastify_js_1.Zoom;
|
|
416
417
|
case 'Flip':
|
|
417
|
-
return
|
|
418
|
+
return react_toastify_js_1.Flip;
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
exports.ObjectFactory = {
|
|
@@ -197,7 +197,30 @@ class AggregatedScalarCalculatedColumn {
|
|
|
197
197
|
groupByDef.toKey = mapGroupByToKey(groupByDef.field);
|
|
198
198
|
});
|
|
199
199
|
if (!expressionEvaluation.cumulateOver) {
|
|
200
|
-
|
|
200
|
+
let aggregatedRowNodes = gridRowNodes;
|
|
201
|
+
if (expressionEvaluation.sortByColumn) {
|
|
202
|
+
const sortByColumn = expressionEvaluation.sortByColumn;
|
|
203
|
+
const getRowNodeValue = (rowNode, columnId) => this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
204
|
+
if (expressionEvaluation.filterUndefinedValues) {
|
|
205
|
+
aggregatedRowNodes = gridRowNodes.filter((node) => {
|
|
206
|
+
const rowValue = getRowNodeValue(node, sortByColumn);
|
|
207
|
+
return rowValue != undefined;
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
// currently, we support only ascending sorting
|
|
211
|
+
aggregatedRowNodes.sort((first, second) => {
|
|
212
|
+
const firstValue = getRowNodeValue(first, sortByColumn);
|
|
213
|
+
const secondValue = getRowNodeValue(second, sortByColumn);
|
|
214
|
+
if (firstValue < secondValue) {
|
|
215
|
+
return -1;
|
|
216
|
+
}
|
|
217
|
+
if (firstValue > secondValue) {
|
|
218
|
+
return 1;
|
|
219
|
+
}
|
|
220
|
+
return 0;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
return scalarAggregationHelper_1.aggregate(expressionEvaluation.aggregationParams, aggregatedRowNodes);
|
|
201
224
|
}
|
|
202
225
|
else {
|
|
203
226
|
// 1. sort grid data by given OVER column
|
|
@@ -13,7 +13,8 @@ const AdaptableLoadingScreen_1 = require("./Components/Popups/AdaptableLoadingSc
|
|
|
13
13
|
const renderWithAdaptableContext_1 = require("./renderWithAdaptableContext");
|
|
14
14
|
const License_1 = require("./License");
|
|
15
15
|
const ProgressIndicator_1 = require("../components/ProgressIndicator/ProgressIndicator");
|
|
16
|
-
|
|
16
|
+
//@ts-ignore - we need to avoid the esm from react-toastify for now
|
|
17
|
+
const react_toastify_js_1 = require("react-toastify/dist/react-toastify.js");
|
|
17
18
|
const WindowPopups_1 = require("./Components/Popups/WindowPopups/WindowPopups");
|
|
18
19
|
const FormPopups_1 = require("./Components/Popups/FormPopups/FormPopups");
|
|
19
20
|
class AdaptableView extends React.Component {
|
|
@@ -27,7 +28,7 @@ class AdaptableView extends React.Component {
|
|
|
27
28
|
this.props.PopupState.PromptPopup.ShowPromptPopup && (React.createElement(AdaptablePopupPrompt_1.AdaptablePopupPrompt, { message: this.props.PopupState.PromptPopup.Message, header: this.props.PopupState.PromptPopup.Header, onClose: this.props.onClosePromptPopup, onConfirm: this.props.onConfirmPromptPopup, onConfirmActionCreator: this.props.PopupState.PromptPopup.ConfirmActionCreator, defaultValue: this.props.PopupState.PromptPopup.DefaultValue })),
|
|
28
29
|
React.createElement(AdaptablePopupConfirmation_1.AdaptablePopupConfirmation, { header: this.props.PopupState.ConfirmationPopup.Header, messsage: this.props.PopupState.ConfirmationPopup.Msg, showPopup: this.props.PopupState.ConfirmationPopup.ShowConfirmationPopup, cancelButtonText: this.props.PopupState.ConfirmationPopup.CancelButtonText, confirmButtonText: this.props.PopupState.ConfirmationPopup.ConfirmButtonText, onCancel: this.props.onCancelConfirmationPopup, onConfirm: this.props.onConfirmConfirmationPopup, showInputBox: this.props.PopupState.ConfirmationPopup.ShowInputBox, messageType: this.props.PopupState.ConfirmationPopup.MessageType, api: this.props.AdaptableApi }),
|
|
29
30
|
Boolean(this.props.PopupState.ScreenPopup.ShowScreenPopup) && (React.createElement(AdaptablePopup_1.AdaptablePopup, { componentName: this.props.PopupState.ScreenPopup.ComponentName, componentModule: this.props.PopupState.ScreenPopup.ComponentModule, onHide: this.props.onCloseScreenPopup, api: this.props.AdaptableApi, onClearParams: () => this.props.onClearPopupParams(), moduleParams: this.props.PopupState.ScreenPopup.Params, moduleProps: this.props.PopupState.ScreenPopup.PopupProps })),
|
|
30
|
-
React.createElement(
|
|
31
|
+
React.createElement(react_toastify_js_1.ToastContainer
|
|
31
32
|
// we NEEEEED!!!! this containerId, otherwise, toastify will have memory leaks when the adaptable
|
|
32
33
|
// instance is destroyed and re-created many times
|
|
33
34
|
, {
|
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Action } from 'redux';
|
|
3
|
+
import { AdaptableObject } from '../../../PredefinedConfig/Common/AdaptableObject';
|
|
4
|
+
import { AdaptableObjectItemView, AdaptableObjectView, IModule } from '../../../Strategy/Interface/IModule';
|
|
5
|
+
import { AccessLevel, SharedEntityConfig } from '../../../types';
|
|
6
|
+
export declare const AdaptableObjectListItemView: React.FunctionComponent<{
|
|
7
|
+
abObject: AdaptableObject;
|
|
8
|
+
accessLevel?: AccessLevel;
|
|
9
|
+
actions?: React.ReactElement[];
|
|
10
|
+
className?: string;
|
|
11
|
+
deleteAction?: Action;
|
|
12
|
+
onDelete?: () => void;
|
|
13
|
+
deleteDisabled?: boolean;
|
|
14
|
+
deleteTooltip?: string;
|
|
15
|
+
editDisabled?: boolean;
|
|
16
|
+
entityType: string;
|
|
17
|
+
handleOnEdit?: (tagName?: string) => void;
|
|
18
|
+
items: AdaptableObjectItemView[];
|
|
19
|
+
onShare?: (config: SharedEntityConfig) => void;
|
|
20
|
+
onSuspend?: () => void;
|
|
21
|
+
onUnSuspend?: () => void;
|
|
22
|
+
showActions?: boolean;
|
|
23
|
+
showEditButton?: boolean;
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
suspendedEnabled?: boolean;
|
|
26
|
+
teamSharingActivated?: boolean;
|
|
27
|
+
}>;
|
|
3
28
|
interface AdaptableObjectListItemProps {
|
|
4
29
|
data: AdaptableObjectView;
|
|
5
30
|
module: IModule;
|
|
@@ -21,6 +46,7 @@ export declare const AdaptableObjectListItem: React.FunctionComponent<AdaptableO
|
|
|
21
46
|
interface AdaptableObjectListProps {
|
|
22
47
|
items: AdaptableObjectView[];
|
|
23
48
|
module: IModule;
|
|
49
|
+
itemProps?: Partial<AdaptableObjectListItemProps>;
|
|
24
50
|
}
|
|
25
51
|
export declare const AdaptableObjectList: React.FunctionComponent<AdaptableObjectListProps>;
|
|
26
52
|
export {};
|