@adaptabletools/adaptable-cjs 18.0.0-canary.32 → 18.0.0-canary.34

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 (88) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableOptions/MenuOptions.d.ts +36 -16
  3. package/src/AdaptableOptions/MenuOptions.js +5 -0
  4. package/src/AdaptableOptions/QuickSearchOptions.d.ts +1 -1
  5. package/src/Api/GridApi.d.ts +1 -1
  6. package/src/Api/Implementation/NoteApiImpl.d.ts +1 -1
  7. package/src/Api/Implementation/NoteApiImpl.js +2 -2
  8. package/src/Api/Internal/FormatColumnInternalApi.js +1 -1
  9. package/src/Api/NoteApi.d.ts +1 -1
  10. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  11. package/src/PredefinedConfig/Common/Menu.d.ts +14 -6
  12. package/src/PredefinedConfig/Common/Menu.js +3 -0
  13. package/src/PredefinedConfig/Common/RowScope.d.ts +2 -2
  14. package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
  15. package/src/PredefinedConfig/LayoutState.d.ts +1 -1
  16. package/src/Redux/ActionsReducers/NoteRedux.d.ts +1 -1
  17. package/src/Redux/ActionsReducers/NoteRedux.js +5 -5
  18. package/src/Strategy/AdaptableModuleBase.d.ts +8 -8
  19. package/src/Strategy/AlertModule.d.ts +3 -2
  20. package/src/Strategy/BulkUpdateModule.d.ts +3 -2
  21. package/src/Strategy/CalculatedColumnModule.d.ts +3 -4
  22. package/src/Strategy/CalculatedColumnModule.js +16 -12
  23. package/src/Strategy/CellSummaryModule.d.ts +3 -4
  24. package/src/Strategy/CellSummaryModule.js +17 -14
  25. package/src/Strategy/ColumnFilterModule.d.ts +3 -3
  26. package/src/Strategy/ColumnInfoModule.d.ts +3 -3
  27. package/src/Strategy/CommentModule.d.ts +3 -2
  28. package/src/Strategy/CustomSortModule.d.ts +1 -2
  29. package/src/Strategy/DashboardModule.d.ts +3 -3
  30. package/src/Strategy/DataImportModule.d.ts +2 -2
  31. package/src/Strategy/ExportModule.d.ts +1 -1
  32. package/src/Strategy/ExportModule.js +19 -2
  33. package/src/Strategy/Fdc3Module.d.ts +1 -1
  34. package/src/Strategy/FlashingCellModule.d.ts +4 -3
  35. package/src/Strategy/FormatColumnModule.d.ts +1 -1
  36. package/src/Strategy/FormatColumnModule.js +0 -1
  37. package/src/Strategy/FreeTextColumnModule.d.ts +1 -2
  38. package/src/Strategy/GridInfoModule.d.ts +3 -3
  39. package/src/Strategy/Interface/IModule.d.ts +3 -3
  40. package/src/Strategy/LayoutModule.d.ts +2 -2
  41. package/src/Strategy/NoteModule.d.ts +2 -2
  42. package/src/Strategy/NoteModule.js +3 -3
  43. package/src/Strategy/PlusMinusModule.d.ts +1 -2
  44. package/src/Strategy/SettingsPanelModule.d.ts +2 -2
  45. package/src/Strategy/SmartEditModule.d.ts +3 -2
  46. package/src/Strategy/StyledColumnModule.d.ts +1 -1
  47. package/src/Strategy/StyledColumnModule.js +1 -9
  48. package/src/Strategy/SystemStatusModule.d.ts +3 -3
  49. package/src/Strategy/SystemStatusModule.js +3 -1
  50. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +1 -1
  51. package/src/Utilities/MenuItem.d.ts +9 -9
  52. package/src/Utilities/Services/CellPopupService.js +4 -4
  53. package/src/Utilities/Services/RowSummaryService.d.ts +7 -3
  54. package/src/Utilities/Services/RowSummaryService.js +29 -15
  55. package/src/View/BulkUpdate/BulkUpdatePopup.js +2 -2
  56. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +4 -1
  57. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +1 -0
  58. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +2 -5
  59. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  60. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +5 -5
  61. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +1 -1
  62. package/src/View/SmartEdit/SmartEditPopup.js +1 -1
  63. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +5 -7
  64. package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +5 -5
  65. package/src/agGrid/ActionColumnRenderer.js +2 -2
  66. package/src/agGrid/AgGridColumnAdapter.js +2 -2
  67. package/src/agGrid/AgGridMenuAdapter.d.ts +1 -0
  68. package/src/agGrid/AgGridMenuAdapter.js +75 -64
  69. package/src/agGrid/BadgeRenderer.js +1 -1
  70. package/src/agGrid/PercentBarRenderer.js +1 -1
  71. package/src/components/Accordion.d.ts +7 -0
  72. package/src/components/Accordion.js +41 -0
  73. package/src/components/icons/collapse-all.d.ts +3 -0
  74. package/src/components/icons/collapse-all.js +7 -0
  75. package/src/components/icons/csv.d.ts +3 -0
  76. package/src/components/icons/csv.js +7 -0
  77. package/src/components/icons/data-object.d.ts +3 -0
  78. package/src/components/icons/data-object.js +7 -0
  79. package/src/components/icons/excel.d.ts +3 -0
  80. package/src/components/icons/excel.js +8 -0
  81. package/src/components/icons/expand-all.d.ts +3 -0
  82. package/src/components/icons/expand-all.js +7 -0
  83. package/src/components/icons/index.js +10 -0
  84. package/src/env.js +2 -2
  85. package/src/metamodel/adaptable.metamodel.d.ts +10 -0
  86. package/src/metamodel/adaptable.metamodel.js +1 -1
  87. package/src/types.d.ts +1 -1
  88. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -9,7 +9,7 @@ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/
