@adaptabletools/adaptable 12.0.9 → 12.1.0-canary.2

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.
Files changed (122) hide show
  1. package/base.css +231 -120
  2. package/bundle.cjs.js +143 -114
  3. package/index.css +268 -130
  4. package/package.json +3 -3
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
  8. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +1 -2
  9. package/src/Api/ColumnApi.d.ts +5 -0
  10. package/src/Api/FilterApi.d.ts +15 -1
  11. package/src/Api/Implementation/CalculatedColumnApiImpl.js +2 -3
  12. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -0
  13. package/src/Api/Implementation/ColumnApiImpl.js +10 -0
  14. package/src/Api/Implementation/FilterApiImpl.d.ts +6 -1
  15. package/src/Api/Implementation/FilterApiImpl.js +58 -0
  16. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -1
  17. package/src/Api/Implementation/LayoutApiImpl.js +8 -16
  18. package/src/Api/Implementation/ScheduleApiImpl.js +4 -1
  19. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  20. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +7 -2
  21. package/src/PredefinedConfig/LayoutState.d.ts +2 -0
  22. package/src/PredefinedConfig/ScheduleState.d.ts +4 -0
  23. package/src/Redux/Store/AdaptableStore.js +11 -5
  24. package/src/Strategy/AlertModule.js +2 -2
  25. package/src/Strategy/CustomSortModule.js +2 -2
  26. package/src/Strategy/ExportModule.js +2 -2
  27. package/src/Strategy/FlashingCellModule.js +3 -3
  28. package/src/Strategy/FormatColumnModule.js +2 -2
  29. package/src/Strategy/LayoutModule.js +10 -17
  30. package/src/Strategy/ShortcutModule.js +1 -1
  31. package/src/Strategy/Utilities/{getAlertBehaviourViewItems.d.ts → Alert/getAlertBehaviourViewItems.d.ts} +0 -0
  32. package/src/Strategy/Utilities/{getAlertBehaviourViewItems.js → Alert/getAlertBehaviourViewItems.js} +2 -2
  33. package/src/Strategy/Utilities/{getAlertPreviewViewItems.d.ts → Alert/getAlertPreviewViewItems.d.ts} +2 -2
  34. package/src/Strategy/Utilities/{getAlertPreviewViewItems.js → Alert/getAlertPreviewViewItems.js} +2 -2
  35. package/src/Strategy/Utilities/{getCustomSortColumnViewItems.d.ts → CustomSort/getCustomSortColumnViewItems.d.ts} +1 -1
  36. package/src/Strategy/Utilities/{getCustomSortColumnViewItems.js → CustomSort/getCustomSortColumnViewItems.js} +0 -0
  37. package/src/Strategy/Utilities/{getCustomSortSortOrderViewItems.d.ts → CustomSort/getCustomSortSortOrderViewItems.d.ts} +1 -1
  38. package/src/Strategy/Utilities/{getCustomSortSortOrderViewItems.js → CustomSort/getCustomSortSortOrderViewItems.js} +0 -0
  39. package/src/Strategy/Utilities/Export/getExportColumnsViewItems.d.ts +3 -0
  40. package/src/Strategy/Utilities/{getExportColumnsViewItems.js → Export/getExportColumnsViewItems.js} +0 -0
  41. package/src/Strategy/Utilities/{getExportRowsViewItems.d.ts → Export/getExportRowsViewItems.d.ts} +0 -0
  42. package/src/Strategy/Utilities/{getExportRowsViewItems.js → Export/getExportRowsViewItems.js} +0 -0
  43. package/src/Strategy/Utilities/{getFlashingCellDurationViewItems.d.ts → FlashingCell/getFlashingCellDurationViewItems.d.ts} +1 -1
  44. package/src/Strategy/Utilities/{getFlashingCellDurationViewItems.js → FlashingCell/getFlashingCellDurationViewItems.js} +0 -0
  45. package/src/Strategy/Utilities/{getFlashingCellStyleViewItems.d.ts → FlashingCell/getFlashingCellStyleViewItems.d.ts} +1 -1
  46. package/src/Strategy/Utilities/{getFlashingCellStyleViewItems.js → FlashingCell/getFlashingCellStyleViewItems.js} +1 -1
  47. package/src/Strategy/Utilities/{getFlashingTargetViewItems.d.ts → FlashingCell/getFlashingTargetViewItems.d.ts} +1 -1
  48. package/src/Strategy/Utilities/{getFlashingTargetViewItems.js → FlashingCell/getFlashingTargetViewItems.js} +0 -0
  49. package/src/Strategy/Utilities/{getFormatColumnSettingsViewItems.d.ts → FormatColumn/getFormatColumnSettingsViewItems.d.ts} +1 -1
  50. package/src/Strategy/Utilities/{getFormatColumnSettingsViewItems.js → FormatColumn/getFormatColumnSettingsViewItems.js} +0 -0
  51. package/src/Strategy/Utilities/{getFormatColumnStyleViewItems.d.ts → FormatColumn/getFormatColumnStyleViewItems.d.ts} +0 -0
  52. package/src/Strategy/Utilities/{getFormatColumnStyleViewItems.js → FormatColumn/getFormatColumnStyleViewItems.js} +1 -1
  53. package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.d.ts +5 -0
  54. package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +24 -0
  55. package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.d.ts +5 -0
  56. package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.js +14 -0
  57. package/src/Strategy/Utilities/{getShortcutSettingsViewItems.d.ts → Shortcut/getShortcutSettingsViewItems.d.ts} +1 -1
  58. package/src/Strategy/Utilities/{getShortcutSettingsViewItems.js → Shortcut/getShortcutSettingsViewItems.js} +0 -0
  59. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +4 -2
  60. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +134 -0
  61. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +1 -1
  62. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +6 -6
  63. package/src/Utilities/ObjectFactory.d.ts +1 -1
  64. package/src/Utilities/ObjectFactory.js +12 -11
  65. package/src/Utilities/Services/CalculatedColumnExpressionService.js +32 -4
  66. package/src/View/AdaptableView.js +2 -2
  67. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.d.ts +27 -1
  68. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +46 -36
  69. package/src/View/Components/FilterForm/ListBoxFilterForm.js +5 -4
  70. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +4 -2
  71. package/src/View/Components/Popups/AdaptableToaster.js +15 -33
  72. package/src/View/Components/ValueSelector/index.d.ts +10 -1
  73. package/src/View/Components/ValueSelector/index.js +16 -8
  74. package/src/View/FormatColumn/FormatColumnSummary.js +2 -1
  75. package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
  76. package/src/View/Layout/Wizard/LayoutWizard.d.ts +4 -7
  77. package/src/View/Layout/Wizard/LayoutWizard.js +127 -13
  78. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +8 -0
  79. package/src/View/Layout/Wizard/sections/AggregationsSection.js +102 -0
  80. package/src/View/Layout/Wizard/sections/ColumnsSection.d.ts +8 -0
  81. package/src/View/Layout/Wizard/sections/ColumnsSection.js +226 -0
  82. package/src/View/Layout/Wizard/sections/FilterSection.d.ts +8 -0
  83. package/src/View/Layout/Wizard/sections/FilterSection.js +35 -0
  84. package/src/View/Layout/Wizard/sections/PivotColumnsSection.d.ts +8 -0
  85. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +39 -0
  86. package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +8 -0
  87. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +46 -0
  88. package/src/View/Layout/Wizard/sections/SettingsSection.d.ts +8 -0
  89. package/src/View/Layout/Wizard/sections/SettingsSection.js +51 -0
  90. package/src/View/Layout/Wizard/sections/SortSection.d.ts +8 -0
  91. package/src/View/Layout/Wizard/sections/SortSection.js +69 -0
  92. package/src/View/Layout/Wizard/sections/Utilities.d.ts +2 -0
  93. package/src/View/Layout/Wizard/sections/Utilities.js +5 -0
  94. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +7 -2
  95. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +2 -2
  96. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +4 -0
  97. package/src/View/StatusBar/StatusBarPanel.js +1 -1
  98. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -0
  99. package/src/View/Wizard/OnePageAdaptableWizard.js +3 -3
  100. package/src/View/Wizard/OnePageWizards.d.ts +1 -0
  101. package/src/View/Wizard/OnePageWizards.js +1 -1
  102. package/src/agGrid/Adaptable.d.ts +2 -0
  103. package/src/agGrid/Adaptable.js +33 -9
  104. package/src/agGrid/agGridHelper.js +11 -1
  105. package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -0
  106. package/src/components/ExpressionEditor/index.js +1 -1
  107. package/src/components/Tabs/index.js +4 -2
  108. package/src/components/icons/arrow-down-long.d.ts +3 -0
  109. package/src/components/icons/arrow-down-long.js +7 -0
  110. package/src/components/icons/arrow-up-long.d.ts +3 -0
  111. package/src/components/icons/arrow-up-long.js +7 -0
  112. package/src/components/icons/index.js +4 -0
  113. package/src/metamodel/adaptable.metamodel.d.ts +9 -0
  114. package/src/metamodel/adaptable.metamodel.js +1 -1
  115. package/src/types.d.ts +1 -1
  116. package/version.d.ts +1 -1
  117. package/version.js +1 -1
  118. package/src/Strategy/Utilities/getExportColumnsViewItems.d.ts +0 -3
  119. package/src/View/Layout/LayoutEntityRow.d.ts +0 -13
  120. package/src/View/Layout/LayoutEntityRow.js +0 -23
  121. package/src/View/Layout/LayoutPopup.d.ts +0 -32
  122. package/src/View/Layout/LayoutPopup.js +0 -153
