@adaptabletools/adaptable 12.0.7 → 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.
Files changed (133) hide show
  1. package/base.css +231 -120
  2. package/bundle.cjs.js +142 -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/EventApi.d.ts +13 -1
  11. package/src/Api/Events/AdaptableStateReloaded.d.ts +23 -0
  12. package/src/Api/Events/AdaptableStateReloaded.js +2 -0
  13. package/src/Api/FilterApi.d.ts +15 -1
  14. package/src/Api/Implementation/CalculatedColumnApiImpl.js +2 -3
  15. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -0
  16. package/src/Api/Implementation/ColumnApiImpl.js +10 -0
  17. package/src/Api/Implementation/ConfigApiImpl.js +11 -0
  18. package/src/Api/Implementation/FilterApiImpl.d.ts +6 -1
  19. package/src/Api/Implementation/FilterApiImpl.js +58 -0
  20. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -1
  21. package/src/Api/Implementation/LayoutApiImpl.js +8 -16
  22. package/src/Api/Implementation/ScheduleApiImpl.js +4 -1
  23. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  24. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +7 -2
  25. package/src/PredefinedConfig/Common/CellSummary.d.ts +2 -6
  26. package/src/PredefinedConfig/LayoutState.d.ts +2 -0
  27. package/src/PredefinedConfig/ScheduleState.d.ts +4 -0
  28. package/src/Redux/Store/AdaptableStore.js +12 -6
  29. package/src/Strategy/AdaptableModuleBase.d.ts +2 -0
  30. package/src/Strategy/AdaptableModuleBase.js +6 -0
  31. package/src/Strategy/AlertModule.js +2 -2
  32. package/src/Strategy/CalculatedColumnModule.d.ts +2 -0
  33. package/src/Strategy/CalculatedColumnModule.js +4 -0
  34. package/src/Strategy/CellSummaryModule.js +4 -3
  35. package/src/Strategy/CustomSortModule.js +2 -2
  36. package/src/Strategy/ExportModule.js +2 -2
  37. package/src/Strategy/FlashingCellModule.js +3 -3
  38. package/src/Strategy/FormatColumnModule.js +2 -2
  39. package/src/Strategy/LayoutModule.js +10 -17
  40. package/src/Strategy/ShortcutModule.js +1 -1
  41. package/src/Strategy/TeamSharingModule.js +4 -2
  42. package/src/Strategy/Utilities/{getAlertBehaviourViewItems.d.ts → Alert/getAlertBehaviourViewItems.d.ts} +0 -0
  43. package/src/Strategy/Utilities/{getAlertBehaviourViewItems.js → Alert/getAlertBehaviourViewItems.js} +2 -2
  44. package/src/Strategy/Utilities/{getAlertPreviewViewItems.d.ts → Alert/getAlertPreviewViewItems.d.ts} +2 -2
  45. package/src/Strategy/Utilities/{getAlertPreviewViewItems.js → Alert/getAlertPreviewViewItems.js} +2 -2
  46. package/src/Strategy/Utilities/{getCustomSortColumnViewItems.d.ts → CustomSort/getCustomSortColumnViewItems.d.ts} +1 -1
  47. package/src/Strategy/Utilities/{getCustomSortColumnViewItems.js → CustomSort/getCustomSortColumnViewItems.js} +0 -0
  48. package/src/Strategy/Utilities/{getCustomSortSortOrderViewItems.d.ts → CustomSort/getCustomSortSortOrderViewItems.d.ts} +1 -1
  49. package/src/Strategy/Utilities/{getCustomSortSortOrderViewItems.js → CustomSort/getCustomSortSortOrderViewItems.js} +0 -0
  50. package/src/Strategy/Utilities/Export/getExportColumnsViewItems.d.ts +3 -0
  51. package/src/Strategy/Utilities/{getExportColumnsViewItems.js → Export/getExportColumnsViewItems.js} +0 -0
  52. package/src/Strategy/Utilities/{getExportRowsViewItems.d.ts → Export/getExportRowsViewItems.d.ts} +0 -0
  53. package/src/Strategy/Utilities/{getExportRowsViewItems.js → Export/getExportRowsViewItems.js} +0 -0
  54. package/src/Strategy/Utilities/{getFlashingCellDurationViewItems.d.ts → FlashingCell/getFlashingCellDurationViewItems.d.ts} +1 -1
  55. package/src/Strategy/Utilities/{getFlashingCellDurationViewItems.js → FlashingCell/getFlashingCellDurationViewItems.js} +0 -0
  56. package/src/Strategy/Utilities/{getFlashingCellStyleViewItems.d.ts → FlashingCell/getFlashingCellStyleViewItems.d.ts} +1 -1
  57. package/src/Strategy/Utilities/{getFlashingCellStyleViewItems.js → FlashingCell/getFlashingCellStyleViewItems.js} +1 -1
  58. package/src/Strategy/Utilities/{getFlashingTargetViewItems.d.ts → FlashingCell/getFlashingTargetViewItems.d.ts} +1 -1
  59. package/src/Strategy/Utilities/{getFlashingTargetViewItems.js → FlashingCell/getFlashingTargetViewItems.js} +0 -0
  60. package/src/Strategy/Utilities/{getFormatColumnSettingsViewItems.d.ts → FormatColumn/getFormatColumnSettingsViewItems.d.ts} +1 -1
  61. package/src/Strategy/Utilities/{getFormatColumnSettingsViewItems.js → FormatColumn/getFormatColumnSettingsViewItems.js} +0 -0
  62. package/src/Strategy/Utilities/{getFormatColumnStyleViewItems.d.ts → FormatColumn/getFormatColumnStyleViewItems.d.ts} +0 -0
  63. package/src/Strategy/Utilities/{getFormatColumnStyleViewItems.js → FormatColumn/getFormatColumnStyleViewItems.js} +1 -1
  64. package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.d.ts +5 -0
  65. package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +24 -0
  66. package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.d.ts +5 -0
  67. package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.js +14 -0
  68. package/src/Strategy/Utilities/{getShortcutSettingsViewItems.d.ts → Shortcut/getShortcutSettingsViewItems.d.ts} +1 -1
  69. package/src/Strategy/Utilities/{getShortcutSettingsViewItems.js → Shortcut/getShortcutSettingsViewItems.js} +0 -0
  70. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +4 -2
  71. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +144 -0
  72. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +1 -1
  73. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +6 -6
  74. package/src/Utilities/ObjectFactory.d.ts +1 -1
  75. package/src/Utilities/ObjectFactory.js +12 -11
  76. package/src/Utilities/Services/CalculatedColumnExpressionService.js +50 -11
  77. package/src/View/AdaptableView.js +3 -2
  78. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.d.ts +27 -1
  79. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +46 -36
  80. package/src/View/Components/FilterForm/ListBoxFilterForm.js +5 -4
  81. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +4 -2
  82. package/src/View/Components/Popups/AdaptableToaster.js +16 -33
  83. package/src/View/Components/ValueSelector/index.d.ts +10 -1
  84. package/src/View/Components/ValueSelector/index.js +16 -8
  85. package/src/View/FormatColumn/FormatColumnSummary.js +2 -1
  86. package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
  87. package/src/View/Layout/Wizard/LayoutWizard.d.ts +4 -7
  88. package/src/View/Layout/Wizard/LayoutWizard.js +127 -13
  89. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +8 -0
  90. package/src/View/Layout/Wizard/sections/AggregationsSection.js +102 -0
  91. package/src/View/Layout/Wizard/sections/ColumnsSection.d.ts +8 -0
  92. package/src/View/Layout/Wizard/sections/ColumnsSection.js +226 -0
  93. package/src/View/Layout/Wizard/sections/FilterSection.d.ts +8 -0
  94. package/src/View/Layout/Wizard/sections/FilterSection.js +35 -0
  95. package/src/View/Layout/Wizard/sections/PivotColumnsSection.d.ts +8 -0
  96. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +39 -0
  97. package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +8 -0
  98. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +46 -0
  99. package/src/View/Layout/Wizard/sections/SettingsSection.d.ts +8 -0
  100. package/src/View/Layout/Wizard/sections/SettingsSection.js +51 -0
  101. package/src/View/Layout/Wizard/sections/SortSection.d.ts +8 -0
  102. package/src/View/Layout/Wizard/sections/SortSection.js +69 -0
  103. package/src/View/Layout/Wizard/sections/Utilities.d.ts +2 -0
  104. package/src/View/Layout/Wizard/sections/Utilities.js +5 -0
  105. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +7 -2
  106. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +2 -2
  107. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +4 -0
  108. package/src/View/StatusBar/StatusBarPanel.js +1 -1
  109. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -0
  110. package/src/View/Wizard/OnePageAdaptableWizard.js +3 -3
  111. package/src/View/Wizard/OnePageWizards.d.ts +1 -0
  112. package/src/View/Wizard/OnePageWizards.js +1 -1
  113. package/src/agGrid/Adaptable.d.ts +3 -0
  114. package/src/agGrid/Adaptable.js +47 -10
  115. package/src/agGrid/agGridHelper.js +11 -1
  116. package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -0
  117. package/src/components/ExpressionEditor/index.js +1 -1
  118. package/src/components/Tabs/index.js +4 -2
  119. package/src/components/icons/arrow-down-long.d.ts +3 -0
  120. package/src/components/icons/arrow-down-long.js +7 -0
  121. package/src/components/icons/arrow-up-long.d.ts +3 -0
  122. package/src/components/icons/arrow-up-long.js +7 -0
  123. package/src/components/icons/index.js +4 -0
  124. package/src/metamodel/adaptable.metamodel.d.ts +9 -0
  125. package/src/metamodel/adaptable.metamodel.js +1 -1
  126. package/src/types.d.ts +1 -1
  127. package/version.d.ts +1 -1
  128. package/version.js +1 -1
  129. package/src/Strategy/Utilities/getExportColumnsViewItems.d.ts +0 -3
  130. package/src/View/Layout/LayoutEntityRow.d.ts +0 -13
  131. package/src/View/Layout/LayoutEntityRow.js +0 -23
  132. package/src/View/Layout/LayoutPopup.d.ts +0 -32
  133. package/src/View/Layout/LayoutPopup.js +0 -153
