@adaptabletools/adaptable 12.0.0 → 12.0.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 (161) hide show
  1. package/base.css +6 -19
  2. package/bundle.cjs.js +129 -129
  3. package/index.css +7 -23
  4. package/package.json +1 -1
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -2
  8. package/src/AdaptableOptions/ActionOptions.d.ts +1 -1
  9. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +1 -1
  10. package/src/AdaptableOptions/StateOptions.d.ts +9 -23
  11. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +34 -1
  12. package/src/Api/ChartingApi.d.ts +19 -2
  13. package/src/Api/FilterApi.d.ts +7 -2
  14. package/src/Api/FormatColumnApi.d.ts +6 -6
  15. package/src/Api/GridApi.d.ts +1 -1
  16. package/src/Api/Implementation/ChartingApiImpl.d.ts +6 -0
  17. package/src/Api/Implementation/ChartingApiImpl.js +17 -0
  18. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -0
  19. package/src/Api/Implementation/ConfigApiImpl.js +11 -0
  20. package/src/Api/Implementation/FilterApiImpl.d.ts +1 -0
  21. package/src/Api/Implementation/FilterApiImpl.js +5 -0
  22. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +3 -3
  23. package/src/Api/Implementation/FormatColumnApiImpl.js +13 -11
  24. package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
  25. package/src/Api/Implementation/GridApiImpl.js +2 -2
  26. package/src/Api/Implementation/InternalApiImpl.d.ts +4 -1
  27. package/src/Api/Implementation/InternalApiImpl.js +16 -3
  28. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +1 -0
  29. package/src/Api/Implementation/TeamSharingApiImpl.js +5 -0
  30. package/src/Api/InternalApi.d.ts +4 -1
  31. package/src/Api/TeamSharingApi.d.ts +4 -0
  32. package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
  33. package/src/PredefinedConfig/CalculatedColumnState.d.ts +0 -5
  34. package/src/PredefinedConfig/ChartingState.d.ts +20 -0
  35. package/src/PredefinedConfig/ChartingState.js +2 -0
  36. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +27 -6
  37. package/src/PredefinedConfig/Common/AdaptablePredicate.js +2 -2
  38. package/src/PredefinedConfig/Common/Types.d.ts +1 -1
  39. package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
  40. package/src/PredefinedConfig/Selection/GridCellRange.d.ts +19 -0
  41. package/src/PredefinedConfig/StatusBarState.d.ts +1 -1
  42. package/src/Redux/ActionsReducers/ChartingRedux.d.ts +23 -0
  43. package/src/Redux/ActionsReducers/ChartingRedux.js +38 -0
  44. package/src/Redux/ActionsReducers/LayoutRedux.js +3 -0
  45. package/src/Redux/Store/AdaptableStore.js +2 -0
  46. package/src/Strategy/AdaptableModuleBase.d.ts +10 -5
  47. package/src/Strategy/AdaptableModuleBase.js +6 -0
  48. package/src/Strategy/AlertModule.d.ts +2 -8
  49. package/src/Strategy/AlertModule.js +6 -3
  50. package/src/Strategy/ChartingModule.js +1 -1
  51. package/src/Strategy/DashboardModule.js +1 -0
  52. package/src/Strategy/ExportModule.js +1 -0
  53. package/src/Strategy/FlashingCellModule.js +3 -3
  54. package/src/Strategy/FormatColumnModule.js +3 -3
  55. package/src/Strategy/GridInfoModule.js +2 -0
  56. package/src/Strategy/Interface/IModule.d.ts +16 -4
  57. package/src/Strategy/LayoutModule.js +2 -0
  58. package/src/Strategy/TeamSharingModule.d.ts +11 -1
  59. package/src/Strategy/TeamSharingModule.js +104 -0
  60. package/src/Utilities/Helpers/FormatHelper.d.ts +1 -1
  61. package/src/Utilities/Helpers/FormatHelper.js +6 -2
  62. package/src/Utilities/MenuItem.d.ts +4 -4
  63. package/src/Utilities/ObjectFactory.d.ts +5 -1
  64. package/src/Utilities/ObjectFactory.js +11 -1
  65. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -1
  66. package/src/Utilities/Services/ReportService.d.ts +1 -1
  67. package/src/Utilities/Services/ReportService.js +5 -5
  68. package/src/Utilities/Services/TeamSharingService.js +0 -2
  69. package/src/View/AdaptableViewFactory.js +0 -2
  70. package/src/View/Alert/ActiveAlertsPanelItemLabel.d.ts +5 -0
  71. package/src/View/Alert/ActiveAlertsPanelItemLabel.js +22 -0
  72. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +4 -11
  73. package/src/View/ColorPicker.d.ts +1 -1
  74. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  75. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +8 -4
  76. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.d.ts +13 -1
  77. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +23 -15
  78. package/src/View/Components/Buttons/ButtonDelete.js +3 -3
  79. package/src/View/Components/Buttons/ButtonPause.js +11 -1
  80. package/src/View/Components/FilterForm/QuickFilterForm.js +23 -2
  81. package/src/View/Components/Panels/PanelWithButton.d.ts +2 -1
  82. package/src/View/Components/Panels/PanelWithImage.d.ts +3 -2
  83. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +4 -0
  84. package/src/View/Components/Popups/AdaptablePopupTeamSharing.js +1 -1
  85. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -11
  86. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -11
  87. package/src/View/Dashboard/CustomDashboardButton.js +2 -15
  88. package/src/View/Dashboard/CustomToolbarWrapper.js +2 -11
  89. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +13 -9
  90. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +6 -0
  91. package/src/View/GridInfo/GridInfoPopup.js +1 -1
  92. package/src/View/Layout/LayoutEditorStandalonePopup.js +3 -1
  93. package/src/View/Layout/LayoutPopup.d.ts +1 -1
  94. package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
  95. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +2 -27
  96. package/src/View/TeamSharing/SharedEntityDependencies.d.ts +8 -0
  97. package/src/View/TeamSharing/SharedEntityDependencies.js +27 -0
  98. package/src/View/TeamSharing/SharedEntityObjectView.d.ts +9 -0
  99. package/src/View/TeamSharing/SharedEntityObjectView.js +84 -0
  100. package/src/View/TeamSharing/TeamSharingApplyButton.d.ts +6 -0
  101. package/src/View/TeamSharing/TeamSharingApplyButton.js +15 -0
  102. package/src/View/UIHelper.d.ts +2 -2
  103. package/src/agGrid/ActionColumnRenderer.js +5 -11
  104. package/src/agGrid/Adaptable.d.ts +5 -27
  105. package/src/agGrid/Adaptable.js +87 -72
  106. package/src/agGrid/agGridMenuHelper.d.ts +1 -0
  107. package/src/agGrid/agGridMenuHelper.js +15 -4
  108. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +6 -12
  109. package/src/components/AdaptableIconComponent/index.d.ts +2 -1
  110. package/src/components/AdaptableIconComponent/index.js +36 -3
  111. package/src/components/Datepicker/index.d.ts +1 -1
  112. package/src/components/Input/index.d.ts +1 -1
  113. package/src/components/List/ListGroupItem/index.d.ts +1 -1
  114. package/src/components/PopupWithFooter.d.ts +1 -1
  115. package/src/components/SimpleButton/index.js +1 -1
  116. package/src/components/Textarea/index.d.ts +1 -1
  117. package/src/components/icons/{color-drop.d.ts → ends-with.d.ts} +0 -0
  118. package/src/components/icons/{format-letter-ends-with.js → ends-with.js} +0 -0
  119. package/src/components/icons/{filter-outline.d.ts → filter.d.ts} +0 -0
  120. package/src/components/icons/{filter-outline.js → filter.js} +0 -0
  121. package/src/components/icons/index.d.ts +5 -7
  122. package/src/components/icons/index.js +7 -21
  123. package/src/components/icons/{format-letter-ends-with.d.ts → starts-with.d.ts} +0 -0
  124. package/src/components/icons/{format-letter-starts-with.js → starts-with.js} +0 -0
  125. package/src/metamodel/adaptable.metamodel.d.ts +150 -1
  126. package/src/metamodel/adaptable.metamodel.js +1 -1
  127. package/src/types.d.ts +4 -2
  128. package/version.d.ts +1 -1
  129. package/version.js +1 -1
  130. package/src/View/Alert/AlertSharedEntity.d.ts +0 -5
  131. package/src/View/Alert/AlertSharedEntity.js +0 -19
  132. package/src/View/CalculatedColumn/CalculatedColumnSharedEntity.d.ts +0 -5
  133. package/src/View/CalculatedColumn/CalculatedColumnSharedEntity.js +0 -20
  134. package/src/View/ConditionalStyle/ConditionalStyleSharedEntity.d.ts +0 -5
  135. package/src/View/ConditionalStyle/ConditionalStyleSharedEntity.js +0 -23
  136. package/src/View/CustomSort/CustomSortSharedEntity.d.ts +0 -6
  137. package/src/View/CustomSort/CustomSortSharedEntity.js +0 -24
  138. package/src/View/Export/ExportSharedEntity.d.ts +0 -5
  139. package/src/View/Export/ExportSharedEntity.js +0 -16
  140. package/src/View/Filter/FilterSharedEntity.d.ts +0 -5
  141. package/src/View/Filter/FilterSharedEntity.js +0 -15
  142. package/src/View/FormatColumn/FormatColumnSharedEntity.d.ts +0 -5
  143. package/src/View/FormatColumn/FormatColumnSharedEntity.js +0 -18
  144. package/src/View/FreeTextColumn/FreeTextColumnSharedEntity.d.ts +0 -5
  145. package/src/View/FreeTextColumn/FreeTextColumnSharedEntity.js +0 -24
  146. package/src/View/Layout/LayoutSharedEntity.d.ts +0 -5
  147. package/src/View/Layout/LayoutSharedEntity.js +0 -15
  148. package/src/View/PlusMinus/PlusMinusSharedEntity.d.ts +0 -5
  149. package/src/View/PlusMinus/PlusMinusSharedEntity.js +0 -21
  150. package/src/View/Query/NamedQuerySharedEntity.d.ts +0 -5
  151. package/src/View/Query/NamedQuerySharedEntity.js +0 -19
  152. package/src/View/Shortcut/ShortcutSharedEntity.d.ts +0 -5
  153. package/src/View/Shortcut/ShortcutSharedEntity.js +0 -19
  154. package/src/View/TeamSharing/TeamSharingPopup.d.ts +0 -23
  155. package/src/View/TeamSharing/TeamSharingPopup.js +0 -163
  156. package/src/agGrid/rowEditIcons.d.ts +0 -5
  157. package/src/agGrid/rowEditIcons.js +0 -10
  158. package/src/components/icons/color-drop.js +0 -7
  159. package/src/components/icons/format-letter-starts-with.d.ts +0 -3
  160. package/src/components/icons/pause-red.d.ts +0 -3
  161. package/src/components/icons/pause-red.js +0 -7
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSharedEntityStaleDepsItemView = exports.getSharedEntityActiveStatusObjectView = exports.SharedEntityTypeItemView = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const rebass_1 = require("rebass");
7
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
8
+ const Tag_1 = require("../../components/Tag");
9
+ const AdaptableContext_1 = require("../AdaptableContext");
10
+ const AdaptableObjectList_1 = require("../Components/AdaptableObjectList/AdaptableObjectList");
11
+ const SharedEntityTypeItemView = (props) => {
12
+ const [isExpanded, setIsExpanded] = React.useState(false);
13
+ const adaptable = AdaptableContext_1.useAdaptable();
14
+ const moduleName = props.data.Module;
15
+ const module = adaptable.ModuleService.getModuleById(moduleName);
16
+ const sharedObject = props.data.Entity;
17
+ const item = module.toView(sharedObject);
18
+ return (React.createElement(React.Fragment, null,
19
+ React.createElement(rebass_1.Flex, { mb: 2, mt: 2 },
20
+ React.createElement(rebass_1.Flex, { mr: 2, alignItems: "center" },
21
+ React.createElement(Tag_1.Tag, { style: { margin: 0 } }, props.data.Module)),
22
+ isExpanded ? (React.createElement(SimpleButton_1.default, { onClick: () => setIsExpanded(false), icon: "arrow-up" }, "Collapse")) : (React.createElement(SimpleButton_1.default, { onClick: () => setIsExpanded(true), icon: "arrow-down" }, "Expand"))),
23
+ isExpanded && (React.createElement(rebass_1.Box, { as: "ul", padding: 0, className: "ab-Shared-Entity-Shared-Object" },
24
+ React.createElement(AdaptableObjectList_1.AdaptableObjectListItem, { hideControls: true, data: item, module: module })))));
25
+ };
26
+ exports.SharedEntityTypeItemView = SharedEntityTypeItemView;
27
+ const getSharedEntityActiveStatusObjectView = (isDependency) => (props) => {
28
+ var _a, _b;
29
+ const adaptable = AdaptableContext_1.useAdaptable();
30
+ const activeEntries = adaptable.api.internalApi.getState().TeamSharing.ActiveSharedEntityMap;
31
+ const sharedEntity = props.data;
32
+ const isAdaptableObjectPresentInLocalState = !!adaptable.api.internalApi
33
+ .getModuleService()
34
+ .getModuleById(sharedEntity.Module)
35
+ .getModuleAdaptableObjects()
36
+ .find((adaptableObject) => adaptableObject.Uuid === sharedEntity.Entity.Uuid);
37
+ const isUpToDateAndActive = isAdaptableObjectPresentInLocalState &&
38
+ sharedEntity.Type === 'Active' &&
39
+ ((_a = activeEntries[sharedEntity.Entity.Uuid]) === null || _a === void 0 ? void 0 : _a.Revision) === sharedEntity.Revision;
40
+ const staleActiveEntities = adaptable.api.internalApi
41
+ .getTeamSharingService()
42
+ .getStaleActiveSharedEntities();
43
+ const isStaleAndActive = isAdaptableObjectPresentInLocalState && !!staleActiveEntities[sharedEntity.Uuid];
44
+ let activeInfo = null;
45
+ if (isAdaptableObjectPresentInLocalState) {
46
+ const activeRevision = (_b = activeEntries === null || activeEntries === void 0 ? void 0 : activeEntries[sharedEntity.Entity.Uuid]) === null || _b === void 0 ? void 0 : _b.Revision;
47
+ if (sharedEntity.Type === 'Active') {
48
+ const newRevision = sharedEntity.Revision;
49
+ let statusInfo = null;
50
+ if (isUpToDateAndActive) {
51
+ statusInfo = (React.createElement(rebass_1.Box, { ml: 1, style: { color: 'var(--ab-color-success)' } },
52
+ React.createElement("b", null, "up-to-date")));
53
+ }
54
+ if (isStaleAndActive) {
55
+ statusInfo = (React.createElement(rebass_1.Box, { ml: 1, style: { color: 'var(--ab-color-warn)' } }, ` (Rev. ${newRevision} available)`));
56
+ }
57
+ activeInfo = (React.createElement(React.Fragment, null,
58
+ `Imported Rev. ${activeRevision} ${isStaleAndActive ? 'is stale' : ''} `,
59
+ " ",
60
+ statusInfo));
61
+ }
62
+ else {
63
+ // snapshot
64
+ activeInfo = React.createElement(React.Fragment, null, `Imported Rev. ${activeRevision}`);
65
+ }
66
+ }
67
+ const sharedValue = `by ${sharedEntity.UserName} at ${new Date(sharedEntity.Timestamp).toLocaleString()}`;
68
+ return (React.createElement(React.Fragment, null,
69
+ !isDependency && React.createElement(Tag_1.Tag, null, sharedValue),
70
+ activeInfo && React.createElement(Tag_1.Tag, null, activeInfo)));
71
+ };
72
+ exports.getSharedEntityActiveStatusObjectView = getSharedEntityActiveStatusObjectView;
73
+ const getSharedEntityStaleDepsItemView = (staleDependencies) => () => {
74
+ let staleDepsString = 'Shared entity has';
75
+ if ((staleDependencies === null || staleDependencies === void 0 ? void 0 : staleDependencies.length) === 1) {
76
+ staleDepsString += ` one (${staleDependencies[0].Module}) stale dependency`;
77
+ }
78
+ else {
79
+ staleDepsString += ` ${staleDependencies.length} stale dependencies`;
80
+ }
81
+ return (React.createElement(Tag_1.Tag, null,
82
+ React.createElement(rebass_1.Box, { ml: 1, style: { color: 'var(--ab-color-warn)' } }, staleDepsString)));
83
+ };
84
+ exports.getSharedEntityStaleDepsItemView = getSharedEntityStaleDepsItemView;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import { AccessLevel, SharedEntity } from '../../../types';
3
+ export declare const TeamSharingApplyButton: React.FunctionComponent<{
4
+ data: SharedEntity;
5
+ accessLevel: AccessLevel;
6
+ }>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TeamSharingApplyButton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ const TeamSharingApplyButton = (props) => {
9
+ const adaptable = AdaptableContext_1.useAdaptable();
10
+ const handleImport = React.useCallback(() => {
11
+ adaptable.api.teamSharingApi.importSharedEntry(props.data);
12
+ }, []);
13
+ return (React.createElement(SimpleButton_1.default, { onClick: handleImport, variant: "text", tooltip: "Apply Adaptable Object", icon: "import-export" }));
14
+ };
15
+ exports.TeamSharingApplyButton = TeamSharingApplyButton;
@@ -3,7 +3,7 @@ import { EditableConfigEntityState } from './Components/SharedProps/EditableConf
3
3
  import { StatusColour } from '../PredefinedConfig/Common/Enums';