@@ -1,4 +1,4 @@
1
- import { CustomSort } from '../../../types';
1
+ import { CustomSort } from '../../../../types';
2
2
  export declare const getCustomSortSortOrderViewItems: (customSort: CustomSort) => {
3
3
  name: string;
4
4
  values: string[];
@@ -0,0 +1,3 @@
1
+ import { AdaptableApi, Report } from '../../../../types';
2
+ import { AdaptableObjectItemView } from '../../Interface/IModule';
3
+ export declare const getExportColumnsViewItems: (report: Report, api: AdaptableApi) => AdaptableObjectItemView;
@@ -1,4 +1,4 @@
1
- import { FlashingCellDefinition } from '../../../types';
1
+ import { FlashingCellDefinition } from '../../../../types';
2
2
  export declare const getFlashingCellDurationViewItems: (flashingCell: FlashingCellDefinition) => {
3
3
  name: string;
4
4
  values: (number | "always")[];
@@ -1,2 +1,2 @@
1
- import { AdaptableObjectItemView } from '../Interface/IModule';
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("../../View/FlashingCell/FlashingCellStyle");
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("../../PredefinedConfig/FlashingCellState").FlashTargetTypes[];
4
+ values: import("../../../PredefinedConfig/FlashingCellState").FlashTargetTypes[];
5
5
  };
@@ -1,4 +1,4 @@
1
- import { FormatColumn } from '../../../types';
1
+ import { FormatColumn } from '../../../../types';
2
2
  export declare const getFormatColumnSettingsViewItems: (calculatedColumn: FormatColumn) => {
3
3
  name: string;
4
4
  values: string[];
@@ -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("../../View/FormatColumn/Wizard/FormatColumnStyleWizardSection");
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,5 @@
1
+ import { AdaptableApi, Layout } from '../../../../types';
2
+ export declare const getLayoutFilterViewItems: (layout: Layout, api: AdaptableApi) => {
3
+ name: string;
4
+ values: string[];
5
+ };
@@ -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,5 @@
1
+ import { AdaptableApi, Layout } from '../../../types';
2
+ export declare const getLayoutSortViewItems: (layout: Layout, api: AdaptableApi) => {
3
+ name: string;
4
+ values: string[];
5
+ };
@@ -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;
@@ -1,4 +1,4 @@
1
- import { Shortcut } from '../../../types';
1
+ import { Shortcut } from '../../../../types';
2
2
  export declare const getShortcutSettingsViewItems: (shortcut: Shortcut) => {
3
3
  name: string;
4
4
  values: string[];
@@ -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, aggregationValue: number) => string | number | Date | boolean;
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,9 +25,9 @@ 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';
29
28
  import { RowNode } from '@ag-grid-community/all-modules';
30
29
  import { AdaptableApi } from '../../types';
30
+ import type { ToastOptions } from 'react-toastify';
31
31
  export declare function CreateEmptyCustomSort(): CustomSort;
32
32
  export declare function CreateEmptyCalculatedColumn(isFilterable: boolean): CalculatedColumn;
33
33
  export declare function CreateEmptyNamedQuery(expression?: string): NamedQuery;
@@ -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 react_toastify_1 = require("react-toastify");
7
+ const { toast, Bounce, Flip, Slide, Zoom } = require('react-toastify');
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 react_toastify_1.toast.POSITION.BOTTOM_LEFT;
396
+ return toast.POSITION.BOTTOM_LEFT;
396
397
  case 'BottomCenter':
397
- return react_toastify_1.toast.POSITION.BOTTOM_CENTER;
398
+ return toast.POSITION.BOTTOM_CENTER;
398
399
  case 'BottomRight':
399
- return react_toastify_1.toast.POSITION.BOTTOM_RIGHT;
400
+ return toast.POSITION.BOTTOM_RIGHT;
400
401
  case 'TopLeft':
401
- return react_toastify_1.toast.POSITION.TOP_LEFT;
402
+ return toast.POSITION.TOP_LEFT;
402
403
  case 'TopCenter':
403
- return react_toastify_1.toast.POSITION.TOP_CENTER;
404
+ return toast.POSITION.TOP_CENTER;
404
405
  case 'TopRight':
405
- return react_toastify_1.toast.POSITION.TOP_RIGHT;
406
+ return toast.POSITION.TOP_RIGHT;
406
407
  }
407
408
  }