@@ -15,6 +15,10 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
15
15
  constructor(api) {
16
16
  super(ModuleConstants.CalculatedColumnModuleId, 'Calculated Column', 'calculated-column', 'CalculatedColumnPopup', 'Create bespoke columns whose cell value is derived dynamically from an Expression', api);
17
17
  }
18
+ handleConfigReloaded(adaptableStateReloadedInfo) {
19
+ // re-dispatch the CalculatedColumnReady action to recreate all the aggregated scalar columns
20
+ this.api.internalApi.dispatchReduxAction(CalculatedColumnRedux.CalculatedColumnReady(this.api.calculatedColumnApi.getCalculatedColumnState()));
21
+ }
18
22
  getModuleAdaptableObjects() {
19
23
  return this.api.calculatedColumnApi.getAllCalculatedColumn();
20
24
  }
@@ -98,14 +98,15 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
98
98
  const api = this.api;
99
99
  operationDefinitions === null || operationDefinitions === void 0 ? void 0 : operationDefinitions.forEach((operation) => {
100
100
  if (operation.operationFunction) {
101
- selectedCellSummary[operation.operationName] = operation.operationFunction({
101
+ const cellSummaryOperationContext = {
102
102
  selectedCellInfo,
103
103
  distinctCount,
104
104
  allValues,
105
105
  numericValues,
106
106
  numericColumns,
107
- api,
108
- });
107
+ adaptableApi: this.api,
108
+ };
109
+ selectedCellSummary[operation.operationName] = operation.operationFunction(cellSummaryOperationContext);
109
110
  }
110
111
  });