4
4
  import { AdaptableStyle } from '../PredefinedConfig/Common/AdaptableStyle';
5
5
  import { Schedule, Weekday } from '../PredefinedConfig/Common/Schedule';
6
- import { AdaptableColumnDataType, AdaptableOptions } from '../types';
6
+ import { AdaptableColumnDataType, AdaptableInternalIconName, AdaptableOptions } from '../types';
7
7
  import { AdaptableAlert } from '../PredefinedConfig/Common/AdaptableAlert';
8
8
  import { AdaptableMessageType } from '../PredefinedConfig/Common/AdaptableMessageType';
9
9
  export declare const BLACK: string;
@@ -36,7 +36,7 @@ export declare function IsEmptyStyle(style: AdaptableStyle): boolean;
36
36
  export declare function IsNotEmptyStyle(style: AdaptableStyle): boolean;
37
37
  export declare function getMessageTypeByStatusColour(statusColour: StatusColour): AdaptableMessageType;
38
38
  export declare function getButtonToneByMessageType(messageType: AdaptableMessageType): 'success' | 'error' | 'neutral' | 'none' | 'warning' | 'info' | 'accent';
39
- export declare function getGlyphByMessageType(messageType: AdaptableMessageType): string;
39
+ export declare function getGlyphByMessageType(messageType: AdaptableMessageType): AdaptableInternalIconName;
40
40
  export declare function getColorByMessageType(messageType: AdaptableMessageType): string;