408
409
  function getToastTransition(transition) {
409
410
  switch (transition) {
410
411
  case 'Bounce':
411
- return react_toastify_1.Bounce;
412
+ return Bounce;
412
413
  case 'Slide':
413
- return react_toastify_1.Slide;
414
+ return Slide;
414
415
  case 'Zoom':
415
- return react_toastify_1.Zoom;
416
+ return Zoom;
416
417
  case 'Flip':
417
- return react_toastify_1.Flip;
418
+ return Flip;
418
419
  }
419
420
  }
420
421
  exports.ObjectFactory = {
@@ -122,12 +122,17 @@ class CalculatedColumnExpressionService {
122
122
  }
123
123
  }
124
124
  createAggregatedScalarCalculatedColumn(calculatedColumn) {
125
- var _a;
125
+ var _a, _b;
126
126
  // if there is already an aggregated scalar, delete it (possible when editing)
127
127
  this.destroyAggregatedScalarCalculatedColumn(calculatedColumn);
128
128
  if ((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.AggregatedScalarExpression) {
129
- const aggregatedScalarCalculatedColumn = new AggregatedScalarCalculatedColumn(calculatedColumn, this.adaptableApi);
130
- this.aggregatedScalarCalculatedColumnsMap.set(calculatedColumn.Uuid, aggregatedScalarCalculatedColumn);
129
+ try {
130
+ const aggregatedScalarCalculatedColumn = new AggregatedScalarCalculatedColumn(calculatedColumn, this.adaptableApi);
131
+ this.aggregatedScalarCalculatedColumnsMap.set(calculatedColumn.Uuid, aggregatedScalarCalculatedColumn);
132
+ }
133
+ catch (e) {
134
+ LoggingHelper_1.LogAdaptableError(`Creating CalculatedColumn ('${(_b = calculatedColumn.Query) === null || _b === void 0 ? void 0 : _b.AggregatedScalarExpression}') failed!\n${e.message}`);
135
+ }
131
136
  }
132
137
  }
133
138
  destroyAggregatedScalarCalculatedColumn(calculatedColumn) {
@@ -197,7 +202,30 @@ class AggregatedScalarCalculatedColumn {
197
202
  groupByDef.toKey = mapGroupByToKey(groupByDef.field);
198
203
  });
199
204
  if (!expressionEvaluation.cumulateOver) {
200
- return scalarAggregationHelper_1.aggregate(expressionEvaluation.aggregationParams, gridRowNodes);
205
+ let aggregatedRowNodes = gridRowNodes;
206
+ if (expressionEvaluation.sortByColumn) {
207
+ const sortByColumn = expressionEvaluation.sortByColumn;
208
+ const getRowNodeValue = (rowNode, columnId) => this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId);
209
+ if (expressionEvaluation.filterUndefinedValues) {
210
+ aggregatedRowNodes = gridRowNodes.filter((node) => {
211
+ const rowValue = getRowNodeValue(node, sortByColumn);
212
+ return rowValue != undefined;
213
+ });
214
+ }
215
+ // currently, we support only ascending sorting
216
+ aggregatedRowNodes.sort((first, second) => {
217
+ const firstValue = getRowNodeValue(first, sortByColumn);
218
+ const secondValue = getRowNodeValue(second, sortByColumn);
219
+ if (firstValue < secondValue) {
220
+ return -1;
221
+ }
222
+ if (firstValue > secondValue) {
223
+ return 1;
224
+ }
225
+ return 0;
226
+ });
227
+ }
228
+ return scalarAggregationHelper_1.aggregate(expressionEvaluation.aggregationParams, aggregatedRowNodes);
201
229
  }
202
230
  else {
203
231
  // 1. sort grid data by given OVER column
@@ -13,9 +13,9 @@ 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
- const react_toastify_1 = require("react-toastify");
17
16
  const WindowPopups_1 = require("./Components/Popups/WindowPopups/WindowPopups");
18
17
  const FormPopups_1 = require("./Components/Popups/FormPopups/FormPopups");
18
+ const { ToastContainer } = require('react-toastify');
19
19
  class AdaptableView extends React.Component {
20
20
  render() {
21
21
  var _a, _b, _c, _d;
@@ -27,7 +27,7 @@ class AdaptableView extends React.Component {
27
27
  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
28
  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
29
  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(react_toastify_1.ToastContainer
30
+ React.createElement(ToastContainer
31
31
  // we NEEEEED!!!! this containerId, otherwise, toastify will have memory leaks when the adaptable
32
32
  // instance is destroyed and re-created many times
33
33
  , {
@@ -1,5 +1,30 @@
1
1
  import * as React from 'react';
2
- import { AdaptableObjectView, IModule } from '../../../Strategy/Interface/IModule';
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 {};