111
112
  }
@@ -6,8 +6,8 @@ const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
7
7
  const CustomSortRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/CustomSortRedux"));
8
8
  const CustomSortWizard_1 = require("../View/CustomSort/Wizard/CustomSortWizard");
9
- const getCustomSortColumnViewItems_1 = require("./Utilities/getCustomSortColumnViewItems");
10
- const getCustomSortSortOrderViewItems_1 = require("./Utilities/getCustomSortSortOrderViewItems");
9
+ const getCustomSortColumnViewItems_1 = require("./Utilities/CustomSort/getCustomSortColumnViewItems");
10
+ const getCustomSortSortOrderViewItems_1 = require("./Utilities/CustomSort/getCustomSortSortOrderViewItems");
11
11
  const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
12
12
  class CustomSortModule extends AdaptableModuleBase_1.AdaptableModuleBase {
13
13
  constructor(api) {
@@ -14,8 +14,8 @@ const StringExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensi
14
14
  const PopupRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/PopupRedux"));
15
15
  const ObjectFactory_1 = require("../Utilities/ObjectFactory");
16
16
  const NewReportWizard_1 = require("../View/Export/Wizard/NewReportWizard");
17
- const getExportColumnsViewItems_1 = require("./Utilities/getExportColumnsViewItems");
18
- const getExportRowsViewItems_1 = require("./Utilities/getExportRowsViewItems");
17
+ const getExportColumnsViewItems_1 = require("./Utilities/Export/getExportColumnsViewItems");
18
+ const getExportRowsViewItems_1 = require("./Utilities/Export/getExportRowsViewItems");
19
19
  const ReportExportDropdown_1 = require("../View/Export/ReportExportDropdown");
20
20
  const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
21
21
  const ExportSelector_1 = require("../View/Export/ExportSelector");
@@ -10,11 +10,11 @@ const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
10
10
  const AdaptableQuery_1 = require("../PredefinedConfig/Common/AdaptableQuery");
11
11
  const getScopeViewItems_1 = require("./Utilities/getScopeViewItems");
12
12
  const getRuleViewItems_1 = require("./Utilities/getRuleViewItems");
13
- const getFlashingCellDurationViewItems_1 = require("./Utilities/getFlashingCellDurationViewItems");
14
- const getFlashingCellStyleViewItems_1 = require("./Utilities/getFlashingCellStyleViewItems");
13
+ const getFlashingCellDurationViewItems_1 = require("./Utilities/FlashingCell/getFlashingCellDurationViewItems");
15
14
  const FlashingCellWizard_1 = require("../View/FlashingCell/Wizard/FlashingCellWizard");
16
- const getFlashingTargetViewItems_1 = require("./Utilities/getFlashingTargetViewItems");
17
15
  const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
16
+ const getFlashingTargetViewItems_1 = require("./Utilities/FlashingCell/getFlashingTargetViewItems");
17
+ const getFlashingCellStyleViewItems_1 = require("./Utilities/FlashingCell/getFlashingCellStyleViewItems");
18
18
  class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
19
19
  constructor(api) {
20
20
  super(ModuleConstants.FlashingCellModuleId, 'Flashing Cell', 'flashing-cell', 'FlashingAlert', 'Flash cells when they change', api);
@@ -10,8 +10,8 @@ const LoggingHelper_1 = require("../Utilities/Helpers/LoggingHelper");
10
10
  const FormatColumnWizard_1 = require("../View/FormatColumn/Wizard/FormatColumnWizard");
11
11
  const getScopeViewItems_1 = require("./Utilities/getScopeViewItems");
12
12
  const FormatColumnFormatWizardSection_1 = require("../View/FormatColumn/Wizard/FormatColumnFormatWizardSection");
13
- const getFormatColumnSettingsViewItems_1 = require("./Utilities/getFormatColumnSettingsViewItems");
14
- const getFormatColumnStyleViewItems_1 = require("./Utilities/getFormatColumnStyleViewItems");
13
+ const getFormatColumnSettingsViewItems_1 = require("./Utilities/FormatColumn/getFormatColumnSettingsViewItems");
14
+ const getFormatColumnStyleViewItems_1 = require("./Utilities/FormatColumn/getFormatColumnStyleViewItems");
15
15
  const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
16
16
  class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
17
17
  constructor(api) {
@@ -11,6 +11,9 @@ const LayoutStatusBarSubPanelPopover_1 = require("../View/Layout/LayoutStatusBar
11
11
  const EditCurrentLayoutButton_1 = require("../View/Layout/EditCurrentLayoutButton");
12
12
  const LayoutCloneButton_1 = require("../View/Layout/LayoutCloneButton");
13
13
  const SaveLayoutButton_1 = require("../View/Layout/SaveLayoutButton");
14
+ const LayoutWizard_1 = require("../View/Layout/Wizard/LayoutWizard");
15
+ const getLayoutFilterViewItems_1 = require("./Utilities/Layout/getLayoutFilterViewItems");
16
+ const getLayoutSortViewItems_1 = require("./Utilities/Layout/getLayoutSortViewItems");
14
17
  class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
15
18
  constructor(api) {
16
19
  super(ModuleConstants.LayoutModuleId, 'Layout', 'layout', 'LayoutPopup', 'Named sets of column visibility, order, groupings, aggregation, pivots etc.', api);
@@ -243,14 +246,16 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
243
246
  name: 'Name',
244
247
  values: [layout.Name],
245
248
  },
249
+ {
250
+ name: 'Pivot Layout',
251
+ values: [(layout === null || layout === void 0 ? void 0 : layout.EnablePivot) ? 'Yes' : 'No'],
252
+ },
246
253
  {
247
254
  name: 'Columns',
248
255
  values: columns,
249
256
  },
250
- ((_e = layout.ColumnSorts) === null || _e === void 0 ? void 0 : _e.length) && {
251
- name: 'Sort',
252
- values: layout.ColumnSorts.map((customSort) => `[${columnIdToFriendlyName(customSort.ColumnId)}: ${customSort.SortOrder}]`),
253
- },
257
+ ((_e = layout.ColumnSorts) === null || _e === void 0 ? void 0 : _e.length) && getLayoutSortViewItems_1.getLayoutSortViewItems(layout, this.api),
258
+ (layout === null || layout === void 0 ? void 0 : layout.ColumnFilters) && getLayoutFilterViewItems_1.getLayoutFilterViewItems(layout, this.api),
254
259
  ((_f = layout === null || layout === void 0 ? void 0 : layout.RowGroupedColumns) === null || _f === void 0 ? void 0 : _f.length) && {
255
260
  name: 'Grouped Columns',
256
261
  values: layout.RowGroupedColumns.map((colId) => columnIdToFriendlyName(colId)),
@@ -259,10 +264,6 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
259
264
  name: 'Pivot Columns',
260
265
  values: layout.PivotColumns.map((colId) => columnIdToFriendlyName(colId)),
261
266
  },
262
- (layout === null || layout === void 0 ? void 0 : layout.EnablePivot) && {
263
- name: 'Pivot Enabled',
264
- values: ['Yes'],
265
- },
266
267
  ].filter(Boolean),
267
268
  abObject: layout,
268
269
  };
@@ -277,15 +278,7 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
277
278
  }
278
279
  return LayoutRedux.LayoutDelete(layout);
279
280
  },
280
- onOpenEditPopup: (layout) => {
281
- if (!layout) {
282
- // consider it is new
283
- this.api.layoutApi.showLayoutEditor(null, 'New');
284
- }
285
- else {
286
- this.api.layoutApi.showLayoutEditor(layout.Name);
287
- }
288
- },
281
+ getEditWizard: () => LayoutWizard_1.LayoutWizard,
289
282
  getStatusBarPanelProps: () => {
290
283
  const text = this.api.layoutApi.getCurrentLayoutName();
291
284
  const layouts = this.api.layoutApi.getAllLayout();
@@ -10,7 +10,7 @@ const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
10
10
  const StringExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/StringExtensions"));
11
11
  const ShortcutWizard_1 = require("../View/Shortcut/Wizard/ShortcutWizard");
12
12
  const getScopeViewItems_1 = require("./Utilities/getScopeViewItems");
13
- const getShortcutSettingsViewItems_1 = require("./Utilities/getShortcutSettingsViewItems");
13
+ const getShortcutSettingsViewItems_1 = require("./Utilities/Shortcut/getShortcutSettingsViewItems");
14
14
  const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
15
15
  class ShortcutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
16
16
  constructor(api) {
@@ -32,10 +32,12 @@ class TeamSharingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
32
32
  // make sure there is no zombie import process remaining (in case a previous import crashed)
33
33
  this.api.internalApi.dispatchReduxAction(TeamSharingRedux.TeamSharingCommitImport());
34
34
  });
35
- this.api.teamSharingApi.triggerLoadingTeamSharingEntries();
35
+ if (this.api.teamSharingApi.isTeamSharingAvailable()) {
36
+ this.api.teamSharingApi.triggerLoadingTeamSharingEntries();
37
+ }
36
38
  }