9
9
  const Helper_1 = tslib_1.__importDefault(require("../Helpers/Helper"));
10
10
  const AggregatedScalarLiveValue_1 = require("./AggregatedScalarLiveValue");
11
11
  const ObjectExtensions_1 = require("../Extensions/ObjectExtensions");
12
- const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
12
+ const throttle_1 = tslib_1.__importDefault(require("lodash/throttle"));
13
13
  /**
14
14
  * The logic is extracted here to make it easier to follow
15
15
  */
@@ -17,7 +17,12 @@ class RowSummaryService {
17
17
  constructor(api) {
18
18
  this.api = api;
19
19
  this.cachedCellSummary = new Map();
20
- this.debouncedEvaluateRowSummary = (0, debounce_1.default)(this.evaluateRowSummary, 300);
20
+ this._throttleAcumulatedColumnsThatChanged = new Set();
21
+ /**
22
+ *
23
+ * @param colId optional to evaluate only one column
24
+ */
25
+ this._throttledEvaluateRowSummary = (0, throttle_1.default)(this.evaluateRowSummary, 300);
21
26
  }
22
27
  onAdapterReady() {
23
28
  this.rowSummariesSubscriptions();
@@ -31,17 +36,17 @@ class RowSummaryService {
31
36
  if (!this.api.layoutApi.internalApi.getLayoutSupportedFeatures().RowSummaries) {
32
37
  return;
33
38
  }
34
- this.debouncedEvaluateRowSummary();
39
+ this.throttledEvaluateRowSummary();
35
40
  this.api.eventApi.on('AdaptableStateReloaded', () => {
36
- this.debouncedEvaluateRowSummary();
41
+ this.throttledEvaluateRowSummary();
37
42
  });
38
43
  this.api.eventApi.on('GridDataChanged', (event) => {
39
- this.debouncedEvaluateRowSummary();
44
+ this.throttledEvaluateRowSummary();
40
45
  });
41
46
  this.api.eventApi.on('CellChanged', (event) => {
42
47
  const columnId = event.cellChange.column.columnId;
43
- this.debouncedEvaluateRowSummary({
44
- columnId,
48
+ this.throttledEvaluateRowSummary({
49
+ columnIds: [columnId],
45
50
  });
46
51
  });
47
52
  this.api.eventApi.on('LayoutChanged', (event) => {
@@ -51,25 +56,34 @@ class RowSummaryService {
51
56
  }
52
57
  setTimeout(() => {
53
58
  // the timeout is added so the grid has time to repond to the layout changed
54
- this.debouncedEvaluateRowSummary();
59
+ this.throttledEvaluateRowSummary();
55
60
  }, 16);
56
61
  });
57
62
  const adaptable = this.api.internalApi.getAdaptableInstance();
58
63
  adaptable._on('AdapTableFiltersApplied', () => {
59
64
  // we need to use this instead of layout changed
60
65
  // so the rows have time to update
61
- this.debouncedEvaluateRowSummary();
66
+ this.throttledEvaluateRowSummary();
62
67
  });
63
68
  adaptable._on('FirstDataRendered', () => {
64
- this.debouncedEvaluateRowSummary();
69
+ this.throttledEvaluateRowSummary();
65
70
  });
66
71
  }
67
- /**
68
- *
69
- * @param colId optional to evaluate only one column
70
- */
72
+ throttledEvaluateRowSummary(reason) {
73
+ if (reason) {
74
+ reason.columnIds.forEach((col) => this._throttleAcumulatedColumnsThatChanged.add(col));
75
+ }
76
+ this._throttledEvaluateRowSummary(reason);
77
+ }
71
78
  evaluateRowSummary(reason) {
72
79
  var _a;
80
+ if (this._throttleAcumulatedColumnsThatChanged.size > 0) {
81
+ const columnIds = Array.from(this._throttleAcumulatedColumnsThatChanged.values());
82
+ reason = {
83
+ columnIds,
84
+ };
85
+ this._throttleAcumulatedColumnsThatChanged.clear();
86
+ }
73
87
  if (this.api.isDestroyed()) {
74
88
  return;
75
89
  }
@@ -95,7 +109,7 @@ class RowSummaryService {
95
109
  // refresh all of them
96
110
  expressionLiveValue.refresh();
97
111
  }
98
- else if ('columnId' in reason && reason.columnId === columnId) {
112
+ else if ('columnIds' in reason && reason.columnIds.includes(columnId)) {
99
113
  expressionLiveValue.refresh();
100
114
  }
101
115
  }
@@ -54,7 +54,7 @@ class BulkUpdatePopupComponent extends React.Component {
54
54
  React.createElement(SimpleButton_1.default, { disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
55
55
  this.props.PreviewInfo.previewValidationSummary.validationResult == 'All', onClick: () => {
56
56
  this.onApplyClick();
57
- }, variant: "raised", tone: "accent" }, "Apply to Grid")))) : (React.createElement(React.Fragment, null,
57
+ }, variant: "raised", tone: "accent" }, "Apply Bulk Update")))) : (React.createElement(React.Fragment, null,
58
58
  React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, "Select an existing Column value from the dropdown, or enter a new value"),
59
59
  React.createElement(rebass_1.Flex, { marginTop: 2, flexDirection: "row", alignItems: "center" },
60
60
  React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 },
@@ -63,7 +63,7 @@ class BulkUpdatePopupComponent extends React.Component {
63
63
  this.props.PreviewInfo.previewValidationSummary.validationResult == 'All' ||
64
64
  hasDataTypeError, variant: "raised", tone: "accent", marginRight: 2, onClick: () => {
65
65
  this.onApplyClick();
66
- } }, "Apply to Grid"),
66
+ } }, "Apply Bulk Update"),
67
67
  ' ',