41
41
  export declare function getStyleForStatusColour(statusColour: StatusColour): CSSProperties;
42
42
  export declare function getStyleForMessageType(messageType: AdaptableMessageType): CSSProperties;
@@ -45,14 +45,10 @@ class ActionColumnRenderer {
45
45
  if (button.hidden && button.hidden(button, context)) {
46
46
  return;
47
47
  }
48
- const defaultIconProps = {
49
- style: {
50
- height: 15,
51
- width: 15,
52
- },
53
- };
54
- const buttonIcon = adaptableApi.internalApi.getIconForButton(button, context);
55
- const iconProps = buttonIcon && Object.assign({}, defaultIconProps, buttonIcon);
48
+ const buttonIcon = adaptableApi.internalApi.getIconForButton(button, context, {
49
+ height: 15,
50
+ width: 15,
51
+ });
56
52
  const buttonStyle = adaptableApi.internalApi.getStyleForButton(button, context);
57
53
  const buttonLabel = adaptableApi.internalApi.getLabelForButton(button, context);
58
54
  const buttonTooltip = adaptableApi.internalApi.getTooltipForButton(button, context);
@@ -66,9 +62,7 @@ class ActionColumnRenderer {
66
62
  }, 16);
67
63
  };
68
64
  const disabled = button.disabled && button.disabled(button, context);