37
39
  isModuleAvailable() {
38
- return super.isModuleAvailable() && this.api.teamSharingApi.isTeamSharingActivated();
40
+ return super.isModuleAvailable() && this.api.teamSharingApi.isTeamSharingAvailable();
39
41
  }
40
42
  isModuleObjectsShareable() {
41
43
  return false;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAlertBehaviourViewItems = void 0;
4
- const AdaptableContext_1 = require("../../View/AdaptableContext");
5
- const AlertBehaviourWizardSection_1 = require("../../View/Alert/Wizard/AlertBehaviourWizardSection");
4
+ const AdaptableContext_1 = require("../../../View/AdaptableContext");
5
+ const AlertBehaviourWizardSection_1 = require("../../../View/Alert/Wizard/AlertBehaviourWizardSection");
6
6
  const BehaviourView = (props) => {
7
7
  const adaptable = AdaptableContext_1.useAdaptable();
8
8
  return AlertBehaviourWizardSection_1.renderAlertBehaviourSummary(props.data, adaptable.api, true);
@@ -1,4 +1,4 @@
1
1
  import { AdaptableApi } from '../../../types';
2
- import { AlertDefinition } from '../../PredefinedConfig/AlertState';
3
- import { AdaptableObjectItemView } from '../Interface/IModule';
2
+ import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
3
+ import { AdaptableObjectItemView } from '../../Interface/IModule';
4
4
  export declare const getAlertPreviewViewItems: (alert: AlertDefinition, api: AdaptableApi) => AdaptableObjectItemView;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAlertPreviewViewItems = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const Tag_1 = require("../../components/Tag");
7
- const AlertDisplayWizardSection_1 = require("../../View/Alert/Wizard/AlertDisplayWizardSection");
6
+ const Tag_1 = require("../../../components/Tag");
7
+ const AlertDisplayWizardSection_1 = require("../../../View/Alert/Wizard/AlertDisplayWizardSection");
8
8
  const getAlertPreviewViewItems = (alert, api) => {
9
9
  return {
10
10
  name: 'Type and Display',
@@ -1,4 +1,4 @@
1
- import { AdaptableApi, CustomSort } from '../../../types';
1
+ import { AdaptableApi, CustomSort } from '../../../../types';
2
2
  export declare const getCustomSortColumnViewItems: (customSort: CustomSort, api: AdaptableApi) => {
3
3
  name: string;
4
4
  values: string[];
@@ -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);
@@ -177,6 +311,11 @@ exports.aggregatedScalarExpressionFunctions = {
177
311
  }
178
312
  return rowValue < minValue ? rowValue : minValue;
179
313
  },
314
+ done: (minValue) => {
315
+ if (minValue !== Number.MAX_VALUE) {
316
+ return minValue;
317
+ }
318
+ },
180
319
  },
181
320
  },
182
321
  },
@@ -218,6 +357,11 @@ exports.aggregatedScalarExpressionFunctions = {
218
357
  }
219
358
  return rowValue > maxValue ? rowValue : maxValue;
220
359
  },
360
+ done: (maxValue) => {
361
+ if (maxValue !== Number.MIN_VALUE) {
362
+ return maxValue;
363
+ }
364
+ },
221
365
  },
222
366
  },
223
367
  },
@@ -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;