@adaptabletools/adaptable-cjs 18.0.0-canary.1 → 18.0.0-canary.11
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/agGrid.d.ts +4 -21
- package/agGrid.js +5 -21
- package/base.css +11 -3
- package/base.css.map +1 -1
- package/index.css +88 -70
- package/index.css.map +1 -1
- package/package.json +4 -5
- package/src/AdaptableInterfaces/IAdaptable.d.ts +61 -108
- package/src/AdaptableOptions/AdaptableOptions.d.ts +12 -6
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -4
- package/src/AdaptableOptions/ColumnOptions.d.ts +4 -2
- package/src/AdaptableOptions/{CommentsOptions.d.ts → CommentOptions.d.ts} +5 -5
- package/src/AdaptableOptions/MenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/MenuOptions.js +2 -6
- package/src/AdaptableOptions/{NotesOptions.d.ts → NoteOptions.d.ts} +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
- package/src/Api/AdaptableApi.d.ts +5 -0
- package/src/Api/BulkUpdateApi.d.ts +0 -5
- package/src/Api/ConfigApi.d.ts +1 -1
- package/src/Api/Events/AdaptableReady.d.ts +3 -3
- package/src/Api/Events/GridDataChanged.d.ts +4 -4
- package/src/Api/GridApi.d.ts +18 -13
- package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ActionColumnApiImpl.js +33 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
- package/src/Api/Implementation/ApiBase.d.ts +2 -1
- package/src/Api/Implementation/ApiBase.js +4 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
- package/src/Api/Implementation/CommentsApiImpl.d.ts +4 -0
- package/src/Api/Implementation/CommentsApiImpl.js +7 -1
- package/src/Api/Implementation/ConfigApiImpl.js +13 -5
- package/src/Api/Implementation/GridApiImpl.d.ts +4 -3
- package/src/Api/Implementation/GridApiImpl.js +33 -14
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +15 -0
- package/src/Api/Implementation/NotesApiImpl.d.ts +6 -4
- package/src/Api/Implementation/NotesApiImpl.js +9 -8
- package/src/Api/Implementation/OptionsApiImpl.d.ts +2 -1
- package/src/Api/Implementation/OptionsApiImpl.js +12 -2
- package/src/Api/Implementation/ScopeApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ScopeApiImpl.js +20 -7
- package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
- package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
- package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
- package/src/Api/Internal/ActionRowInternalApi.d.ts +5 -1
- package/src/Api/Internal/ActionRowInternalApi.js +107 -0
- package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -4
- package/src/Api/Internal/AdaptableInternalApi.js +10 -8
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +71 -0
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +11 -1
- package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
- package/src/Api/Internal/ColumnInternalApi.js +12 -0
- package/src/Api/Internal/CommentsInternalApi.d.ts +4 -0
- package/src/Api/Internal/CommentsInternalApi.js +18 -0
- package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
- package/src/Api/Internal/CustomSortInternalApi.js +32 -1
- package/src/Api/Internal/DataSetInternalApi.js +1 -1
- package/src/Api/Internal/FormatColumnInternalApi.js +3 -2
- package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/FreeTextColumnInternalApi.js +60 -0
- package/src/Api/Internal/GridFilterInternalApi.js +1 -1
- package/src/Api/Internal/GridInternalApi.d.ts +21 -3
- package/src/Api/Internal/GridInternalApi.js +126 -7
- package/src/Api/Internal/NotesInternalApi.d.ts +4 -0
- package/src/Api/Internal/NotesInternalApi.js +18 -0
- package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +11 -0
- package/src/Api/OptionsApi.d.ts +5 -1
- package/src/Api/ScopeApi.d.ts +10 -0
- package/src/EnvVars.d.ts +3 -0
- package/src/EnvVars.js +8 -0
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableScope.d.ts +4 -1
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +5 -1
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +8 -0
- package/src/PredefinedConfig/Common/RowSummary.d.ts +7 -0
- package/src/PredefinedConfig/Common/RowSummary.js +4 -0
- package/src/PredefinedConfig/LayoutState.d.ts +5 -0
- package/src/PredefinedConfig/NotesState.d.ts +10 -20
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
- package/src/PredefinedConfig/SystemState.d.ts +7 -0
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +22 -1
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
- package/src/Redux/ActionsReducers/NotesRedux.js +10 -8
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +16 -3
- package/src/Redux/Store/AdaptableStore.d.ts +4 -6
- package/src/Redux/Store/AdaptableStore.js +33 -50
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +8 -2
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -3
- package/src/Strategy/AdaptableModuleBase.js +4 -7
- package/src/Strategy/AlertModule.d.ts +1 -2
- package/src/Strategy/AlertModule.js +2 -55
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -3
- package/src/Strategy/CalculatedColumnModule.js +5 -25
- package/src/Strategy/CellSummaryModule.d.ts +1 -0
- package/src/Strategy/CellSummaryModule.js +50 -21
- package/src/Strategy/ChartingModule.d.ts +0 -1
- package/src/Strategy/ChartingModule.js +2 -22
- package/src/Strategy/ColumnFilterModule.d.ts +1 -2
- package/src/Strategy/ColumnFilterModule.js +1 -64
- package/src/Strategy/CommentsModule.d.ts +1 -0
- package/src/Strategy/CommentsModule.js +5 -1
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.d.ts +1 -2
- package/src/Strategy/DashboardModule.js +1 -8
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +3 -1
- package/src/Strategy/DataSetModule.d.ts +1 -1
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/FlashingCellModule.d.ts +1 -2
- package/src/Strategy/FlashingCellModule.js +2 -15
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +0 -47
- package/src/Strategy/FreeTextColumnModule.d.ts +0 -1
- package/src/Strategy/FreeTextColumnModule.js +0 -30
- package/src/Strategy/GridFilterModule.d.ts +0 -1
- package/src/Strategy/GridFilterModule.js +0 -37
- package/src/Strategy/Interface/IModule.d.ts +0 -1
- package/src/Strategy/LayoutModule.d.ts +8 -3
- package/src/Strategy/LayoutModule.js +108 -53
- package/src/Strategy/NamedQueryModule.d.ts +0 -1
- package/src/Strategy/NamedQueryModule.js +0 -19
- package/src/Strategy/NotesModule.js +3 -4
- package/src/Strategy/PlusMinusModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/ScheduleModule.d.ts +1 -1
- package/src/Strategy/ScheduleModule.js +1 -1
- package/src/Strategy/ShortcutModule.d.ts +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/StyledColumnModule.d.ts +0 -1
- package/src/Strategy/StyledColumnModule.js +0 -21
- package/src/Strategy/TeamSharingModule.d.ts +1 -0
- package/src/Strategy/TeamSharingModule.js +5 -5
- package/src/Strategy/ToolPanelModule.d.ts +0 -1
- package/src/Strategy/ToolPanelModule.js +0 -23
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +3 -2
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +294 -0
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +6 -1
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +20 -60
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +6 -1
- package/src/Utilities/ObjectFactory.js +6 -6
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +3 -2
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +14 -9
- package/src/Utilities/Services/CellPopupService.js +0 -1
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
- package/src/Utilities/Services/LicenseService/index.js +1 -186
- package/src/Utilities/Services/MetamodelService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.js +6 -3
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/QueryLanguageService.js +2 -1
- package/src/Utilities/Services/RowEditService.d.ts +3 -2
- package/src/Utilities/Services/RowEditService.js +3 -1
- package/src/Utilities/Services/SummaryService.d.ts +19 -0
- package/src/Utilities/Services/SummaryService.js +33 -0
- package/src/Utilities/license/decode.js +1 -70
- package/src/Utilities/license/hashing.js +1 -47
- package/src/View/AdaptableView.js +1 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +2 -2
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +1 -1
- package/src/View/Comments/CommentsPopup.js +12 -8
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/NewScopeComponent.js +34 -1
- package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
- package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
- package/src/View/Components/Popups/AdaptableToaster.js +1 -1
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +8 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +7 -3
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
- package/src/View/Layout/TransposedPopup.d.ts +3 -0
- package/src/View/Layout/TransposedPopup.js +199 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/License/LicenseWatermark.js +1 -66
- package/src/View/Notes/NotesPopup.js +8 -10
- package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
- package/src/View/Theme/ThemeSelector.js +2 -2
- package/src/agGrid/ActionColumnRenderer.js +7 -6
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +7 -5291
- package/src/agGrid/AdaptableAgGrid.d.ts +351 -0
- package/src/agGrid/AdaptableAgGrid.js +3941 -0
- package/src/agGrid/AdaptableLogger.js +78 -13
- package/src/agGrid/AgGridAdapter.d.ts +62 -0
- package/src/agGrid/AgGridAdapter.js +582 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +829 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +276 -0
- package/src/agGrid/AgGridOptionsService.d.ts +12 -0
- package/src/agGrid/AgGridOptionsService.js +58 -0
- package/src/agGrid/BadgeRenderer.js +1 -1
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.d.ts +2 -2
- package/src/agGrid/FilterWrapper.js +1 -1
- package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
- package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
- package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +73 -10
- package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -2
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
- package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/InfiniteTable/index.js +2 -2
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +1 -1
- package/src/components/Modal/index.d.ts +1 -0
- package/src/components/Modal/index.js +6 -4
- package/src/components/Select/Select.d.ts +2 -0
- package/src/components/Select/Select.js +2 -2
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/rows.d.ts +3 -0
- package/src/components/icons/rows.js +7 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +74 -11
- package/src/metamodel/adaptable.metamodel.js +1 -9316
- package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
- package/src/migration/AdaptableUpgradeHelper.js +52 -0
- package/src/migration/VersionUpgrade.d.ts +8 -0
- package/src/migration/VersionUpgrade.js +15 -0
- package/src/migration/VersionUpgrade17.d.ts +18 -0
- package/src/migration/VersionUpgrade17.js +347 -0
- package/src/migration/VersionUpgrade18.d.ts +5 -0
- package/src/migration/VersionUpgrade18.js +10 -0
- package/src/parser/src/types.d.ts +5 -0
- package/src/types.d.ts +7 -3
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
- package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
- package/src/Utilities/Services/Interface/IRowEditService.js +0 -2
- package/src/View/Components/ScopeComponent.d.ts +0 -24
- package/src/View/Components/ScopeComponent.js +0 -138
- package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
- package/src/View/Export/Wizard/ReportScopeWizard.js +0 -52
- package/src/agGrid/agGridHelper.d.ts +0 -57
- package/src/agGrid/agGridHelper.js +0 -691
- package/src/agGrid/agGridMenuHelper.d.ts +0 -46
- package/src/agGrid/agGridMenuHelper.js +0 -673
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
|
@@ -4,6 +4,7 @@ exports.aggregatedScalarExpressionFunctionNames = exports.aggregatedScalarExpres
|
|
|
4
4
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
5
5
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
6
6
|
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
7
|
+
const ArrayExtensions_1 = require("../Extensions/ArrayExtensions");
|
|
7
8
|
exports.aggregatedExpressionFunctions = [
|
|
8
9
|
'SUM',
|
|
9
10
|
'PERCENTAGE',
|
|
@@ -14,6 +15,11 @@ exports.aggregatedExpressionFunctions = [
|
|
|
14
15
|
'WEIGHT',
|
|
15
16
|
'COL',
|
|
16
17
|
'GROUP_BY',
|
|
18
|
+
'MEDIAN',
|
|
19
|
+
'MODE',
|
|
20
|
+
'DISTINCT',
|
|
21
|
+
'ONLY',
|
|
22
|
+
'STD_DEVIATION',
|
|
17
23
|
];
|
|
18
24
|
exports.cumulativeAggregatedExpressionFunctions = [
|
|
19
25
|
'CUMUL',
|
|
@@ -80,6 +86,8 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
80
86
|
field: sumColumnName,
|
|
81
87
|
initialValue: 0,
|
|
82
88
|
reducer: (totalSum, rowValue) => {
|
|
89
|
+
// TODO: see why error are not concole logged
|
|
90
|
+
// debuger = 'Adaptable:*'
|
|
83
91
|
if (isUndefinedValue(rowValue)) {
|
|
84
92
|
return totalSum;
|
|
85
93
|
}
|
|
@@ -89,6 +97,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
89
97
|
},
|
|
90
98
|
},
|
|
91
99
|
rowFilterFn: context.filterFn,
|
|
100
|
+
getRowNodes: context.getRowNodes,
|
|
92
101
|
};
|
|
93
102
|
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
94
103
|
const result = {
|
|
@@ -151,6 +160,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
151
160
|
100);
|
|
152
161
|
},
|
|
153
162
|
rowFilterFn: context.filterFn,
|
|
163
|
+
getRowNodes: context.getRowNodes,
|
|
154
164
|
};
|
|
155
165
|
addGroupByParams(groupByColumnNames, aggregationExpressionEvaluation);
|
|
156
166
|
const result = {
|
|
@@ -225,6 +235,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
225
235
|
},
|
|
226
236
|
},
|
|
227
237
|
rowFilterFn: context.filterFn,
|
|
238
|
+
getRowNodes: context.getRowNodes,
|
|
228
239
|
};
|
|
229
240
|
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
230
241
|
if (weightParameter) {
|
|
@@ -249,6 +260,284 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
249
260
|
examples: ['AVG([colA])', 'AVG([colA], GROUP_BY([colB]))', 'AVG([colA], WEIGHT([colB]))'],
|
|
250
261
|
category: 'aggregation',
|
|
251
262
|
},
|
|
263
|
+
MEDIAN: {
|
|
264
|
+
handler(args, context) {
|
|
265
|
+
const medianColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('MEDIAN', args);
|
|
266
|
+
const medianColumnName = medianColumnParameter.value;
|
|
267
|
+
(0, expressionFunctionUtils_1.validateColumnType)(medianColumnName, ['Number'], 'MEDIAN', context.adaptableApi);
|
|
268
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MEDIAN', 'operand', ['GROUP_BY'], args, {
|
|
269
|
+
isOptional: true,
|
|
270
|
+
});
|
|
271
|
+
const getCellValue = (rowNode) => {
|
|
272
|
+
return context.adaptableApi.gridApi.getNormalisedValueFromRowNode(rowNode, medianColumnName);
|
|
273
|
+
};
|
|
274
|
+
const aggregationExpressionEvaluation = {
|
|
275
|
+
aggregationParams: {
|
|
276
|
+
reducers: {
|
|
277
|
+
MEDIAN: {
|
|
278
|
+
name: 'MEDIAN',
|
|
279
|
+
field: medianColumnName,
|
|
280
|
+
initialValue: [],
|
|
281
|
+
reducer: (aggregatedValue, value, rowNode) => {
|
|
282
|
+
aggregatedValue.push(rowNode);
|
|
283
|
+
return aggregatedValue;
|
|
284
|
+
},
|
|
285
|
+
done: (aggregatedValue) => {
|
|
286
|
+
if (aggregatedValue.length === 0) {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
if (aggregatedValue.length === 1) {
|
|
290
|
+
return getCellValue(aggregatedValue[0]);
|
|
291
|
+
}
|
|
292
|
+
const lenght = aggregatedValue.length;
|
|
293
|
+
const middle = Math.floor((lenght - 1) / 2);
|
|
294
|
+
if (lenght % 2) {
|
|
295
|
+
return getCellValue(aggregatedValue[middle]);
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
return ((getCellValue(aggregatedValue[middle]) +
|
|
299
|
+
getCellValue(aggregatedValue[middle + 1])) /
|
|
300
|
+
2.0);
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
rowFilterFn: context.filterFn,
|
|
307
|
+
getRowNodes: context.getRowNodes,
|
|
308
|
+
};
|
|
309
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
310
|
+
const result = {
|
|
311
|
+
name: 'MEDIAN',
|
|
312
|
+
type: 'aggregationScalar',
|
|
313
|
+
value: aggregationExpressionEvaluation,
|
|
314
|
+
};
|
|
315
|
+
return result;
|
|
316
|
+
},
|
|
317
|
+
description: 'Aggregates a column over multiple rows by computing the median of the column values\nOptionally the aggregation may be grouped.',
|
|
318
|
+
signatures: [
|
|
319
|
+
'MEDIAN( [colName] )',
|
|
320
|
+
'MEDIAN( COL(name: string))',
|
|
321
|
+
'MEDIAN( [colNameA], GROUP_BY( [colNameB] ))',
|
|
322
|
+
'MEDIAN( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
323
|
+
],
|
|
324
|
+
examples: ['MEDIAN([colA])', 'MEDIAN([colA], GROUP_BY([colB]))'],
|
|
325
|
+
category: 'aggregation',
|
|
326
|
+
},
|
|
327
|
+
MODE: {
|
|
328
|
+
handler(args, context) {
|
|
329
|
+
const modeColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('mode', args);
|
|
330
|
+
const modeColumnName = modeColumnParameter.value;
|
|
331
|
+
(0, expressionFunctionUtils_1.validateColumnType)(modeColumnName, ['Number'], 'mode', context.adaptableApi);
|
|
332
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MODE', 'operand', ['GROUP_BY'], args, {
|
|
333
|
+
isOptional: true,
|
|
334
|
+
});
|
|
335
|
+
const aggregationExpressionEvaluation = {
|
|
336
|
+
aggregationParams: {
|
|
337
|
+
reducers: {
|
|
338
|
+
MODE: {
|
|
339
|
+
name: 'MODE',
|
|
340
|
+
field: modeColumnName,
|
|
341
|
+
initialValue: new Map(),
|
|
342
|
+
reducer: (aggregatedValue, rowValue, rowNode) => {
|
|
343
|
+
var _a;
|
|
344
|
+
if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
aggregatedValue.set(rowValue, ((_a = aggregatedValue.get(rowValue)) !== null && _a !== void 0 ? _a : 0) + 1);
|
|
348
|
+
return aggregatedValue;
|
|
349
|
+
},
|
|
350
|
+
done: (aggregatedValue) => {
|
|
351
|
+
const sorted = [...aggregatedValue.entries()].sort(([aVal, aFreq], [bVal, bFreq]) => {
|
|
352
|
+
if (aFreq < bFreq) {
|
|
353
|
+
return 1;
|
|
354
|
+
}
|
|
355
|
+
else if (aFreq > bFreq || aVal < bVal) {
|
|
356
|
+
return -1;
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
return aVal === bVal ? 0 : 1;
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
return sorted[0][0];
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
rowFilterFn: context.filterFn,
|
|
368
|
+
getRowNodes: context.getRowNodes,
|
|
369
|
+
};
|
|
370
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
371
|
+
const result = {
|
|
372
|
+
name: 'MODE',
|
|
373
|
+
type: 'aggregationScalar',
|
|
374
|
+
value: aggregationExpressionEvaluation,
|
|
375
|
+
};
|
|
376
|
+
return result;
|
|
377
|
+
},
|
|
378
|
+
description: 'Aggregates a column over multiple rows by computing the mode of the column values\nOptionally the aggregation may be grouped.',
|
|
379
|
+
signatures: [
|
|
380
|
+
'MODE( [colName] )',
|
|
381
|
+
'MODE( COL(name: string))',
|
|
382
|
+
'MODE( [colNameA], GROUP_BY( [colNameB] ))',
|
|
383
|
+
'MODE( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
384
|
+
],
|
|
385
|
+
examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
|
|
386
|
+
category: 'aggregation',
|
|
387
|
+
},
|
|
388
|
+
DISTINCT: {
|
|
389
|
+
handler(args, context) {
|
|
390
|
+
const distinctColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('DISTINCT', args);
|
|
391
|
+
const distinctColumnName = distinctColumnParameter.value;
|
|
392
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MODE', 'operand', ['GROUP_BY'], args, {
|
|
393
|
+
isOptional: true,
|
|
394
|
+
});
|
|
395
|
+
const aggregationExpressionEvaluation = {
|
|
396
|
+
aggregationParams: {
|
|
397
|
+
reducers: {
|
|
398
|
+
DISTINCT: {
|
|
399
|
+
name: 'DISTINCT',
|
|
400
|
+
field: distinctColumnName,
|
|
401
|
+
initialValue: new Set(),
|
|
402
|
+
reducer: (aggregatedValue, rowValue, rowNode) => {
|
|
403
|
+
if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
|
|
404
|
+
return aggregatedValue;
|
|
405
|
+
}
|
|
406
|
+
aggregatedValue.add(rowValue);
|
|
407
|
+
return aggregatedValue;
|
|
408
|
+
},
|
|
409
|
+
done: (aggregatedValue) => {
|
|
410
|
+
return aggregatedValue.size;
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
getRowNodes: context.getRowNodes,
|
|
416
|
+
};
|
|
417
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
418
|
+
const result = {
|
|
419
|
+
name: 'DISTINCT',
|
|
420
|
+
type: 'aggregationScalar',
|
|
421
|
+
value: aggregationExpressionEvaluation,
|
|
422
|
+
};
|
|
423
|
+
return result;
|
|
424
|
+
},
|
|
425
|
+
description: 'Aggregates a column over multiple rows by computing the distinct number of the column values\nOptionally the aggregation may be grouped.',
|
|
426
|
+
signatures: [
|
|
427
|
+
'DISTINCT( [colName] )',
|
|
428
|
+
'DISTINCT( COL(name: string))',
|
|
429
|
+
'DISTINCT( [colNameA], GROUP_BY( [colNameB] ))',
|
|
430
|
+
'DISTINCT( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
431
|
+
],
|
|
432
|
+
examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
|
|
433
|
+
category: 'aggregation',
|
|
434
|
+
},
|
|
435
|
+
ONLY: {
|
|
436
|
+
handler(args, context) {
|
|
437
|
+
const distinctColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('ONLY', args);
|
|
438
|
+
const onlyColumnName = distinctColumnParameter.value;
|
|
439
|
+
(0, expressionFunctionUtils_1.validateColumnType)(onlyColumnName, ['Number'], 'ONLY', context.adaptableApi);
|
|
440
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('ONLY', 'operand', ['GROUP_BY'], args, {
|
|
441
|
+
isOptional: true,
|
|
442
|
+
});
|
|
443
|
+
const aggregationExpressionEvaluation = {
|
|
444
|
+
aggregationParams: {
|
|
445
|
+
reducers: {
|
|
446
|
+
ONLY: {
|
|
447
|
+
name: 'ONLY',
|
|
448
|
+
field: onlyColumnName,
|
|
449
|
+
initialValue: new Set(),
|
|
450
|
+
reducer: (aggregatedValue, rowValue, rowNode) => {
|
|
451
|
+
if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
|
|
452
|
+
return aggregatedValue;
|
|
453
|
+
}
|
|
454
|
+
aggregatedValue.add(rowValue);
|
|
455
|
+
return aggregatedValue;
|
|
456
|
+
},
|
|
457
|
+
done: (aggregatedValue) => {
|
|
458
|
+
return aggregatedValue.size === 1 ? aggregatedValue.values().next().value : null;
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
rowFilterFn: context.filterFn,
|
|
464
|
+
getRowNodes: context.getRowNodes,
|
|
465
|
+
};
|
|
466
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
467
|
+
const result = {
|
|
468
|
+
name: 'ONLY',
|
|
469
|
+
type: 'aggregationScalar',
|
|
470
|
+
value: aggregationExpressionEvaluation,
|
|
471
|
+
};
|
|
472
|
+
return result;
|
|
473
|
+
},
|
|
474
|
+
description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
|
|
475
|
+
signatures: [
|
|
476
|
+
'ONLY( [colName] )',
|
|
477
|
+
'ONLY( COL(name: string))',
|
|
478
|
+
'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
|
|
479
|
+
'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
480
|
+
],
|
|
481
|
+
examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
|
|
482
|
+
category: 'aggregation',
|
|
483
|
+
},
|
|
484
|
+
STD_DEVIATION: {
|
|
485
|
+
handler(args, context) {
|
|
486
|
+
const columnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('STD_DEVIATION', args);
|
|
487
|
+
const columnName = columnParameter.value;
|
|
488
|
+
(0, expressionFunctionUtils_1.validateColumnType)(columnName, ['Number'], 'STD_DEVIATION', context.adaptableApi);
|
|
489
|
+
const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('STD_DEVIATION', 'operand', ['GROUP_BY'], args, {
|
|
490
|
+
isOptional: true,
|
|
491
|
+
});
|
|
492
|
+
const aggregationExpressionEvaluation = {
|
|
493
|
+
aggregationParams: {
|
|
494
|
+
reducers: {
|
|
495
|
+
STD_DEVIATION: {
|
|
496
|
+
name: 'STD_DEVIATION',
|
|
497
|
+
field: columnName,
|
|
498
|
+
initialValue: { sumOfValues: 0, values: [] },
|
|
499
|
+
reducer: (aggregatedValue, rowValue, rowNode) => {
|
|
500
|
+
// TODO: getNumericValue; allow numeric strings
|
|
501
|
+
if (typeof rowValue !== 'number' || isNaN(rowValue)) {
|
|
502
|
+
return aggregatedValue;
|
|
503
|
+
}
|
|
504
|
+
aggregatedValue.sumOfValues = aggregatedValue.sumOfValues + rowValue;
|
|
505
|
+
aggregatedValue.values.push(rowValue);
|
|
506
|
+
return aggregatedValue;
|
|
507
|
+
},
|
|
508
|
+
done: (aggregatedValue) => {
|
|
509
|
+
const { sumOfValues, values } = aggregatedValue;
|
|
510
|
+
if (values.length === 0) {
|
|
511
|
+
return 0;
|
|
512
|
+
}
|
|
513
|
+
const mean = sumOfValues / values.length;
|
|
514
|
+
const variance = (0, ArrayExtensions_1.SumArray)(values.map((value) => Math.pow(value - mean, 2))) / values.length;
|
|
515
|
+
return Math.sqrt(variance);
|
|
516
|
+
},
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
rowFilterFn: context.filterFn,
|
|
521
|
+
getRowNodes: context.getRowNodes,
|
|
522
|
+
};
|
|
523
|
+
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
524
|
+
const result = {
|
|
525
|
+
name: 'STD_DEVIATION',
|
|
526
|
+
type: 'aggregationScalar',
|
|
527
|
+
value: aggregationExpressionEvaluation,
|
|
528
|
+
};
|
|
529
|
+
return result;
|
|
530
|
+
},
|
|
531
|
+
description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
|
|
532
|
+
signatures: [
|
|
533
|
+
'ONLY( [colName] )',
|
|
534
|
+
'ONLY( COL(name: string))',
|
|
535
|
+
'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
|
|
536
|
+
'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
|
|
537
|
+
],
|
|
538
|
+
examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
|
|
539
|
+
category: 'aggregation',
|
|
540
|
+
},
|
|
252
541
|
MIN: {
|
|
253
542
|
handler(args, context) {
|
|
254
543
|
const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('MIN', args);
|
|
@@ -280,6 +569,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
280
569
|
},
|
|
281
570
|
},
|
|
282
571
|
rowFilterFn: context.filterFn,
|
|
572
|
+
getRowNodes: context.getRowNodes,
|
|
283
573
|
};
|
|
284
574
|
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
285
575
|
const result = {
|
|
@@ -330,6 +620,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
330
620
|
},
|
|
331
621
|
},
|
|
332
622
|
rowFilterFn: context.filterFn,
|
|
623
|
+
getRowNodes: context.getRowNodes,
|
|
333
624
|
};
|
|
334
625
|
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
335
626
|
const result = {
|
|
@@ -448,6 +739,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
448
739
|
const rowValue = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, quantileColumnName);
|
|
449
740
|
return isDefinedValue(rowValue);
|
|
450
741
|
},
|
|
742
|
+
getRowNodes: context.getRowNodes,
|
|
451
743
|
aggregationParams: {
|
|
452
744
|
reducers: {
|
|
453
745
|
QUANT: Object.assign({ name: 'QUANT', field: quantileColumnName }, quantReducer),
|
|
@@ -526,6 +818,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
526
818
|
},
|
|
527
819
|
},
|
|
528
820
|
rowFilterFn: context.filterFn,
|
|
821
|
+
getRowNodes: context.getRowNodes,
|
|
529
822
|
};
|
|
530
823
|
addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
|
|
531
824
|
const result = {
|
|
@@ -748,6 +1041,7 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
|
|
|
748
1041
|
},
|
|
749
1042
|
rowValueGetter,
|
|
750
1043
|
rowFilterFn: aggregationEvaluation.rowFilterFn,
|
|
1044
|
+
getRowNodes: context.getRowNodes,
|
|
751
1045
|
};
|
|
752
1046
|
return cumulationExpressionEvaluation;
|
|
753
1047
|
};
|
|
@@ -11,7 +11,7 @@ function aggregate(aggregateParams, data) {
|
|
|
11
11
|
const deepMap = new deepMap_1.DeepMap();
|
|
12
12
|
let currentGroupKeys = [];
|
|
13
13
|
const getInitialReducerValue = () => {
|
|
14
|
-
return
|
|
14
|
+
return structuredClone(initReducers(reducers));
|
|
15
15
|
};
|
|
16
16
|
const globalReducerResults = getInitialReducerValue();
|
|
17
17
|
for (let i = 0, len = data.length; i < len; i++) {
|
|
@@ -32,6 +32,7 @@ export declare function sortCellValueArrayNumeric(cellValues: GridCell[], sortOr
|
|
|
32
32
|
export declare function sortCellValueArrayDates(cellValues: GridCell[], sortOrder?: SortOrder): GridCell[];
|
|
33
33
|
export declare function groupArrayBy(array: Array<any>, prop: string): Array<any>;
|
|
34
34
|
export declare function createCommaSeparatedString(values: any[]): string;
|
|
35
|
+
export declare function SumArray(array: (number | undefined)[]): number;
|
|
35
36
|
export declare const ArrayExtensions: {
|
|
36
37
|
GetLength: typeof GetLength;
|
|
37
38
|
CorrectLength: typeof CorrectLength;
|
|
@@ -65,5 +66,6 @@ export declare const ArrayExtensions: {
|
|
|
65
66
|
sortCellValueArrayDates: typeof sortCellValueArrayDates;
|
|
66
67
|
sortArrayWithProperty: typeof sortArrayWithProperty;
|
|
67
68
|
createCommaSeparatedString: typeof createCommaSeparatedString;
|
|
69
|
+
SumArray: typeof SumArray;
|
|
68
70
|
};
|
|
69
71
|
export default ArrayExtensions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArrayExtensions = exports.createCommaSeparatedString = exports.groupArrayBy = exports.sortCellValueArrayDates = exports.sortCellValueArrayNumeric = exports.sortCellValueArray = exports.sortArray = exports.sortArrayWithProperty = exports.areArraysEqualWithOrderandProperties = exports.areArraysEqualWithOrder = exports.areArraysNotEqual = exports.areArraysEqual = exports.moveArray = exports.hasItemsOfCount = exports.hasOneItem = exports.getOccurrence = exports.HasSingleEmptyValue = exports.IsNotNullOrEmptyNorContainsSingleEmptyValue = exports.IsNullOrEmptyOrContainsSingleEmptyValue = exports.IsNotNullOrEmpty = exports.IsNullOrEmpty = exports.IsNotEmpty = exports.IsEmpty = exports.IsNotNull = exports.IsNull = exports.RetrieveDistinct = exports.NotContainsItem = exports.ContainsAnyItem = exports.ContainsItem = exports.AddItem = exports.NotCorrectLength = exports.CorrectLength = exports.GetLength = void 0;
|
|
3
|
+
exports.ArrayExtensions = exports.SumArray = exports.createCommaSeparatedString = exports.groupArrayBy = exports.sortCellValueArrayDates = exports.sortCellValueArrayNumeric = exports.sortCellValueArray = exports.sortArray = exports.sortArrayWithProperty = exports.areArraysEqualWithOrderandProperties = exports.areArraysEqualWithOrder = exports.areArraysNotEqual = exports.areArraysEqual = exports.moveArray = exports.hasItemsOfCount = exports.hasOneItem = exports.getOccurrence = exports.HasSingleEmptyValue = exports.IsNotNullOrEmptyNorContainsSingleEmptyValue = exports.IsNullOrEmptyOrContainsSingleEmptyValue = exports.IsNotNullOrEmpty = exports.IsNullOrEmpty = exports.IsNotEmpty = exports.IsEmpty = exports.IsNotNull = exports.IsNull = exports.RetrieveDistinct = exports.NotContainsItem = exports.ContainsAnyItem = exports.ContainsItem = exports.AddItem = exports.NotCorrectLength = exports.CorrectLength = exports.GetLength = void 0;
|
|
4
4
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
5
5
|
function GetLength(arrayToCheck) {
|
|
6
6
|
return IsNotNull(arrayToCheck) ? arrayToCheck.length : 0;
|
|
@@ -289,6 +289,10 @@ function createCommaSeparatedString(values) {
|
|
|
289
289
|
return values.join(', ');
|
|
290
290
|
}
|
|
291
291
|
exports.createCommaSeparatedString = createCommaSeparatedString;
|
|
292
|
+
function SumArray(array) {
|
|
293
|
+
return array.filter((num) => typeof num === 'number' && !isNaN(num)).reduce((a, b) => a + b, 0);
|
|
294
|
+
}
|
|
295
|
+
exports.SumArray = SumArray;
|
|
292
296
|
exports.ArrayExtensions = {
|
|
293
297
|
GetLength,
|
|
294
298
|
CorrectLength,
|
|
@@ -322,5 +326,6 @@ exports.ArrayExtensions = {
|
|
|
322
326
|
sortCellValueArrayDates,
|
|
323
327
|
sortArrayWithProperty,
|
|
324
328
|
createCommaSeparatedString,
|
|
329
|
+
SumArray,
|
|
325
330
|
};
|
|
326
331
|
exports.default = exports.ArrayExtensions;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { AdaptableObject } from '../../PredefinedConfig/Common/AdaptableObject';
|
|
2
2
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
3
|
-
import { AdaptableOptions } from '../../AdaptableOptions/AdaptableOptions';
|
|
4
3
|
import { AdaptableComparerFunction } from '../../PredefinedConfig/Common/AdaptableComparerFunction';
|
|
5
4
|
import { PredefinedConfig } from '../../PredefinedConfig/PredefinedConfig';
|
|
6
5
|
import { AccessLevel } from '../../PredefinedConfig/Common/Entitlement';
|
|
7
|
-
export declare function assignAdaptableOptions(adaptableOptions: AdaptableOptions): AdaptableOptions;
|
|
8
6
|
export declare function initPredefinedConfigWithUuids(predefinedConfig: PredefinedConfig): PredefinedConfig;
|
|
9
7
|
export declare function checkValidPrimaryKey(adaptable: IAdaptable): boolean;
|
|
10
8
|
export declare function AdaptableObjectExistsInState(array: AdaptableObject[], itemToCheck: AdaptableObject): boolean;
|
|
11
9
|
export declare function getAppropriateAccessLevel(adaptableObject: AdaptableObject, moduleAccessLevel: AccessLevel): AccessLevel;
|
|
12
10
|
export declare function runAdaptableComparerFunction(columnId: string, columnValues: any[], adaptable: IAdaptable): AdaptableComparerFunction;
|
|
13
|
-
export declare function addUuidAndSource(adaptableObject:
|
|
11
|
+
export declare function addUuidAndSource<T extends AdaptableObject>(adaptableObject: T): T;
|
|
12
|
+
export declare function removeUuidAndSource<T extends AdaptableObject>(adaptableObject: T): T;
|
|
14
13
|
export declare const AdaptableHelper: {
|
|
15
|
-
assignAdaptableOptions: typeof assignAdaptableOptions;
|
|
16
14
|
initPredefinedConfigWithUuids: typeof initPredefinedConfigWithUuids;
|
|
17
15
|
checkValidPrimaryKey: typeof checkValidPrimaryKey;
|
|
18
16
|
AdaptableObjectExistsInState: typeof AdaptableObjectExistsInState;
|
|
19
17
|
runAdaptableComparerFunction: typeof runAdaptableComparerFunction;
|
|
20
18
|
getAppropriateAccessLevel: typeof getAppropriateAccessLevel;
|
|
21
19
|
addUuidAndSource: typeof addUuidAndSource;
|
|
20
|
+
removeUuidAndSource: typeof removeUuidAndSource;
|
|
22
21
|
};
|
|
23
22
|
export default AdaptableHelper;
|
|
@@ -1,68 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AdaptableHelper = exports.addUuidAndSource = exports.runAdaptableComparerFunction = exports.getAppropriateAccessLevel = exports.AdaptableObjectExistsInState = exports.checkValidPrimaryKey = exports.initPredefinedConfigWithUuids =
|
|
3
|
+
exports.AdaptableHelper = exports.removeUuidAndSource = exports.addUuidAndSource = exports.runAdaptableComparerFunction = exports.getAppropriateAccessLevel = exports.AdaptableObjectExistsInState = exports.checkValidPrimaryKey = exports.initPredefinedConfigWithUuids = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const cloneDeepWith_1 = tslib_1.__importDefault(require("lodash/cloneDeepWith"));
|
|
6
6
|
const isPlainObject_1 = tslib_1.__importDefault(require("lodash/isPlainObject"));
|
|
7
7
|
const Uuid_1 = require("../../PredefinedConfig/Uuid");
|
|
8
|
-
const DefaultAdaptableOptions_1 = require("../Defaults/DefaultAdaptableOptions");
|
|
9
|
-
function assignAdaptableOptions(adaptableOptions) {
|
|
10
|
-
var _a;
|
|
11
|
-
const returnedAdaptableOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions, adaptableOptions);
|
|
12
|
-
returnedAdaptableOptions.adaptableStateKey =
|
|
13
|
-
(_a = returnedAdaptableOptions.adaptableStateKey) !== null && _a !== void 0 ? _a : returnedAdaptableOptions.adaptableId;
|
|
14
|
-
returnedAdaptableOptions.dataImportOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.dataImportOptions, adaptableOptions.dataImportOptions);
|
|
15
|
-
returnedAdaptableOptions.expressionOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.expressionOptions, adaptableOptions.expressionOptions);
|
|
16
|
-
returnedAdaptableOptions.calendarOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.calendarOptions, adaptableOptions.calendarOptions);
|
|
17
|
-
returnedAdaptableOptions.columnOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.columnOptions, adaptableOptions.columnOptions);
|
|
18
|
-
returnedAdaptableOptions.customSortOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.customSortOptions, adaptableOptions.customSortOptions);
|
|
19
|
-
returnedAdaptableOptions.dataSetOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.dataSetOptions, adaptableOptions.dataSetOptions);
|
|
20
|
-
returnedAdaptableOptions.cellSummaryOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.cellSummaryOptions, adaptableOptions.cellSummaryOptions);
|
|
21
|
-
returnedAdaptableOptions.predicateOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.predicateOptions, returnedAdaptableOptions.predicateOptions);
|
|
22
|
-
returnedAdaptableOptions.layoutOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.layoutOptions, adaptableOptions.layoutOptions);
|
|
23
|
-
returnedAdaptableOptions.notificationsOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.notificationsOptions, adaptableOptions.notificationsOptions);
|
|
24
|
-
returnedAdaptableOptions.alertOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.alertOptions, adaptableOptions.alertOptions);
|
|
25
|
-
returnedAdaptableOptions.flashingCellOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.flashingCellOptions, adaptableOptions.flashingCellOptions);
|
|
26
|
-
returnedAdaptableOptions.entitlementOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.entitlementOptions, adaptableOptions.entitlementOptions);
|
|
27
|
-
returnedAdaptableOptions.dashboardOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.dashboardOptions, adaptableOptions.dashboardOptions);
|
|
28
|
-
returnedAdaptableOptions.editOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.editOptions, adaptableOptions.editOptions);
|
|
29
|
-
returnedAdaptableOptions.actionColumnOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.actionColumnOptions, adaptableOptions.actionColumnOptions);
|
|
30
|
-
// to do
|
|
31
|
-
returnedAdaptableOptions.actionRowOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.actionRowOptions, adaptableOptions.actionRowOptions);
|
|
32
|
-
returnedAdaptableOptions.actionRowOptions.actionRowButtonOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.actionRowOptions.actionRowButtonOptions, returnedAdaptableOptions.actionRowOptions.actionRowButtonOptions);
|
|
33
|
-
returnedAdaptableOptions.actionRowOptions.actionRowFormOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.actionRowOptions.actionRowFormOptions, returnedAdaptableOptions.actionRowOptions.actionRowFormOptions);
|
|
34
|
-
returnedAdaptableOptions.containerOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.containerOptions, adaptableOptions.containerOptions);
|
|
35
|
-
returnedAdaptableOptions.groupingOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.groupingOptions, adaptableOptions.groupingOptions);
|
|
36
|
-
returnedAdaptableOptions.quickSearchOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.quickSearchOptions, adaptableOptions.quickSearchOptions);
|
|
37
|
-
returnedAdaptableOptions.columnFilterOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.columnFilterOptions, adaptableOptions.columnFilterOptions);
|
|
38
|
-
returnedAdaptableOptions.columnFilterOptions.quickFilterOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.columnFilterOptions.quickFilterOptions, returnedAdaptableOptions.columnFilterOptions.quickFilterOptions);
|
|
39
|
-
returnedAdaptableOptions.columnFilterOptions.filterFormOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.columnFilterOptions.filterFormOptions, returnedAdaptableOptions.columnFilterOptions.filterFormOptions);
|
|
40
|
-
returnedAdaptableOptions.columnFilterOptions.valuesFilterOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.columnFilterOptions.valuesFilterOptions, returnedAdaptableOptions.columnFilterOptions.valuesFilterOptions);
|
|
41
|
-
returnedAdaptableOptions.gridFilterOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.gridFilterOptions, adaptableOptions.gridFilterOptions);
|
|
42
|
-
returnedAdaptableOptions.userInterfaceOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.userInterfaceOptions, adaptableOptions.userInterfaceOptions);
|
|
43
|
-
returnedAdaptableOptions.userInterfaceOptions.dateInputOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.userInterfaceOptions.dateInputOptions, returnedAdaptableOptions.userInterfaceOptions.dateInputOptions);
|
|
44
|
-
returnedAdaptableOptions.menuOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.menuOptions, adaptableOptions.menuOptions);
|
|
45
|
-
returnedAdaptableOptions.stateOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.stateOptions, adaptableOptions.stateOptions);
|
|
46
|
-
returnedAdaptableOptions.exportOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.exportOptions, adaptableOptions.exportOptions);
|
|
47
|
-
returnedAdaptableOptions.teamSharingOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.teamSharingOptions, adaptableOptions.teamSharingOptions);
|
|
48
|
-
returnedAdaptableOptions.toolPanelOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.toolPanelOptions, adaptableOptions.toolPanelOptions);
|
|
49
|
-
returnedAdaptableOptions.dataChangeHistoryOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.dataChangeHistoryOptions, adaptableOptions.dataChangeHistoryOptions);
|
|
50
|
-
returnedAdaptableOptions.chartingOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.chartingOptions, adaptableOptions.chartingOptions);
|
|
51
|
-
returnedAdaptableOptions.chartingOptions.externalChartingOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.chartingOptions.externalChartingOptions, returnedAdaptableOptions.chartingOptions.externalChartingOptions);
|
|
52
|
-
returnedAdaptableOptions.settingsPanelOptions = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.settingsPanelOptions, adaptableOptions.settingsPanelOptions);
|
|
53
|
-
returnedAdaptableOptions.fdc3Options = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.fdc3Options, adaptableOptions.fdc3Options);
|
|
54
|
-
returnedAdaptableOptions.fdc3Options.actionColumnDefaultConfiguration = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.fdc3Options.actionColumnDefaultConfiguration, returnedAdaptableOptions.fdc3Options.actionColumnDefaultConfiguration);
|
|
55
|
-
returnedAdaptableOptions.fdc3Options.uiControlsDefaultConfiguration = Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.fdc3Options.uiControlsDefaultConfiguration, returnedAdaptableOptions.fdc3Options.uiControlsDefaultConfiguration);
|
|
56
|
-
const { predefinedConfig } = returnedAdaptableOptions;
|
|
57
|
-
if (predefinedConfig) {
|
|
58
|
-
returnedAdaptableOptions.predefinedConfig =
|
|
59
|
-
typeof predefinedConfig === 'string'
|
|
60
|
-
? predefinedConfig
|
|
61
|
-
: initPredefinedConfigWithUuids(predefinedConfig);
|
|
62
|
-
}
|
|
63
|
-
return returnedAdaptableOptions;
|
|
64
|
-
}
|
|
65
|
-
exports.assignAdaptableOptions = assignAdaptableOptions;
|
|
66
8
|
function initPredefinedConfigWithUuids(predefinedConfig) {
|
|
67
9
|
const customizer = (value) => {
|
|
68
10
|
// so whenever we clone a plain object,
|
|
@@ -154,13 +96,31 @@ function addUuidAndSource(adaptableObject) {
|
|
|
154
96
|
return adaptableObject;
|
|
155
97
|
}
|
|
156
98
|
exports.addUuidAndSource = addUuidAndSource;
|
|
99
|
+
function removeUuidAndSource(adaptableObject) {
|
|
100
|
+
const sanitiseObject = (object) => {
|
|
101
|
+
for (const key in object) {
|
|
102
|
+
if (key === 'Source' || key === 'Uuid') {
|
|
103
|
+
delete object[key];
|
|
104
|
+
}
|
|
105
|
+
else if (Array.isArray(object[key])) {
|
|
106
|
+
object[key].forEach((item) => sanitiseObject(item));
|
|
107
|
+
}
|
|
108
|
+
else if (typeof object[key] === 'object') {
|
|
109
|
+
sanitiseObject(object[key]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
sanitiseObject(adaptableObject);
|
|
114
|
+
return adaptableObject;
|
|
115
|
+
}
|
|
116
|
+
exports.removeUuidAndSource = removeUuidAndSource;
|
|
157
117
|
exports.AdaptableHelper = {
|
|
158
|
-
assignAdaptableOptions,
|
|
159
118
|
initPredefinedConfigWithUuids,
|
|
160
119
|
checkValidPrimaryKey,
|
|
161
120
|
AdaptableObjectExistsInState,
|
|
162
121
|
runAdaptableComparerFunction,
|
|
163
122
|
getAppropriateAccessLevel,
|
|
164
123
|
addUuidAndSource,
|
|
124
|
+
removeUuidAndSource,
|
|
165
125
|
};
|
|
166
126
|
exports.default = exports.AdaptableHelper;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare function objectExists(item: any): boolean;
|
|
2
2
|
export declare function objectNotExists(item: any): boolean;
|
|
3
|
+
export declare function objectHasKeys(item: any): boolean;
|
|
3
4
|
export declare function getStringRepresentionFromKey(event: KeyboardEvent | any): string;
|
|
4
5
|
export declare function cloneObject<T extends any>(obj: T): T;
|
|
5
6
|
export declare const arrayToKeyMap: <T extends string | number | symbol>(arr?: T[]) => Record<T, boolean>;
|
|
@@ -20,6 +21,7 @@ export declare function clamp(value: any, boundOne: number, boundTwo: number): n
|
|
|
20
21
|
export declare const Helper: {
|
|
21
22
|
objectExists: typeof objectExists;
|
|
22
23
|
objectNotExists: typeof objectNotExists;
|
|
24
|
+
objectHasKeys: typeof objectHasKeys;
|
|
23
25
|
getStringRepresentionFromKey: typeof getStringRepresentionFromKey;
|
|
24
26
|
cloneObject: typeof cloneObject;
|
|
25
27
|
convertArrayToCsv: typeof convertArrayToCsv;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Helper = exports.clamp = exports.modeNumberArray = exports.medianNumberArray = exports.meanNumberArray = exports.standardDeviationNumberArray = exports.sumNumberArray = exports.roundNumberTo4dp = exports.roundNumber = exports.isInputNotNullOrEmpty = exports.isInputNullOrEmpty = exports.returnItemCount = exports.copyToClipboard = exports.createDownloadedFile = exports.convertArrayToCsv = exports.arrayToKeyMap = exports.cloneObject = exports.getStringRepresentionFromKey = exports.objectNotExists = exports.objectExists = void 0;
|
|
3
|
+
exports.Helper = exports.clamp = exports.modeNumberArray = exports.medianNumberArray = exports.meanNumberArray = exports.standardDeviationNumberArray = exports.sumNumberArray = exports.roundNumberTo4dp = exports.roundNumber = exports.isInputNotNullOrEmpty = exports.isInputNullOrEmpty = exports.returnItemCount = exports.copyToClipboard = exports.createDownloadedFile = exports.convertArrayToCsv = exports.arrayToKeyMap = exports.cloneObject = exports.getStringRepresentionFromKey = exports.objectHasKeys = exports.objectNotExists = exports.objectExists = void 0;
|
|
4
4
|
const StringExtensions_1 = require("../Extensions/StringExtensions");
|
|
5
5
|
const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
|
|
6
6
|
function objectExists(item) {
|
|
@@ -11,6 +11,10 @@ function objectNotExists(item) {
|
|
|
11
11
|
return !objectExists(item);
|
|
12
12
|
}
|
|
13
13
|
exports.objectNotExists = objectNotExists;
|
|
14
|
+
function objectHasKeys(item) {
|
|
15
|
+
return Object.keys(item).length > 0;
|
|
16
|
+
}
|
|
17
|
+
exports.objectHasKeys = objectHasKeys;
|
|
14
18
|
function getStringRepresentionFromKey(event) {
|
|
15
19
|
if (event.key == null) {
|
|
16
20
|
return event.char; // IE
|
|
@@ -249,6 +253,7 @@ exports.clamp = clamp;
|
|
|
249
253
|
exports.Helper = {
|
|
250
254
|
objectExists,
|
|
251
255
|
objectNotExists,
|
|
256
|
+
objectHasKeys,
|
|
252
257
|
getStringRepresentionFromKey,
|
|
253
258
|
cloneObject,
|
|
254
259
|
convertArrayToCsv,
|
|
@@ -33,10 +33,10 @@ function CreateEmptyCalculatedColumn() {
|
|
|
33
33
|
// need to create some defaults - which we will change later
|
|
34
34
|
CalculatedColumnSettings: {
|
|
35
35
|
DataType: undefined,
|
|
36
|
-
Filterable:
|
|
37
|
-
Resizable:
|
|
36
|
+
Filterable: true,
|
|
37
|
+
Resizable: true,
|
|
38
38
|
Groupable: false,
|
|
39
|
-
Sortable:
|
|
39
|
+
Sortable: true,
|
|
40
40
|
Pivotable: false,
|
|
41
41
|
Aggregatable: false,
|
|
42
42
|
SuppressMenu: false,
|
|
@@ -282,10 +282,10 @@ function CreateEmptyFreeTextColumn() {
|
|
|
282
282
|
TextEditor: 'Inline',
|
|
283
283
|
FreeTextColumnSettings: {
|
|
284
284
|
DataType: 'String',
|
|
285
|
-
Filterable:
|
|
286
|
-
Resizable:
|
|
285
|
+
Filterable: true,
|
|
286
|
+
Resizable: true,
|
|
287
287
|
Groupable: false,
|
|
288
|
-
Sortable:
|
|
288
|
+
Sortable: true,
|
|
289
289
|
Pivotable: false,
|
|
290
290
|
Aggregatable: false,
|
|
291
291
|
SuppressMenu: false,
|
|
@@ -7,6 +7,7 @@ export declare class AggregatedScalarLiveValue {
|
|
|
7
7
|
private source;
|
|
8
8
|
private requestingModule;
|
|
9
9
|
private adaptableApi;
|
|
10
|
+
private getRowNodes?;
|
|
10
11
|
private aggregationReducerName;
|
|
11
12
|
private aggregatedScalarExpression;
|
|
12
13
|
private expressionEvaluation;
|
|
@@ -15,11 +16,11 @@ export declare class AggregatedScalarLiveValue {
|
|
|
15
16
|
aggregatedScalarExpression: string;
|
|
16
17
|
}, {
|
|
17
18
|
aggregatedScalarExpressionEvaluation: AggregatedScalarExpressionEvaluation;
|
|
18
|
-
}>, requestingModule: ModuleConstants, adaptableApi: AdaptableApi);
|
|
19
|
+
}>, requestingModule: ModuleConstants, adaptableApi: AdaptableApi, getRowNodes?: () => IRowNode[]);
|
|
19
20
|
refresh(): void;
|
|
20
21
|
getAggregatedValueForRow(rowNode: IRowNode): any;
|
|
21
22
|
getAllAggregationValues(): number[];
|
|
22
23
|
private getAggregationValue;
|
|
23
|
-
|
|
24
|
+
getGlobalAggregatedValue(): any;
|
|
24
25
|
private computeAggregatedValue;
|
|
25
26
|
}
|