68
68
  hasDataTypeError && (React.createElement(AdaptablePopover_1.AdaptablePopover, { headerText: 'Update Error', bodyText: [dataTypeErrorMessage], MessageType: 'Error' })),
69
69
  StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue) &&
@@ -39,7 +39,10 @@ const AdaptablePopup = (props) => {
39
39
  let componentName = props.componentName;
40
40
  // ts forces to check for General, there is no menu item General
41
41
  const useFirstItem = !props.componentName;
42
- if (useFirstItem && firstMenuModule !== 'General' && firstMenuModule !== 'CustomSettingsPanel') {
42
+ if (useFirstItem &&
43
+ firstMenuModule !== 'General' &&
44
+ firstMenuModule !== 'CustomSettingsPanel' &&
45
+ firstMenuModule !== 'Group') {
43
46
  componentModule = firstMenuModule;
44
47
  }
45
48
  const customSettingsPanel = (_c = settingsPanelOptions === null || settingsPanelOptions === void 0 ? void 0 : settingsPanelOptions.customSettingsPanels) === null || _c === void 0 ? void 0 : _c.find((customPanel) => useFirstItem ? customPanel.name === firstMenuItem.label : customPanel.name === componentName);
@@ -22,6 +22,7 @@ const useMenuItems = () => {
22
22
  }
23
23
  const visibleItems = allMenuItems.filter((item) => item.module !== 'General' &&
24
24
  item.module !== 'CustomSettingsPanel' &&
25
+ item.module !== 'Group' &&
25
26
  !DefaultSettingsPanel_1.STANDALONE_MODULE_POPUPS.includes(item.module) &&
26
27
  item.isVisible);
27
28
  let navItems = navigationItems
@@ -17,11 +17,8 @@ const ConnectedNoteEditor = ({ enableEditMode }) => {
17
17
  const editMode = (0, react_redux_1.useSelector)((state) => (0, SystemRedux_1.SystemCommentsAndNotesEditModeSelector)(state.System));
18
18
  const cellPopupService = api.internalApi.getCellPopupService();
19
19
  const cellAddress = (0, react_redux_1.useSelector)((state) => (0, SystemRedux_1.SystemCommentsAndNotesSelector)(state.System));
20
- const [
21
- // Only handle first note for now
22
- // Later we can handle multiple notes
23
- note,] = (0, react_redux_1.useSelector)((state) => {
24
- return cellAddress ? (0, NoteRedux_1.GetNotesSelector)(state.Note, cellAddress) : [];
20
+ const note = (0, react_redux_1.useSelector)((state) => {
21
+ return cellAddress ? (0, NoteRedux_1.GetNoteSelector)(state.Note, cellAddress) : null;
25
22
  });
26
23
  const handleNoteChange = React.useCallback((value) => {
27
24
  api.noteApi.updateNoteText(value, note);
@@ -100,7 +100,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
100
100
  columnId: 'undoActionColumn',
101
101
  friendlyName: ' ',
102
102
  rowScope: {
103
- ExcludeGroupedRows: true,
103
+ ExcludeGroupRows: true,
104
104
  ExcludeSummaryRows: true,
105
105
  },
106
106
  actionColumnSettings: { suppressMenu: true, suppressMovable: true },
@@ -22,8 +22,8 @@ const renderFormatColumnSettingsSummary = (data) => {
22
22
  React.createElement(Tag_1.Tag, null, ((_b = data.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeDataRows) ? 'no' : 'yes')),
23
23
  ' ',
24
24
  React.createElement(rebass_1.Text, { mt: 3 },
25
- "Grouped Rows ",
26
- React.createElement(Tag_1.Tag, null, ((_c = data.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeGroupedRows) ? 'no' : 'yes')),
25
+ "Group Rows ",
26
+ React.createElement(Tag_1.Tag, null, ((_c = data.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeGroupRows) ? 'no' : 'yes')),
27
27
  React.createElement(rebass_1.Text, { mt: 3 },
28
28
  "Summary Rows ",
29
29
  React.createElement(Tag_1.Tag, null, ((_d = data.RowScope) === null || _d === void 0 ? void 0 : _d.ExcludeSummaryRows) ? 'no' : 'yes'))));
@@ -43,7 +43,7 @@ const FormatColumnSettingsWizardSection = (props) => {
43
43
  props.onChange(Object.assign(Object.assign({}, data), { RowScope: Object.assign(Object.assign({}, data.RowScope), { ExcludeDataRows }) }));
44
44
  };
45
45
  const onExcludeGroupedRowsChanged = (ExcludeGroupedRows) => {
46
- props.onChange(Object.assign(Object.assign({}, data), { RowScope: Object.assign(Object.assign({}, data.RowScope), { ExcludeGroupedRows }) }));
46
+ props.onChange(Object.assign(Object.assign({}, data), { RowScope: Object.assign(Object.assign({}, data.RowScope), { ExcludeGroupRows: ExcludeGroupedRows }) }));
47
47
  };
48
48
  const onExcludeSummaryRowsChanged = (ExcludeSummaryRows) => {
49
49
  props.onChange(Object.assign(Object.assign({}, data), { RowScope: Object.assign(Object.assign({}, data.RowScope), { ExcludeSummaryRows }) }));
@@ -67,9 +67,9 @@ const FormatColumnSettingsWizardSection = (props) => {
67
67
  React.createElement(FormLayout_1.FormRow, { label: "Exclude Data Rows:" },
68
68
  React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
69
69
  React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-data-rows-checkbox", checked: (_a = data.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeDataRows, onChange: onExcludeDataRowsChanged, mr: 2 }))),
70
- React.createElement(FormLayout_1.FormRow, { label: "Exclude Grouped Rows:" },
70
+ React.createElement(FormLayout_1.FormRow, { label: "Exclude Group Rows:" },
71
71
  React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
72
- React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-grouped-rows-checkbox", checked: (_b = data.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
72
+ React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-grouped-rows-checkbox", checked: (_b = data.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
73
73
  React.createElement(FormLayout_1.FormRow, { label: "Exclude Row Summaries:" },
74
74
  React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
75
75
  React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked: (_c = data.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged, mr: 2 }))))))));
@@ -48,7 +48,7 @@ const RowGroupingSection = (props) => {
48
48
  props.onChange(Object.assign(Object.assign({}, layout), { RowGroupedColumns: columnIds }));
49
49
  };
50
50
  return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' } },
51
- React.createElement(Tabs_1.Tabs.Tab, null, "Grouped Rows"),
51
+ React.createElement(Tabs_1.Tabs.Tab, null, "Group Rows"),
52
52
  ((_a = layout.ExpandedRowGroupValues) === null || _a === void 0 ? void 0 : _a.length) && React.createElement(Tabs_1.Tabs.Tab, null, "Expanded Rows"),
53
53
  React.createElement(Tabs_1.Tabs.Content, null,
54
54
  React.createElement(ValueSelector_1.ValueSelector, { showFilterInput: true, showSelectedOnlyPosition: "top", filter: Utilities_1.columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => { var _a; return (_a = option.friendlyName) !== null && _a !== void 0 ? _a : option.columnId; }, options: sortedGroupableColumns, value: (_b = layout.RowGroupedColumns) !== null && _b !== void 0 ? _b : [], allowReorder: true, xSelectedLabel: () => {
@@ -67,7 +67,7 @@ class SmartEditPopupComponent extends React.Component {
67
67
  (this.props.PreviewInfo &&
68
68
  this.props.PreviewInfo.previewValidationSummary.validationResult == 'All'), onClick: () => {
69
69
  this.submit();
70
- }, marginRight: 2 }, "Apply to Grid"),
70
+ }, marginRight: 2 }, "Apply Smart Edit"),
71
71
  ' ',
72
72
  this.props.PreviewInfo &&
73
73
  this.props.PreviewInfo.previewValidationSummary.validationResult != 'None' && (React.createElement(AdaptablePopover_1.AdaptablePopover, { headerText: 'Validation Error', bodyText: [globalValidationMessage], MessageType: 'Error' }))),
@@ -11,7 +11,6 @@ const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlo
11
11
  const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
12
12
  const Tabs_1 = require("../../../components/Tabs");
13
13
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
14
- const AdaptablePopover_1 = require("../../AdaptablePopover");
15
14
  const AdaptableIconSelector_1 = require("../../Components/AdaptableIconSelector");
16
15
  const PredicateEditor_1 = require("../../Components/PredicateEditor/PredicateEditor");
17
16
  const StyleComponent_1 = require("../../Components/StyleComponent");
@@ -20,6 +19,7 @@ const StyledColumnBadgePreview_1 = require("./StyledColumnWizardStyleSection/Com
20
19
  const Badge_1 = require("../../Components/Badge");
21
20
  const AdaptableIconComponent_1 = require("../../Components/AdaptableIconComponent");
22
21
  const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstants");
22
+ const Accordion_1 = require("../../../components/Accordion");
23
23
  const BadgeEditor = (props) => {
24
24
  var _a, _b;
25
25
  const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
@@ -40,12 +40,10 @@ const BadgeEditor = (props) => {
40
40
  React.createElement(FormLayout_1.FormRow, { label: "Style" },
41
41
  React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 1, mt: 2 }, "Select the Style for the Badge"),
42
42
  ' ',
43
- React.createElement(AdaptablePopover_1.AdaptablePopover, { showEvent: "mouseenter", hideEvent: "mouseleave", showIcon: false, useButton: false, popoverMaxWidth: 700, bodyText: [
44
- React.createElement(StyleComponent_1.StyleComponent, { showFontSizeAs: "radio", headless: true, hidePreview: true, api: api, Style: (_a = badge.Style) !== null && _a !== void 0 ? _a : {}, UpdateStyle: (Style) => {
45
- onChange(Object.assign(Object.assign({}, badge), { Style }));
46
- } }),
47
- ] },
48
- React.createElement(SimpleButton_1.default, { variant: "raised" }, "Edit Badge Style"))),
43
+ React.createElement(Accordion_1.Accordion, { title: "Edit Badge Style" },
44
+ React.createElement(StyleComponent_1.StyleComponent, { showFontSizeAs: "radio", headless: true, hidePreview: true, api: api, Style: (_a = badge.Style) !== null && _a !== void 0 ? _a : {}, UpdateStyle: (Style) => {
45
+ onChange(Object.assign(Object.assign({}, badge), { Style }));
46
+ } }))),
49
47
  !api.columnApi.hasArrayDataType(columnId) && ( // dont show predicates for arrays
50
48
  (React.createElement(
51
49
  FormLayout_1.FormRow,
@@ -18,8 +18,8 @@ const renderStyledColumnWizardSettingsSummary = (data) => {
18
18
  React.createElement(Tag_1.Tag, null, ((_a = badgeStyle.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeDataRows) ? 'no' : 'yes')),
19
19
  ' ',
20
20
  React.createElement(rebass_1.Text, { mt: 3 },
21
- "Grouped Rows ",
22
- React.createElement(Tag_1.Tag, null, ((_b = badgeStyle.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows) ? 'no' : 'yes')),
21
+ "Group Rows ",
22
+ React.createElement(Tag_1.Tag, null, ((_b = badgeStyle.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupRows) ? 'no' : 'yes')),
23
23
  React.createElement(rebass_1.Text, { mt: 3 },
24
24
  "Summary Rows ",
25
25
  React.createElement(Tag_1.Tag, null, ((_c = badgeStyle.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows) ? 'no' : 'yes'))));
@@ -32,7 +32,7 @@ const StyledColumnWizardSettingsSection = (props) => {
32
32
  props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { RowScope: Object.assign(Object.assign({}, data.BadgeStyle.RowScope), { ExcludeDataRows }) }) }));
33
33
  };
34
34
  const onExcludeGroupedRowsChanged = (ExcludeGroupedRows) => {
35
- props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { RowScope: Object.assign(Object.assign({}, data.BadgeStyle.RowScope), { ExcludeGroupedRows }) }) }));
35
+ props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { RowScope: Object.assign(Object.assign({}, data.BadgeStyle.RowScope), { ExcludeGroupRows: ExcludeGroupedRows }) }) }));
36
36
  };