69
- return (React.createElement(SimpleButton_1.default, { key: button.Uuid, "data-name": `action-button-${index + 1}`, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' },
70
- buttonIcon ? React.createElement("img", Object.assign({}, iconProps)) : null,
71
- buttonLabel));
65
+ return (React.createElement(SimpleButton_1.default, { key: button.Uuid, "data-name": `action-button-${index + 1}`, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, icon: buttonIcon, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' }, buttonLabel));
72
66
  })));
73
67
  };
74
68
  const eGui = this.eGui;
@@ -1,4 +1,4 @@
1
- import { ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, RowNode, ValueGetterParams, ValueSetterParams } from '@ag-grid-community/all-modules';
1
+ import { ChartModel, ChartRef, ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, RowNode } from '@ag-grid-community/all-modules';
2
2
  import { AdaptableNoCodeWizardOptions, IAdaptableNoCodeWizard } from '../AdaptableInterfaces/AdaptableNoCodeWizard';
3
3
  import { IAdaptable } from '../AdaptableInterfaces/IAdaptable';
4
4
  import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
@@ -18,7 +18,6 @@ import { SelectedRowInfo } from '../PredefinedConfig/Selection/SelectedRowInfo';
18
18
  import { AdaptableTheme } from '../PredefinedConfig/ThemeState';
19
19
  import { IAdaptableStore } from '../Redux/Store/Interface/IAdaptableStore';
20
20
  import { IModuleCollection } from '../Strategy/Interface/IModule';
21
- import { AdaptableColumnType } from '../types';
22
21
  import { EmitterCallback } from '../Utilities/Emitter';
23
22
  import { IPPStyle } from '../Utilities/Interface/IPPStyle';
24
23
  import { LicenseService } from '../Utilities/Services/LicenseService';
@@ -31,8 +30,6 @@ import { IModuleService } from '../Utilities/Services/Interface/IModuleService';
31
30
  import { IEntitlementService } from '../Utilities/Services/Interface/IEntitlementService';
32
31
  import { IQueryLanguageService } from '../Utilities/Services/Interface/IQueryLanguageService';
33
32
  import { IAlertService } from '../Utilities/Services/Interface/IAlertService';
34
- import { AdaptableNumberEditor } from './editors/AdaptableNumberEditor';
35
- import { AdaptableDateEditor } from './editors/AdaptableDateEditor';
36
33
  import { ColumnSetupInfo } from './ColumnSetupInfo';
37
34
  import { CustomSort } from '../PredefinedConfig/CustomSortState';
38
35
  import { ColumnValuesComparer } from '../AdaptableOptions/GeneralOptions';
@@ -189,7 +186,7 @@ export declare class Adaptable implements IAdaptable {
189
186
  getDisplayValue(primaryKey: any, columnId: string): string | undefined;
190
187
  getGridCellFromRowNode(rowNode: RowNode, columnId: string): GridCell | undefined;
191
188
  getDisplayValueFromRowNode(rowNode: RowNode, columnId: string): string | undefined;
192
- getDisplayValueFromRawValue(columnId: string, rawValue: any): string | undefined;
189
+ getDisplayValueFromRawValue(rowNode: RowNode, columnId: string, rawValue: any): string | undefined;
193
190
  private getFormattedValue;
194
191
  private getNormalisedValueFromRowValue;
195
192
  getRawValueFromRowNode(rowNode: RowNode, columnId: string): any;
@@ -224,28 +221,7 @@ export declare class Adaptable implements IAdaptable {
224
221
  */
225
222
  private mapColumnDefs;
226
223
  private getColDefsForSpecialColumns;
227
- getColDefsForFreeTextColumns(): {
228
- headerName: string;
229
- colId: string;
230
- editable: boolean;
231
- hide: boolean;
232
- width: number;
233
- enableValue: boolean;
234
- filter: boolean;
235
- floatingFilter: boolean;
236
- resizable: boolean;
237
- enableRowGroup: boolean;
238
- sortable: boolean;
239
- enablePivot: boolean;
240
- suppressMenu: boolean;
241
- suppressMovable: boolean;
242
- headerTooltip: string;
243
- cellEditor: string | typeof AdaptableNumberEditor | typeof AdaptableDateEditor;
244
- type: AdaptableColumnType[];
245
- valueSetter: (params: ValueSetterParams) => any;
246
- cellRenderer: import("@ag-grid-community/all-modules").ICellRendererFunc;
247
- valueGetter: (params: ValueGetterParams) => any;
248
- }[];
224
+ getColDefsForFreeTextColumns(): ColDef[];
249
225
  setupColumnValueGetter({ col }: ColumnSetupInfo): void;
250
226
  setupColumnAggFunc({ col }: ColumnSetupInfo): void;
251
227
  private getColDefsForRowEditColumns;
@@ -378,6 +354,8 @@ export declare class Adaptable implements IAdaptable {
378
354
  private addSyntheticPrimaryKey;
379
355
  private addSyntheticPrimaryKeyIfMissing;
380
356
  initLicenseService(): LicenseService;
357
+ showCharts(charts: ChartModel[]): ChartRef[];
358
+ getChartModels(): ChartModel[];
381
359
  }
382
360
  export declare class AdaptableNoCodeWizard implements IAdaptableNoCodeWizard {
383
361
  private init;
@@ -62,7 +62,6 @@ const StatusBarState_1 = require("../PredefinedConfig/StatusBarState");
62
62
  const createAgStatusPanelComponent_1 = require("./createAgStatusPanelComponent");
63
63
  const AdaptableStatusBar_1 = require("../View/StatusBar/AdaptableStatusBar");
64
64
  const RowEditService_1 = require("../Utilities/Services/RowEditService");
65
- const rowEditIcons_1 = require("./rowEditIcons");
66
65
  const tinycolor = require('tinycolor2');
67
66
  all_modules_1.ModuleRegistry.registerModules(all_modules_1.AllCommunityModules);
68
67
  const GROUP_PATH_SEPARATOR = '/';
@@ -1861,7 +1860,7 @@ class Adaptable {
1861
1860
  const abColumn = this.api.columnApi.getColumnFromId(columnId);
1862
1861
  const pkValue = this.getPrimaryKeyValueFromRowNode(rowNode);
1863
1862
  const rawValue = this.getRawValueFromRowNode(rowNode, columnId);
1864
- const displayValue = this.getDisplayValueFromRawValue(columnId, rawValue);
1863
+ const displayValue = this.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
1865
1864
  const normalisedvalue = this.getNormalisedValueFromRowValue(rawValue, abColumn);
1866
1865
  return {
1867
1866
  rawValue: rawValue,
@@ -1877,15 +1876,15 @@ class Adaptable {
1877
1876
  return undefined;
1878
1877
  }
1879
1878
  const rawValue = this.getRawValueFromRowNode(rowNode, columnId);
1880
- return this.getDisplayValueFromRawValue(columnId, rawValue);
1879
+ return this.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
1881
1880
  }
1882
- getDisplayValueFromRawValue(columnId, rawValue) {
1881
+ getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
1883
1882
  const abColumn = this.api.columnApi.getColumnFromId(columnId);
1884
1883
  const isRenderedColumn = this.api.columnApi.isFormatNumericStyleColumn(abColumn);
1885
1884
  if (isRenderedColumn) {
1886
1885
  const colDef = this.gridOptions.api.getColumnDef(columnId);
1887
1886
  if (typeof colDef.valueFormatter == 'function') {
1888
- return this.getFormattedValue(rawValue, columnId, colDef, colDef.valueFormatter);
1887
+ return this.getFormattedValue(rowNode, rawValue, columnId, colDef, colDef.valueFormatter);
1889
1888
  }
1890
1889
  return this.agGridHelper.getCleanValue(rawValue);
1891
1890
  }
@@ -1896,7 +1895,7 @@ class Adaptable {
1896
1895
  const colDef = this.gridOptions.api.getColumnDef(columnId);
1897
1896
  if (colDef) {
1898
1897
  if (typeof colDef.valueFormatter == 'function') {
1899
- const formattedValue = this.getFormattedValue(rawValue, columnId, colDef, colDef.valueFormatter);
1898
+ const formattedValue = this.getFormattedValue(rowNode, rawValue, columnId, colDef, colDef.valueFormatter);
1900
1899
  // Never use cellRenderer:
1901
1900
  // - when a string, you never know if it is HTML or a normal string
1902
1901
  // - when an object, cannot be used
@@ -1911,14 +1910,14 @@ class Adaptable {
1911
1910
  }
1912
1911
  return this.agGridHelper.getCleanValue(rawValue);
1913
1912
  }
1914
- getFormattedValue(rawValue, columnId, colDef, formatterFn) {
1913
+ getFormattedValue(rowNode, rawValue, columnId, colDef, formatterFn) {
1915
1914
  const column = this.gridOptions.columnApi
1916
1915
  .getAllColumns()
1917
1916
  .find((c) => c.getColId() == columnId);
1918
1917
  const params = {
1919
1918
  value: rawValue,
1920
- node: null,
1921
- data: null,
1919
+ node: rowNode,
1920
+ data: rowNode.data,
1922
1921
  colDef,
1923
1922
  column,
1924
1923
  api: this.gridOptions.api,
@@ -2132,7 +2131,6 @@ class Adaptable {
2132
2131
  : freeTextColumn.DataType === 'Date'
2133
2132
  ? AdaptableDateEditor_1.AdaptableDateEditor
2134
2133
  : null;
2135
- LoggingHelper_1.LogAdaptableInfo('Setting up FreeText Column: ' + freeTextColumn.ColumnId);
2136
2134
  const columnTypes = [
2137
2135
  GeneralConstants_1.AB_SPECIAL_COLUMN,
2138
2136
  this.agGridHelper.getAgGridDataType(freeTextColumn.DataType),
@@ -2140,7 +2138,7 @@ class Adaptable {
2140
2138
  if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty((_a = freeTextColumn === null || freeTextColumn === void 0 ? void 0 : freeTextColumn.FreeTextColumnSettings) === null || _a === void 0 ? void 0 : _a.ColumnTypes)) {
2141
2139
  columnTypes.push(...freeTextColumn.FreeTextColumnSettings.ColumnTypes);
2142
2140
  }
2143
- return {
2141
+ const newColDef = {
2144
2142
  headerName: freeTextColumn.FriendlyName || freeTextColumn.ColumnId,
2145
2143
  colId: freeTextColumn.ColumnId,
2146
2144
  editable: true,
@@ -2155,7 +2153,6 @@ class Adaptable {
2155
2153
  enablePivot: freeTextColumnSettings.Pivotable,
2156
2154
  suppressMenu: freeTextColumnSettings.SuppressMenu,
2157
2155
  suppressMovable: freeTextColumnSettings.SuppressMovable,
2158
- headerTooltip: freeTextColumnSettings.HeaderToolTip,
2159
2156
  cellEditor: dataTypeEditor !== null && dataTypeEditor !== void 0 ? dataTypeEditor : (freeTextColumn.TextEditor && freeTextColumn.TextEditor == 'Large'
2160
2157
  ? 'agLargeTextCellEditor'
2161
2158
  : 'agTextCellEditor'),
@@ -2168,6 +2165,11 @@ class Adaptable {
2168
2165
  : undefined,
2169
2166
  valueGetter: (params) => this.api.freeTextColumnApi.getFreeTextColumnValueFromRowNode(freeTextColumn, params.node),
2170
2167
  };
2168
+ if (freeTextColumnSettings.HeaderToolTip) {
2169
+ newColDef.headerTooltip = freeTextColumnSettings.HeaderToolTip;
2170
+ }
2171
+ LoggingHelper_1.LogAdaptableInfo('Setting up FreeText Column: ' + freeTextColumn.ColumnId);
2172
+ return newColDef;
2171
2173
  });
2172
2174
  }
2173
2175
  setupColumnValueGetter({ col }) {
@@ -2193,57 +2195,55 @@ class Adaptable {
2193
2195
  }
2194
2196
  const editButtons = actionRowButtons
2195
2197
  .map((buttonName) => {
2196
- if (buttonName === 'create') {
2197
- // we need this dirty hack until ActionColumn support for custom icons is improved
2198
- const label = rowEditIcons_1.rowAddIcon;
2199
- return {
2200
- label,
2198
+ const button = buttonName === 'create'
2199
+ ? {
2200
+ icon: {
2201
+ name: 'add-row',
2202
+ },
2201
2203
  tooltip: 'Create',
2202
2204
  onClick: () => {
2203
2205
  this.api.actionApi.displayCreateActionRow();
2204
2206
  },
2205
- };
2206
- }
2207
- if (buttonName === 'edit') {
2208
- // we need this dirty hack until ActionColumn support for custom icons is improved
2209
- const label = rowEditIcons_1.rowEditIcon;
2210
- return {
2211
- label,
2212
- tooltip: 'Edit',
2213
- onClick: (button, context) => {
2214
- this.api.actionApi.displayEditActionRow(context.primaryKeyValue);
2215
- },
2216
- };
2217
- }
2218
- if (buttonName === 'clone') {
2219
- // we need this dirty hack until ActionColumn support for custom icons is improved
2220
- const label = rowEditIcons_1.rowCloneIcon;
2221
- return {
2222
- label,
2223
- tooltip: 'Clone',
2224
- onClick: (button, context) => {
2225
- this.api.actionApi.displayCloneActionRow(context.primaryKeyValue);
2226
- },
2227
- };
2228
- }
2229
- if (buttonName === 'delete') {
2230
- // we need this dirty hack until ActionColumn support for custom icons is improved
2231
- const label = rowEditIcons_1.rowDeleteIcon;
2232
- return {
2233
- label,
2234
- tooltip: 'Delete',
2235
- onClick: (button, context) => {
2236
- var _a, _b;
2237
- const eventInfo = {
2238
- type: 'rowDeleted',
2239
- rowNode: context.rowNode,
2240
- adaptableApi: context.adaptableApi,
2241
- };
2242
- this.api.eventApi.emit('ActionRowSubmitted', eventInfo);
2243
- (_b = (_a = this.adaptableOptions.actionOptions.actionRowFormOptions).onFormSubmit) === null || _b === void 0 ? void 0 : _b.call(_a, eventInfo);
2244
- },
2245
- };
2246
- }
2207
+ }
2208
+ : buttonName === 'edit'
2209
+ ? {
2210
+ icon: {
2211
+ name: 'edit',
2212
+ },
2213
+ tooltip: 'Edit',
2214
+ onClick: (button, context) => {
2215
+ this.api.actionApi.displayEditActionRow(context.primaryKeyValue);
2216
+ },
2217
+ }
2218
+ : buttonName === 'clone'
2219
+ ? {
2220
+ icon: {
2221
+ name: 'clone',
2222
+ },
2223
+ tooltip: 'Clone',
2224
+ onClick: (button, context) => {
2225
+ this.api.actionApi.displayCloneActionRow(context.primaryKeyValue);
2226
+ },
2227
+ }
2228
+ : buttonName === 'delete'
2229
+ ? {
2230
+ icon: {
2231
+ name: 'delete',
2232
+ },
2233
+ tooltip: 'Delete',
2234
+ onClick: (button, context) => {
2235
+ var _a, _b;
2236
+ const eventInfo = {
2237
+ type: 'rowDeleted',
2238
+ rowNode: context.rowNode,
2239
+ adaptableApi: context.adaptableApi,
2240
+ };
2241
+ this.api.eventApi.emit('ActionRowSubmitted', eventInfo);
2242
+ (_b = (_a = this.adaptableOptions.actionOptions.actionRowFormOptions).onFormSubmit) === null || _b === void 0 ? void 0 : _b.call(_a, eventInfo);
2243
+ },
2244
+ }
2245
+ : undefined;
2246
+ return button;
2247
2247
  })
2248
2248
  .filter(Boolean);
2249
2249
  if (!editButtons.length) {
@@ -2402,6 +2402,7 @@ class Adaptable {
2402
2402
  ? this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
2403
2403
  : true;
2404
2404
  const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable).CalculatedColumnSettings;
2405
+ const isExternalEvaluation = !this.api.internalApi.runModuleInAdaptableQL('CalculatedColumn');
2405
2406
  return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
2406
2407
  const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
2407
2408
  if (!calculatedColumnSettings.DataType) {
@@ -2434,9 +2435,9 @@ class Adaptable {
2434
2435
  suppressMovable: calculatedColumnSettings.SuppressMovable,
2435
2436
  type: columnTypes,
2436
2437
  valueGetter: (params) => {
2437
- var _a, _b;
2438
- if ((_a = calculatedColumn.CalculatedColumnSettings) === null || _a === void 0 ? void 0 : _a.ExternallyEvaluatedExpression) {
2439
- return (_b = params.data) === null || _b === void 0 ? void 0 : _b[calculatedColumn.ColumnId];
2438
+ var _a;
2439
+ if (isExternalEvaluation) {
2440
+ return (_a = params.data) === null || _a === void 0 ? void 0 : _a[calculatedColumn.ColumnId];
2440
2441
  }
2441
2442
  return this.CalculatedColumnExpressionService.evaluateCalculatedColumnQuery(calculatedColumn, params.node);
2442
2443
  },
@@ -2700,7 +2701,6 @@ class Adaptable {
2700
2701
  this.gridOptions.api.addGlobalListener((this.listenerGlobalColumnEventsThatTriggerStateChange = (type) => {
2701
2702
  if (columnEventsThatTriggersStateChange.indexOf(type) > -1) {
2702
2703
  this.debouncedSetColumnIntoStore();
2703
- this.debouncedFilterGrid();
2704
2704
  }
2705
2705
  }));
2706
2706
  /**
@@ -3310,28 +3310,29 @@ class Adaptable {
3310
3310
  }
3311
3311
  if (formatColumn.DisplayFormat) {
3312
3312
  let valueFormatter;
3313
+ const options = formatColumn.DisplayFormat.Options;
3313
3314
  if (formatColumn.DisplayFormat.Formatter === 'NumberFormatter') {
3314
3315
  // change the Number format - if the scope allows it
3315
3316
  if (this.api.scopeApi.isColumnInNumericScope(abColumn, formatColumn.Scope)) {
3316
- const options = formatColumn.DisplayFormat.Options;
3317
3317
  valueFormatter = (params) => {
3318
- let value = params.value;
3319
- return this.api.formatColumnApi.getNumberFormattedValue(value, options);
3318
+ return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
3320
3319
  };
3321
3320
  }
3322
3321
  }
3323
3322
  if (formatColumn.DisplayFormat.Formatter === 'DateFormatter') {
3324
3323
  // change the Date format - if the scope allows it
3325
3324
  if (this.api.scopeApi.isColumnInDateScope(abColumn, formatColumn.Scope)) {
3326
- const options = formatColumn.DisplayFormat.Options;
3327
- valueFormatter = (params) => this.api.formatColumnApi.getDateFormattedValue(params.value, options);
3325
+ valueFormatter = (params) => {
3326
+ return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
3327
+ };
3328
3328
  }
3329
3329
  }
3330
3330
  if (formatColumn.DisplayFormat.Formatter === 'StringFormatter') {
3331
- // change the Date format - if the scope allows it
3331
+ // change the String format - if the scope allows it
3332
3332
  if (this.api.scopeApi.isColumnInStringsScope(abColumn, formatColumn.Scope)) {
3333
- const options = formatColumn.DisplayFormat.Options;
3334
- valueFormatter = (params) => this.api.formatColumnApi.getStringFormattedValue(params.value, options);
3333
+ valueFormatter = (params) => {
3334
+ return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
3335
+ };
3335
3336
  }
3336
3337
  }
3337
3338
  return valueFormatter;
@@ -4534,7 +4535,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4534
4535
  rawValue = numericRawValue;
4535
4536
  }
4536
4537
  }
4537
- return this.ReportService.getCellExportValueFromRawValue(rawValue, columnId);
4538
+ return this.ReportService.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
4538
4539
  }
4539
4540
  hasAutogeneratedPrimaryKey() {
4540
4541
  return this.adaptableOptions.autogeneratePrimaryKey;
@@ -4561,6 +4562,20 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4561
4562
  publishedAt: publishTimestamp_1.default,
4562
4563
  });
4563
4564
  }
4565
+ showCharts(charts) {
4566
+ if (!this.gridOptions.api) {
4567
+ LoggingHelper_1.ConsoleLogError('Adaptable must be instantiated before calling showCharts');
4568
+ return [];
4569
+ }
4570
+ return charts.map((chart) => this.gridOptions.api.restoreChart(chart));
4571
+ }
4572
+ getChartModels() {
4573
+ if (!this.gridOptions.api) {
4574
+ LoggingHelper_1.ConsoleLogError('Adaptable must be instantiated before calling getChartModels');
4575
+ return [];
4576
+ }
4577
+ return this.gridOptions.api.getChartModels();
4578
+ }
4564
4579
  }
4565
4580
  exports.Adaptable = Adaptable;
4566
4581
  class AdaptableNoCodeWizard {
@@ -12,6 +12,7 @@ export declare class agGridMenuHelper {
12
12
  createAgGridMenuDefFromAdaptableMenu(adaptableMenuItem: AdaptableMenuItem): MenuItemDef;
13
13
  createAgGridColumnMenuDefFromUserMenu(menuItem: UserMenuItem<ColumnMenuContext>, menuContext: ColumnMenuContext): MenuItemDef;
14
14
  createAgGridContextMenuDefFromUserMenu(menuItem: UserMenuItem<ContextMenuContext>, menuContext: ContextMenuContext): MenuItemDef;
15
+ private mapAdaptableIconToAgGridIcon;
15
16
  createAdaptableColumnMenuItemFromUserMenu(menuItem: UserMenuItem<ColumnMenuContext>, menuContext: ColumnMenuContext): AdaptableMenuItem;
16
17
  createAgGridColumnMenuItems(originalgetMainMenuItems: GetMainMenuItems, params: GetMainMenuItemsParams): (string | MenuItemDef)[] | undefined;
17
18
  createGroupedColumnMenuItem(): MenuItemDef | undefined;
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
6
6
  const icons_1 = require("../components/icons");
7
7
  const flatten_1 = tslib_1.__importDefault(require("lodash/flatten"));
8
+ const AdaptableIconComponent_1 = require("../components/AdaptableIconComponent");
8
9
  // tslint:disable-next-line: class-name
9
10
  class agGridMenuHelper {
10
11
  constructor(adaptable, gridOptions) {
@@ -106,7 +107,7 @@ class agGridMenuHelper {
106
107
  action: x.onClick
107
108
  ? x.onClick
108
109
  : () => this.adaptable.api.internalApi.dispatchReduxAction(x.reduxAction),
109
- icon: icons_1.iconToString(x.icon, {
110
+ icon: this.mapAdaptableIconToAgGridIcon(x.icon, {
110
111
  fill: 'var(--ab-color-text-on-primary)',
111
112
  }),
112
113
  };
@@ -124,7 +125,7 @@ class agGridMenuHelper {
124
125
  : adaptableMenuItem.reduxAction
125
126
  ? () => this.adaptable.api.internalApi.dispatchReduxAction(adaptableMenuItem.reduxAction)
126
127
  : undefined,
127
- icon: icons_1.iconToString(adaptableMenuItem.icon, {
128
+ icon: this.mapAdaptableIconToAgGridIcon(adaptableMenuItem.icon, {
128
129
  fill: 'var(--ab-color-text-on-primary)',
129
130
  }),
130
131
  subMenu: subMenuItems,
@@ -136,7 +137,7 @@ class agGridMenuHelper {
136
137
  return {
137
138
  name: this.getLabelFromUserColumnMenuItem(menuItem, menuContext),
138
139
  action: () => (fn ? fn(menuContext) : null),
139
- icon: icons_1.iconToString(menuItem.icon, {
140
+ icon: this.mapAdaptableIconToAgGridIcon(menuItem.icon, {
140
141
  fill: 'var(--ab-color-text-on-primary)',
141
142
  }),
142
143
  disabled: disabled,
@@ -153,7 +154,7 @@ class agGridMenuHelper {
153
154
  return {
154
155
  name: this.getLabelFromUserContextMenuItem(menuItem, menuContext),
155
156
  action: () => (fn ? fn(menuContext) : null),
156
- icon: icons_1.iconToString(menuItem.icon, {
157
+ icon: this.mapAdaptableIconToAgGridIcon(menuItem.icon, {
157
158
  fill: 'var(--ab-color-text-on-primary)',
158
159
  }),
159
160
  disabled: disabled,
@@ -164,6 +165,16 @@ class agGridMenuHelper {
164
165
  }),
165
166
  };
166
167
  }
168
+ mapAdaptableIconToAgGridIcon(adaptableIcon, style) {
169
+ if (AdaptableIconComponent_1.isAdaptableElementIcon(adaptableIcon)) {
170
+ return adaptableIcon.element;
171
+ }
172
+ else {
173
+ return icons_1.iconToString(adaptableIcon, {
174
+ fill: 'var(--ab-color-text-on-primary)',
175
+ });
176
+ }
177
+ }
167
178
  createAdaptableColumnMenuItemFromUserMenu(menuItem, menuContext) {
168
179
  const fn = menuItem.onClick;
169
180
  let adaptableMenuItem = {
@@ -13,22 +13,16 @@ const react_1 = require("react");
13
13
  function AdaptableFormComponentButtons({ formDef, onClick, defaultTone, disabledButtons, api, context, focusFirstButton = true, }) {
14
14
  return (React.createElement(React.Fragment, null, formDef.buttons.map((button, index) => {
15
15
  var _a;
16
- const defaultIconProps = {
17
- style: {
18
- height: 15,
19
- width: 15,
20
- },
21
- };
22
- const buttonIcon = api.internalApi.getIconForButton(button, context);
23
- const iconProps = buttonIcon && Object.assign({}, defaultIconProps, buttonIcon);
16
+ const buttonIcon = api.internalApi.getIconForButton(button, context, {
17
+ height: 15,
18
+ width: 15,
19
+ });
24
20
  let buttonStyle = api.internalApi.getStyleForButton(button, context ? context : { adaptableApi: api });
25
21
  let buttonLabel = api.internalApi.getLabelForButton(button, context ? context : { adaptableApi: api });
26
22
  let buttonTooltip = api.internalApi.getTooltipForButton(button, context ? context : { adaptableApi: api });
27
- return (React.createElement(SimpleButton_1.default, { autoFocus: focusFirstButton && index === 0, disabled: disabledButtons[index], key: index, tooltip: buttonTooltip, tone: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _a !== void 0 ? _a : defaultTone, variant: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant, "data-text": buttonLabel, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, marginLeft: index ? 2 : 0, onClick: () => {
23
+ return (React.createElement(SimpleButton_1.default, { autoFocus: focusFirstButton && index === 0, disabled: disabledButtons[index], key: index, tooltip: buttonTooltip, icon: buttonIcon, tone: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _a !== void 0 ? _a : defaultTone, variant: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant, "data-text": buttonLabel, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, marginLeft: index ? 2 : 0, onClick: () => {
28
24
  onClick(button);
29
- } },
30
- buttonIcon ? React.createElement("img", Object.assign({}, iconProps)) : null,
31
- buttonLabel));
25
+ } }, buttonLabel));
32
26
  })));
33
27
  }
34
28
  exports.AdaptableFormComponentButtons = AdaptableFormComponentButtons;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { AdaptableExternalIcon, AdaptableIcon, AdaptableInternalIcon } from '../../PredefinedConfig/Common/AdaptableIcon';
2
+ import { AdaptableElementIcon, AdaptableExternalIcon, AdaptableIcon, AdaptableInternalIcon } from '../../PredefinedConfig/Common/AdaptableIcon';
3
3
  export interface AdaptableIconComponentProps {
4
4
  icon: AdaptableIcon;
5
5
  iconClassName?: string;
@@ -7,4 +7,5 @@ export interface AdaptableIconComponentProps {
7
7
  export declare const AdaptableIconComponent: (props: AdaptableIconComponentProps) => JSX.Element;
8
8
  export declare const isAdaptableInternalIcon: (icon: unknown) => icon is AdaptableInternalIcon;
9
9
  export declare const isAdaptableExternalIcon: (icon: unknown) => icon is AdaptableExternalIcon;
10
+ export declare const isAdaptableElementIcon: (icon: unknown) => icon is AdaptableElementIcon;
10
11
  export declare const isAdaptableIcon: (icon: unknown) => icon is AdaptableIcon;