37
37
  const onExcludeSummaryRowsChanged = (ExcludeSummaryRows) => {
38
38
  props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { RowScope: Object.assign(Object.assign({}, data.BadgeStyle.RowScope), { ExcludeSummaryRows }) }) }));
@@ -47,11 +47,11 @@ const StyledColumnWizardSettingsSection = (props) => {
47
47
  React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-data-rows-checkbox", checked:
48
48
  // @ts-ignore
49
49
  (_a = data.BadgeStyle.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeDataRows, onChange: onExcludeDataRowsChanged, mr: 2 }))),
50
- React.createElement(FormLayout_1.FormRow, { label: "Exclude Grouped Rows:" },
50
+ React.createElement(FormLayout_1.FormRow, { label: "Exclude Group Rows:" },
51
51
  React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
52
52
  React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-grouped-rows-checkbox", checked:
53
53
  // @ts-ignore
54
- (_b = data.BadgeStyle.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
54
+ (_b = data.BadgeStyle.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
55
55
  React.createElement(FormLayout_1.FormRow, { label: "Exclude Row Summaries:" },
56
56
  React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
57
57
  React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked:
@@ -47,7 +47,7 @@ const ReactActionColumnRenderer = (props) => {
47
47
  const isSummaryRow = adaptable.api.gridApi.isSummaryNode(props.node);
48
48
  let shouldRender = true;
49
49
  if (isGroupedRow) {
50
- if ((_a = actionColumn.rowScope) === null || _a === void 0 ? void 0 : _a.ExcludeGroupedRows) {
50
+ if ((_a = actionColumn.rowScope) === null || _a === void 0 ? void 0 : _a.ExcludeGroupRows) {
51
51
  shouldRender = false;
52
52
  }
53
53
  }
@@ -94,7 +94,7 @@ class ActionColumnRenderer {
94
94
  const isSummaryRow = adaptable.api.gridApi.isSummaryNode(params.node);
95
95
  let shouldRender = true;
96
96
  if (isGroupedRow) {
97
- if ((_a = actionColumn.rowScope) === null || _a === void 0 ? void 0 : _a.ExcludeGroupedRows) {
97
+ if ((_a = actionColumn.rowScope) === null || _a === void 0 ? void 0 : _a.ExcludeGroupRows) {
98
98
  shouldRender = false;
99
99
  }
100
100
  }
@@ -580,8 +580,8 @@ class AgGridColumnAdapter {
580
580
  PrimaryKeyValue: gridCell.primaryKeyValue,
581
581
  ColumnId: gridCell.column.columnId,
582
582
  };
583
- const cellNotes = this.adaptableApi.noteApi.getNotesForCell(cellPosition);
584
- if (!(cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length)) {
583
+ const cellNote = this.adaptableApi.noteApi.getNoteForCell(cellPosition);
584
+ if (!cellNote) {
585
585
  return undefined;
586
586
  }
587
587
  return 'ab-Cell-Note';
@@ -10,6 +10,7 @@ export declare class AgGridMenuAdapter {
10
10
  destroy(): void;
11
11
  buildColumnMenu(params: GetMainMenuItemsParams, originalGetMainMenuItems: GetMainMenuItems): (string | MenuItemDef)[];
12
12
  buildContextMenu(params: GetContextMenuItemsParams, originalGetContextMenuItems: GetContextMenuItems): (string | MenuItemDef)[];
13
+ private mapAgGridItemTypeToAgGridMenuItem;
13
14
  private removeConsecutiveSeparators;
14
15
  private createColumnMenuContextObject;
15
16
  private createAdaptableContextMenuItems;
@@ -28,18 +28,19 @@ class AgGridMenuAdapter {
28
28
  }
29
29
  const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
30
30
  const menuContext = this.createColumnMenuContextObject(adaptableColumn, params.column);
31
+ /**
32
+ * AG Grid items
33
+ */
34
+ const agGridDefaultStructure = agGridMenuItems.map((itemName) => this.mapAgGridItemTypeToAgGridMenuItem(itemName));
31
35
  const adaptableMenuItems = this.createAdaptableColumnMenuItems(menuContext);
32
36
  const defaultColumnMenuStructure = this.buildColumnMenuDefaultStructure(adaptableMenuItems, menuContext);
33
37
  // 1. first check if there is a custom column menu defined
34
38
  if (typeof menuOptions.customColumnMenu === 'function') {
35
- const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => ({
36
- menuType: 'AgGrid',
37
- name: itemName,
38
- }));
39
+ const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => this.mapAgGridItemTypeToAgGridMenuItem(itemName));
39
40
  const defaultAdaptableMenuItems = adaptableMenuItems.map((adaptableItem) => (Object.assign({ menuType: 'Adaptable' }, adaptableItem)));
40
41
  const customMenuItems = menuOptions
41
42
  .customColumnMenu(Object.assign(Object.assign({}, menuContext), { defaultAgGridMenuItems,
42
- defaultAdaptableMenuItems, defaultAdaptableMenuStructure: this.mapAdaptableMenuItemToSystemMenuItems(defaultColumnMenuStructure) }))
43
+ defaultAdaptableMenuItems, defaultAdaptableMenuStructure: this.mapAdaptableMenuItemToSystemMenuItems(defaultColumnMenuStructure), defaultAgGridMenuStructure: agGridDefaultStructure }))
43
44
  .filter(Boolean);
44
45
  return customMenuItems
45
46
  .map((customMenuItem) => this.mapCustomMenuItemToAgGridMenuDefinition(customMenuItem, menuContext))
@@ -55,56 +56,70 @@ class AgGridMenuAdapter {
55
56
  }
56
57
  buildContextMenu(params, originalGetContextMenuItems) {
57
58
  var _a;
59
+ if (!params.column) {
60
+ return [];
61
+ }
58
62
  // we do this in order to refresh the internal state of selected cells (technically query the AG Grid cellRanges)
59
63
  // (right-click selected the current cell, but this was not reflected in the internal state of the selected cells)
60
64
  this.adaptableInstance.refreshSelectedCellsState();
61
65
  const menuOptions = this.adaptableOptions.menuOptions;
62
- const agGridMenuItems = (params.defaultItems ? [...params.defaultItems] : []);
63
- if (!params.column) {
64
- return [];
65
- }
66
66
  const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
67
67
  const menuContext = this.createContextMenuContextObject(params, adaptableColumn);
68
+ /**
69
+ * AG Grid Items
70
+ */
71
+ const agGridMenuItems = (params.defaultItems ? [...params.defaultItems] : []);
72
+ const agGridCopyItems = agGridMenuItems.filter((item) => ['copy', 'copyWithHeaders', 'copyWithGroupHeaders', 'cut', 'paste'].includes(item));
73
+ const otherAgGridItems = agGridMenuItems.filter((item) => !agGridCopyItems.includes(item) &&
74
+ // we provide Adaptable exports in the context menu
75
+ !['export', 'csvExport', 'excelExport'].includes(item));
76
+ const agGridDefaultStructure = [
77
+ {
78
+ menuType: 'Group',
79
+ label: 'Copy & Paste',
80
+ icon: {
81
+ name: 'copy',
82
+ },
83
+ subMenuItems: agGridCopyItems.map((item) => this.mapAgGridItemTypeToAgGridMenuItem(item)),
84
+ },
85
+ ...otherAgGridItems
86
+ .filter((itemName) => itemName !== 'separator')
87
+ .map((itemName) => this.mapAgGridItemTypeToAgGridMenuItem(itemName)),
88
+ ];
89
+ /**
90
+ * Adaptable Items
91
+ */
68
92
  const adaptableMenuItems = this.createAdaptableContextMenuItems(menuContext);
69
- const defaultContextMenuStructure = this.buildContextMenuDefaultStructure(adaptableMenuItems, menuContext);
93
+ const adaptableDefaultStructure = this.buildContextMenuDefaultStructure(adaptableMenuItems, menuContext);
94
+ /**
95
+ * Build the context menu
96
+ */
70
97
  // 1. first check if there is a custom context menu defined
71
98
  if (typeof menuOptions.customContextMenu === 'function') {
72
- const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => ({
73
- menuType: 'AgGrid',
74
- name: itemName,
75
- }));
99
+ const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => this.mapAgGridItemTypeToAgGridMenuItem(itemName));
76
100
  const defaultAdaptableMenuItems = adaptableMenuItems.map((adaptableItem) => (Object.assign({ menuType: 'Adaptable' }, adaptableItem)));
77
101
  const customMenuItems = menuOptions
78
102
  .customContextMenu(Object.assign(Object.assign({}, menuContext), { defaultAgGridMenuItems,
79
- defaultAdaptableMenuItems, defaultAdaptableMenuStructure: this.mapAdaptableMenuItemToSystemMenuItems(defaultContextMenuStructure) }))
103
+ defaultAdaptableMenuItems, defaultAdaptableMenuStructure: this.mapAdaptableMenuItemToSystemMenuItems(adaptableDefaultStructure), defaultAgGridMenuStructure: agGridDefaultStructure }))
80
104
  .filter(Boolean);
81
105
  return customMenuItems
82
106
  .map((customMenuItem) => this.mapCustomMenuItemToAgGridMenuDefinition(customMenuItem, menuContext))
83
107
  .filter(Boolean);
84
108
  }
85
109
  // 2. if not, return the default context menu
86
- const agGridCopyItems = agGridMenuItems.filter((item) => ['copy', 'copyWithHeaders', 'copyWithGroupHeaders', 'cut', 'paste'].includes(item));
87
- const otherAgGridItems = agGridMenuItems.filter((item) => !agGridCopyItems.includes(item) &&
88
- // we provide Adaptable exports in the context menu
89
- !['export', 'csvExport', 'excelExport'].includes(item));
90
110
  const defaultContextMenu = [
91
- this.mapCustomMenuItemToAgGridMenuDefinition({
92
- menuType: 'Group',
93
- label: 'Copy & Paste',
94
- icon: {
95
- name: 'copy',
96
- },
97
- subMenuItems: agGridCopyItems.map((item) => ({
98
- menuType: 'AgGrid',
99
- name: item,
100
- })),
101
- }, menuContext),
102
- ...otherAgGridItems,
111
+ ...agGridDefaultStructure.map((agGridItem) => this.mapCustomMenuItemToAgGridMenuDefinition(agGridItem, menuContext)),
103
112
  'separator',
104
- ...defaultContextMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
113
+ ...adaptableDefaultStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
105
114
  ];
106
115
  return this.removeConsecutiveSeparators(defaultContextMenu);
107
116
  }
117
+ mapAgGridItemTypeToAgGridMenuItem(itemName) {
118
+ return {
119
+ menuType: 'AgGrid',
120
+ name: itemName,
121
+ };
122
+ }
108
123
  // due to entitlements or other reasons, some menu items might be hidden, leading to consecutive separators
109
124
  removeConsecutiveSeparators(menuItems, separator = 'separator') {
110
125
  return menuItems.reduce((acc, item, index, array) => {
@@ -237,7 +252,7 @@ class AgGridMenuAdapter {
237
252
  // Comment
238
253
  const commentMenuItems = this.getModuleSpecificStructure('Comment', availableMenuItems);
239
254
  // Dashboard
240
- const dashboardMenuItems = this.getModuleSpecificStructure('Dashboard', availableMenuItems);
255
+ const dashboardMenuItems = this.getModuleSpecificStructure('Dashboard', availableMenuItems, 'dashboard-group');
241
256
  // DataImport
242
257
  const dataImportMenuItems = this.getModuleSpecificStructure('DataImport', availableMenuItems);
243
258
  // Export
@@ -264,8 +279,7 @@ class AgGridMenuAdapter {
264
279
  const gridMenuItem = {
265
280
  name: 'grid-group',
266
281
  label: 'Grid',
267
- // TODO
268
- module: 'ColumnInfo',
282
+ module: 'Group',
269
283
  isVisible: true,
270
284
  icon: {
271
285
  name: 'grid',
@@ -282,8 +296,7 @@ class AgGridMenuAdapter {
282
296
  const editMenuItem = {
283
297
  name: 'edit-group',
284
298
  label: 'Edit',
285
- // TODO
286
- module: 'ColumnInfo',
299
+ module: 'Group',
287
300
  isVisible: true,
288
301
  icon: {
289
302
  name: 'edit-table',
@@ -293,8 +306,7 @@ class AgGridMenuAdapter {
293
306
  const columnMenuItem = {
294
307
  name: 'column-group',
295
308
  label: 'Column',
296
- // TODO
297
- module: 'ColumnInfo',
309
+ module: 'Group',
298
310
  isVisible: true,
299
311
  icon: {
300
312
  name: 'columns',
@@ -336,11 +348,11 @@ class AgGridMenuAdapter {
336
348
  /**
337
349
  * Default strategy for menu items: return as is if there is only one item, otherwise group them under a parent item
338
350
  */
339
- getModuleSpecificStructure(module, menuItems) {
351
+ getModuleSpecificStructure(module, menuItems, groupName) {
340
352
  const moduleItems = menuItems.filter((menuItem) => menuItem.module === module);
341
353
  if (moduleItems.length > 1) {
342
354
  const moduleInfo = this.adaptableInstance.ModuleService.getModuleInfoByModule(module);
343
- return [this.buildMenuGroupParent(module, moduleItems)];
355
+ return [this.buildMenuGroupParent(module, moduleItems, { groupName })];
344
356
  }
345
357
  else {
346
358
  return moduleItems;
@@ -356,25 +368,25 @@ class AgGridMenuAdapter {
356
368
  ? [
357
369
  this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-visual-data-excel')), {
358
370
  label: 'Visual Data',
359
- icon: false,
371
+ icon: 'export-data',
360
372
  }),
361
373
  ]
362
374
  : [];
363
375
  const allDataExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-all-data')), {
364
376
  label: 'All Data',
365
- icon: false,
377
+ icon: 'export-data',
366
378
  }));
367
379
  const currentDataExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-current-data')), {
368
380
  label: 'Current Data',
369
- icon: false,
381
+ icon: 'export-data',
370
382
  }));
371
383
  const selectedCellsExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-selected-cells')), {
372
384
  label: 'Selected Cells',
373
- icon: false,
385
+ icon: 'export-data',
374
386
  }));
375
387
  const selectedRowsExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-selected-rows')), {
376
388
  label: 'Selected Rows',
377
- icon: false,
389
+ icon: 'export-data',
378
390
  }));
379
391
  return this.normalizeMenuGroup(this.buildMenuGroupParent('Export', [
380
392
  ...visualDataExportItems,
@@ -385,6 +397,7 @@ class AgGridMenuAdapter {
385
397
  ], {
386
398
  label: 'Export',
387
399
  icon: 'export',
400
+ groupName: 'export-group',
388
401
  }));
389
402
  }
390
403
  getLayoutContextMenuStructure(menuItems) {
@@ -402,14 +415,14 @@ class AgGridMenuAdapter {
402
415
  return [gridActionsItems, otherLayoutItems];
403
416
  }
404
417
  buildMenuGroupParent(module, menuItems, config) {
405
- var _a, _b;
418
+ var _a, _b, _c;
406
419
  const moduleInfo = this.adaptableInstance.ModuleService.getModuleInfoByModule(module);
407
420
  const icon = config && config.icon === false
408
421
  ? undefined
409
422
  : { name: (_a = config === null || config === void 0 ? void 0 : config.icon) !== null && _a !== void 0 ? _a : moduleInfo.Glyph };
410
423
  return {
411
- name: 'menu-group',
412
- label: (_b = config === null || config === void 0 ? void 0 : config.label) !== null && _b !== void 0 ? _b : moduleInfo.FriendlyName,
424
+ name: (_b = config === null || config === void 0 ? void 0 : config.groupName) !== null && _b !== void 0 ? _b : 'menu-group',
425
+ label: (_c = config === null || config === void 0 ? void 0 : config.label) !== null && _c !== void 0 ? _c : moduleInfo.FriendlyName,
413
426
  isVisible: true,
414
427
  module: moduleInfo.ModuleName,
415
428
  icon,
@@ -428,7 +441,7 @@ class AgGridMenuAdapter {
428
441
  // CustomSort
429
442
  const customSortMenuItems = this.getModuleSpecificStructure('CustomSort', availableMenuItems);
430
443
  // Dashboard
431
- const dashboardMenuItems = this.getModuleSpecificStructure('Dashboard', availableMenuItems);
444
+ const dashboardMenuItems = this.getModuleSpecificStructure('Dashboard', availableMenuItems, 'dashboard-group');
432
445
  // DataImport
433
446
  const dataImportMenuItems = this.getModuleSpecificStructure('DataImport', availableMenuItems);
434
447
  // FlashingCell
@@ -455,8 +468,7 @@ class AgGridMenuAdapter {
455
468
  const gridMenuItem = {
456
469
  name: 'grid-group',
457
470
  label: 'Grid',
458
- // TODO
459
- module: 'ColumnInfo',
471
+ module: 'Group',
460
472
  isVisible: true,
461
473
  icon: {
462
474
  name: 'grid',
@@ -474,8 +486,7 @@ class AgGridMenuAdapter {
474
486
  const columnMenuItem = {
475
487
  name: 'column-group',
476
488
  label: 'Column',
477
- // TODO
478
- module: 'ColumnInfo',
489
+ module: 'Group',
479
490
  isVisible: true,
480
491
  icon: {
481
492
  name: 'columns',
@@ -493,8 +504,7 @@ class AgGridMenuAdapter {
493
504
  const createStyleMenuItem = {
494
505
  name: 'styling-group',
495
506
  label: 'Styling',
496
- // TODO
497
- module: 'ColumnInfo',
507
+ module: 'Group',
498
508
  isVisible: true,
499
509
  icon: {
500
510
  name: 'brush',
@@ -553,26 +563,27 @@ class AgGridMenuAdapter {
553
563
  return styledColumnMenuItems;
554
564
  }
555
565
  mapAdaptableMenuItemToSystemMenuItems(adaptableMenuItems) {
556
- return (adaptableMenuItems !== null && adaptableMenuItems !== void 0 ? adaptableMenuItems : []).map((menuItem) => {
566
+ if (!adaptableMenuItems) {
567
+ return;
568
+ }
569
+ return adaptableMenuItems.map((menuItem) => {
557
570
  if (menuItem === '-') {
558
571
  return menuItem;
559
572
  }
560
- let subItems = menuItem.subItems;
561
- if (subItems && subItems.length > 0) {
562
- subItems = subItems.map((subItem) => this.mapAdaptableMenuItemToSystemMenuItems(subItem.subItems));
563
- }
573
+ // @ts-ignore
574
+ const subItems = this.mapAdaptableMenuItemToSystemMenuItems(menuItem.subItems);
564
575
  return Object.assign(Object.assign({}, menuItem), { menuType: 'Adaptable', subItems });
565
576
  });
566
577
  }
567
578
  createAdaptableColumnMenuItems(menuContext) {
568
- let contextMenuItems = [];
579
+ let columnMenuItems = [];
569
580
  this.adaptableInstance.adaptableModules.forEach((s) => {
570
581
  let menuItems = s.createColumnMenuItems(menuContext.adaptableColumn);
571
582
  if (menuItems) {
572
- contextMenuItems.push(...menuItems.filter(Boolean).filter((item) => item.isVisible !== false));
583
+ columnMenuItems.push(...menuItems.filter(Boolean).filter((item) => item.isVisible !== false));
573
584
  }
574
585
  });
575
- return contextMenuItems;
586
+ return columnMenuItems;
576
587
  }
577
588
  // TODO AFL MIG: pretty sure this logic is duplicated in several other places
578
589
  mapAdaptableIconToAgGridIcon(adaptableIcon, style) {