@adaptabletools/adaptable 11.1.1 → 11.1.4

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 (102) hide show
  1. package/base.css +2 -0
  2. package/bundle.cjs.js +119 -119
  3. package/index.css +3 -0
  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 +3 -2
  8. package/src/AdaptableOptions/AdaptableOptions.d.ts +49 -49
  9. package/src/AdaptableOptions/ContainerOptions.d.ts +1 -1
  10. package/src/AdaptableOptions/DashboardOptions.d.ts +1 -1
  11. package/src/AdaptableOptions/EditOptions.d.ts +4 -0
  12. package/src/AdaptableOptions/LayoutOptions.d.ts +11 -0
  13. package/src/AdaptableOptions/NotificationsOptions.d.ts +2 -2
  14. package/src/AdaptableOptions/SmartEdit.d.ts +34 -0
  15. package/src/AdaptableOptions/SmartEdit.js +2 -0
  16. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -1
  17. package/src/Api/Implementation/ColumnApiImpl.js +1 -1
  18. package/src/Api/Implementation/FilterApiImpl.js +8 -2
  19. package/src/Api/Implementation/GridApiImpl.d.ts +3 -3
  20. package/src/Api/Implementation/GridApiImpl.js +15 -18
  21. package/src/Api/Implementation/InternalApiImpl.js +1 -1
  22. package/src/Api/Implementation/LayoutApiImpl.js +7 -1
  23. package/src/Api/Implementation/SmartEditApiImpl.d.ts +3 -2
  24. package/src/Api/SmartEditApi.d.ts +3 -2
  25. package/src/PredefinedConfig/ExportState.d.ts +0 -5
  26. package/src/PredefinedConfig/PopupState.d.ts +2 -1
  27. package/src/PredefinedConfig/SystemState.d.ts +2 -5
  28. package/src/Redux/ActionsReducers/PopupRedux.d.ts +22 -3
  29. package/src/Redux/ActionsReducers/PopupRedux.js +42 -8
  30. package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -23
  31. package/src/Redux/ActionsReducers/SystemRedux.js +3 -32
  32. package/src/Strategy/AlertModule.js +28 -6
  33. package/src/Strategy/CalculatedColumnModule.js +5 -0
  34. package/src/Strategy/ExportModule.js +14 -4
  35. package/src/Strategy/FreeTextColumnModule.js +1 -1
  36. package/src/Strategy/Interface/IModule.d.ts +2 -1
  37. package/src/Strategy/LayoutModule.d.ts +23 -0
  38. package/src/Strategy/LayoutModule.js +70 -0
  39. package/src/Strategy/SmartEditModule.d.ts +2 -2
  40. package/src/Strategy/SmartEditModule.js +24 -13
  41. package/src/Strategy/Utilities/getFlashingCellStyleViewItems.d.ts +1 -0
  42. package/src/Strategy/Utilities/getFlashingCellStyleViewItems.js +2 -1
  43. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -0
  44. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
  45. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +4 -2
  46. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +0 -3
  47. package/src/Utilities/Helpers/StyleHelper.d.ts +1 -0
  48. package/src/Utilities/Helpers/StyleHelper.js +13 -1
  49. package/src/Utilities/Interface/MessagePopups.d.ts +12 -0
  50. package/src/View/AdaptableView.js +2 -2
  51. package/src/View/AdaptableViewFactory.js +2 -4
  52. package/src/View/ColorPicker.d.ts +4 -2
  53. package/src/View/ColorPicker.js +16 -4
  54. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +24 -19
  55. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +3 -1
  56. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +23 -15
  57. package/src/View/Components/Popups/FormPopups/FormPopups.d.ts +10 -0
  58. package/src/View/Components/Popups/FormPopups/FormPopups.js +37 -0
  59. package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +2 -0
  60. package/src/View/Components/Popups/WindowPopups/WindowPopups.js +10 -6
  61. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
  62. package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
  63. package/src/View/Components/RangesComponent.js +4 -6
  64. package/src/View/Components/StyleComponent.js +6 -9
  65. package/src/View/Components/ValueSelector/index.d.ts +1 -0
  66. package/src/View/Components/ValueSelector/index.js +1 -1
  67. package/src/View/Dashboard/CustomToolbarWrapper.js +9 -1
  68. package/src/View/DataSource/DataSourceViewPanel.d.ts +3 -3
  69. package/src/View/DataSource/DataSourceViewPanel.js +15 -13
  70. package/src/View/Export/ExportViewPanel.d.ts +1 -3
  71. package/src/View/Export/ExportViewPanel.js +1 -17
  72. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +2 -3
  73. package/src/View/GridInfo/AdaptableObjectsSummary.d.ts +2 -0
  74. package/src/View/GridInfo/AdaptableObjectsSummary.js +26 -0
  75. package/src/View/GridInfo/GridInfoPopup.js +13 -5
  76. package/src/View/Layout/LayoutEditorStandalonePopup.js +3 -4
  77. package/src/View/Layout/LayoutRadioSelector.d.ts +5 -0
  78. package/src/View/Layout/LayoutRadioSelector.js +18 -0
  79. package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -4
  80. package/src/View/Layout/Wizard/LayoutEditorWizard.js +6 -1
  81. package/src/View/Query/ExpandedQueryPopup.d.ts +2 -18
  82. package/src/View/Query/ExpandedQueryPopup.js +42 -57
  83. package/src/View/Query/QueryViewPanel.js +8 -5
  84. package/src/View/SmartEdit/SmartEditPopup.d.ts +3 -3
  85. package/src/View/SmartEdit/SmartEditPopup.js +15 -3
  86. package/src/View/SmartEdit/SmartEditViewPanel.d.ts +3 -4
  87. package/src/View/SmartEdit/SmartEditViewPanel.js +15 -6
  88. package/src/agGrid/Adaptable.d.ts +7 -5
  89. package/src/agGrid/Adaptable.js +63 -56
  90. package/src/components/ExpressionEditor/index.js +0 -1
  91. package/src/components/OverlayTrigger/index.js +1 -0
  92. package/src/components/Radio/index.d.ts +1 -1
  93. package/src/components/Radio/index.js +2 -2
  94. package/src/metamodel/adaptable.metamodel.d.ts +5 -0
  95. package/src/metamodel/adaptable.metamodel.js +17 -5
  96. package/src/types.d.ts +1 -1
  97. package/version.d.ts +1 -1
  98. package/version.js +1 -1
  99. package/src/View/Export/ExportCustomDestinationDialog.d.ts +0 -11
  100. package/src/View/Export/ExportCustomDestinationDialog.js +0 -47
  101. package/src/View/Export/ExportCustomDestinationFormPopups.d.ts +0 -5
  102. package/src/View/Export/ExportCustomDestinationFormPopups.js +0 -15
@@ -8,6 +8,7 @@ const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions"
8
8
  const rebass_1 = require("rebass");
9
9
  const DropdownButton_1 = tslib_1.__importDefault(require("../../components/DropdownButton"));
10
10
  const react_redux_1 = require("react-redux");
11
+ const PopupRedux_1 = require("../../Redux/ActionsReducers/PopupRedux");
11
12
  class DataSourceViewPanelComponent extends React.Component {
12
13
  constructor(props) {
13
14
  super(props);
@@ -22,11 +23,7 @@ class DataSourceViewPanelComponent extends React.Component {
22
23
  let currentDataSourceName = this.state.CurrentDataSource == null
23
24
  ? selectDataSourceString
24
25
  : this.state.CurrentDataSource.Name;
25
- let availableDataSources = this.props.DataSources
26
- // .filter(
27
- // s => s.Name != currentDataSourceName
28
- // )
29
- .map((dataSource, index) => {
26
+ let availableDataSources = this.props.DataSources.map((dataSource) => {
30
27
  return {
31
28
  value: dataSource.Name,
32
29
  label: dataSource.Name,
@@ -44,16 +41,11 @@ class DataSourceViewPanelComponent extends React.Component {
44
41
  else {
45
42
  let newDataSource = this.props.DataSources.find((ds) => ds.Name == dataSourceName);
46
43
  this.setState({ CurrentDataSource: newDataSource });
47
- if (newDataSource.Form) {
48
- alert('have params');
49
- }
50
- else {
51
- this.props.onSelectDataSource(newDataSource);
52
- }
44
+ this.props.onSelectDataSource(newDataSource);
53
45
  }
54
46
  }
55
47
  }
56
- function mapStateToProps(state, ownProps) {
48
+ function mapStateToProps(state) {
57
49
  return {
58
50
  CurrentDataSourceName: state.DataSource.CurrentDataSource,
59
51
  DataSources: state.DataSource.DataSources,
@@ -61,7 +53,17 @@ function mapStateToProps(state, ownProps) {
61
53
  }
62
54
  function mapDispatchToProps(dispatch) {
63
55
  return {
64
- onSelectDataSource: (dataSource) => dispatch(DataSourceRedux.DataSourceSelect(dataSource)),
56
+ onSelectDataSource: (dataSource) => {
57
+ if (dataSource.Form) {
58
+ return dispatch(PopupRedux_1.PopupShowForm({
59
+ Id: 'data-source-form',
60
+ Form: dataSource.Form,
61
+ }));
62
+ }
63
+ else {
64
+ return dispatch(DataSourceRedux.DataSourceSelect(dataSource));
65
+ }
66
+ },
65
67
  };
66
68
  }
67
69
  exports.DataSourceViewPanelControl = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(DataSourceViewPanelComponent);
@@ -1,8 +1,7 @@
1
1
  import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
2
- import { ExportCustomDestinationPopup, Report, ReportSchedule } from '../../PredefinedConfig/ExportState';
2
+ import { Report, ReportSchedule } from '../../PredefinedConfig/ExportState';
3
3
  import { ExportDestination } from '../../PredefinedConfig/Common/Enums';
4
4
  import * as ExportRedux from '../../Redux/ActionsReducers/ExportRedux';
5
- import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
6
5
  import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
7
6
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
8
7
  import * as React from 'react';
@@ -13,7 +12,6 @@ export interface ExportViewPanelComponentProps extends ViewPanelProps {
13
12
  onNewReport: (popup: string) => PopupRedux.PopupShowScreenAction;
14
13
  onEditReport: (popup: string) => PopupRedux.PopupShowScreenAction;
15
14
  onNewReportSchedule: (reportSchedule: ReportSchedule) => PopupRedux.PopupShowScreenAction;
16
- showCustomDestinationForm: (data: ExportCustomDestinationPopup) => SystemRedux.SystemExportCustomDestinationPopupShowAction;
17
15
  Columns: AdaptableColumn[];
18
16
  Reports: Report[] | undefined;
19
17
  CurrentReport: string | undefined;
@@ -4,7 +4,6 @@ exports.ExportViewPanelControl = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
6
6
  const ExportRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/ExportRedux"));
7
- const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
8
7
  const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
9
8
  const React = tslib_1.__importStar(require("react"));
10
9
  const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
@@ -74,22 +73,8 @@ class ExportViewPanelComponent extends React.Component {
74
73
  if (currentReport != null) {
75
74
  deleteMessage = deleteMessage + currentReport.Name + "'?";
76
75
  }
77
- const getCurrentCustomDestination = () => {
78
- return this.isCustomDestination(currentDestination) ? currentDestination : undefined;
79
- };
80
76
  const onApplyExport = () => {
81
- const currentCustomDestination = getCurrentCustomDestination();
82
- if (currentCustomDestination === null || currentCustomDestination === void 0 ? void 0 : currentCustomDestination.form) {
83
- this.props.showCustomDestinationForm({
84
- ExportDestination: currentCustomDestination,
85
- ReportName: this.props.CurrentReport,
86
- });
87
- }
88
- else {
89
- this.props.onApplyExport(currentReport, this.isCustomDestination(currentDestination)
90
- ? currentDestination.name
91
- : currentDestination);
92
- }
77
+ this.props.onApplyExport(currentReport, this.isCustomDestination(currentDestination) ? currentDestination.name : currentDestination);
93
78
  };
94
79
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
95
80
  return (React.createElement(rebass_1.Flex, { style: { gap: 5 }, flexDirection: "row", className: `ab-${elementType}__Export__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
@@ -153,7 +138,6 @@ function mapDispatchToProps(dispatch) {
153
138
  source: 'Toolbar',
154
139
  value: reportSchedule,
155
140
  })),
156
- showCustomDestinationForm: (data) => dispatch(SystemRedux.SystemExportCustomDestinationPopupShow(data)),
157
141
  };
158
142
  }
159
143
  exports.ExportViewPanelControl = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(ExportViewPanelComponent);
@@ -204,11 +204,10 @@ function FormatColumnStyleWizardSection(props) {
204
204
  PercentBarStyle: percentBarStyle,
205
205
  } }));
206
206
  };
207
- const onForeColorSelectChange = (event) => {
207
+ const onForeColorSelectChange = (color) => {
208
208
  var _a;
209
- let e = event.target;
210
209
  let percentBarStyle = (_a = data.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle;
211
- percentBarStyle.BackColor = e.value;
210
+ percentBarStyle.BackColor = color;
212
211
  props.onChange(Object.assign(Object.assign({}, data), { ColumnStyle: {
213
212
  PercentBarStyle: percentBarStyle,
214
213
  } }));
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const AdaptableObjectsSummary: React.FunctionComponent;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdaptableObjectsSummary = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const react_redux_1 = require("react-redux");
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ const AdaptableObjectList_1 = require("../Components/AdaptableObjectList");
9
+ exports.AdaptableObjectsSummary = () => {
10
+ const state = react_redux_1.useSelector((state) => state);
11
+ const adaptable = AdaptableContext_1.useAdaptable();
12
+ const modules = adaptable.ModuleService.getModuleCollection();
13
+ return (React.createElement(React.Fragment, null, [...modules].map(([moduleName, module]) => {
14
+ var _a;
15
+ if (!module.isModuleAvailable()) {
16
+ return null;
17
+ }
18
+ const items = (_a = module === null || module === void 0 ? void 0 : module.toViewAll) === null || _a === void 0 ? void 0 : _a.call(module);
19
+ if (!(items === null || items === void 0 ? void 0 : items.length)) {
20
+ return null;
21
+ }
22
+ return (React.createElement("div", null,
23
+ React.createElement("b", null, module.moduleInfo.FriendlyName),
24
+ (items === null || items === void 0 ? void 0 : items.length) && React.createElement(AdaptableObjectList_1.AdaptableObjectList, { items: items, module: module })));
25
+ })));
26
+ };
@@ -14,12 +14,18 @@ const AdaptablePopover_1 = require("../AdaptablePopover");
14
14
  const version_1 = tslib_1.__importDefault(require("../../../version"));
15
15
  const ColumnInfoComponent_1 = require("./ColumnInfoComponent");
16
16
  const AdaptableOptionsComponent_1 = require("./AdaptableOptionsComponent");
17
+ const AdaptableObjectsSummary_1 = require("./AdaptableObjectsSummary");
17
18
  exports.GridInfoPopup = (props) => {
18
19
  var _a, _b, _c;
19
20
  const entitlementService = props.api.internalApi.getEntitlementService();
20
21
  const showGridSummary = entitlementService.isGridInfoSectionVisible('GridSummary');
21
22
  const showAdaptableOptions = entitlementService.isGridInfoSectionVisible('AdaptableOptions');
22
23
  const showColumnInfo = entitlementService.isGridInfoSectionVisible('ColumnInfo');
24
+ /**
25
+ * Because it is not associated with a module yet, setting this flag to true.
26
+ * Needed for the logic weather to show radio buttons (buttons.length >= 2)
27
+ */
28
+ const showAdaptableObjects = true;
23
29
  const [state, setState] = React.useState({
24
30
  ActiveTab: ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.column) ? 'ColumnInfo'
25
31
  : showGridSummary
@@ -91,15 +97,17 @@ exports.GridInfoPopup = (props) => {
91
97
  let gridSummaries = CreateGridSummaries(propValueColItems).map((x, index) => {
92
98
  return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: index, colItems: x });
93
99
  });
94
- const showRadioButtons = [showGridSummary, showAdaptableOptions, showColumnInfo].filter((item) => item).length > 1;
100
+ const showRadioButtons = [showGridSummary, showAdaptableOptions, showColumnInfo, showAdaptableObjects].filter((item) => item).length > 1;
95
101
  return (React.createElement(PopupPanel_1.PopupPanel, { headerText: 'Grid Info', glyphicon: 'info-sign' },
96
102
  React.createElement(rebass_1.Flex, { marginBottom: 2, padding: 3 }, showRadioButtons && (React.createElement(React.Fragment, null,
97
- showGridSummary && (React.createElement(Radio_1.default, { "data-name": "radioButton-GridSummary", marginRight: 3, value: "GridSummary", checked: state.ActiveTab == 'GridSummary', onChange: (_, e) => onShowGridSummaryChanged('GridSummary') }, "Grid Summary")),
98
- showAdaptableOptions && (React.createElement(Radio_1.default, { "data-name": "radioButton-AdaptableOptions", marginRight: 3, value: "AdaptableOptions", checked: state.ActiveTab == 'AdaptableOptions', onChange: (_, e) => onShowGridSummaryChanged('AdaptableOptions') }, "Adaptable Options")),
99
- showColumnInfo && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", value: "Column", checked: state.ActiveTab == 'ColumnInfo', onChange: (_, e) => onShowGridSummaryChanged('ColumnInfo') }, "Column Info"))))),
103
+ showGridSummary && (React.createElement(Radio_1.default, { "data-name": "radioButton-GridSummary", marginRight: 3, value: "GridSummary", checked: state.ActiveTab == 'GridSummary', onChange: (_, e) => onShowGridSummaryChanged('GridSummary') }, "Summary")),
104
+ showAdaptableOptions && (React.createElement(Radio_1.default, { "data-name": "radioButton-AdaptableOptions", marginRight: 3, value: "AdaptableOptions", checked: state.ActiveTab == 'AdaptableOptions', onChange: (_, e) => onShowGridSummaryChanged('AdaptableOptions') }, "Options")),
105
+ showColumnInfo && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", marginRight: 3, value: "Column", checked: state.ActiveTab == 'ColumnInfo', onChange: (_, e) => onShowGridSummaryChanged('ColumnInfo') }, "Columns")),
106
+ showAdaptableObjects && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", value: "Column", checked: state.ActiveTab == 'AdaptableObjectsSummary', onChange: (_, e) => onShowGridSummaryChanged('AdaptableObjectsSummary') }, "Objects"))))),
100
107
  state.ActiveTab == 'GridSummary' && (React.createElement(rebass_1.Box, { margin: 2 },
101
108
  React.createElement(AdaptableObjectCollection_1.AdaptableObjectCollection, { colItems: propValueColItems, items: gridSummaries }))),
102
109
  state.ActiveTab == 'AdaptableOptions' && React.createElement(AdaptableOptionsComponent_1.AdaptableOptionsComponent, { api: props.api }),
103
110
  state.ActiveTab == 'ColumnInfo' && (React.createElement("div", null,
104
- React.createElement(ColumnInfoComponent_1.ColumnInfoComponent, { api: props.api, teamSharingActivated: props.teamSharingActivated, column: state.CurrentColumn })))));
111
+ React.createElement(ColumnInfoComponent_1.ColumnInfoComponent, { api: props.api, teamSharingActivated: props.teamSharingActivated, column: state.CurrentColumn }))),
112
+ state.ActiveTab === 'AdaptableObjectsSummary' && React.createElement(AdaptableObjectsSummary_1.AdaptableObjectsSummary, null)));
105
113
  };
@@ -9,9 +9,9 @@ const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper
9
9
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
10
10
  const AdaptableContext_1 = require("../AdaptableContext");
11
11
  const PanelFooter_1 = require("../Components/Panels/PanelFooter");
12
- const PanelWithImage_1 = require("../Components/Panels/PanelWithImage");
13
12
  const LayoutEditorWizard_1 = require("./Wizard/LayoutEditorWizard");
14
13
  const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
14
+ const rebass_1 = require("rebass");
15
15
  exports.LayoutEditorStandalonePopup = (props) => {
16
16
  /**
17
17
  * This is here because the old code mutates the object.
@@ -69,8 +69,7 @@ exports.LayoutEditorStandalonePopup = (props) => {
69
69
  props.onDismiss();
70
70
  }, []);
71
71
  const finishDisabled = !layoutData.Name;
72
- return (React.createElement(React.Fragment, null,
73
- React.createElement(PanelWithImage_1.PanelWithImage, { bodyProps: { padding: 2 }, flex: 1, glyphicon: layoutModule.moduleInfo.Glyph, header: layoutModule.moduleInfo.FriendlyName, infoLink: layoutModule.moduleInfo.HelpPage, infoLinkDisabled: false, variant: "primary" },
74
- React.createElement(LayoutEditorWizard_1.LayoutEditorWizard, { data: layoutData, api: adaptable.api, Layouts: layouts, moduleInfo: layoutModule.moduleInfo, onLayoutChange: setStateLayout, updateGoBackState: () => null })),
72
+ return (React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column" },
73
+ React.createElement(LayoutEditorWizard_1.LayoutEditorWizard, { data: layoutData, api: adaptable.api, Layouts: layouts, moduleInfo: layoutModule.moduleInfo, onLayoutChange: setStateLayout, updateGoBackState: () => null }),
75
74
  React.createElement(PanelFooter_1.PanelFooter, { acceptDisabled: finishDisabled, onAccept: handleAccept, onCancel: handleCancel })));
76
75
  };
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { Layout } from '../../../types';
3
+ export declare const LayoutRadioSelector: React.FunctionComponent<{
4
+ data: Layout;
5
+ }>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LayoutRadioSelector = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const Radio_1 = tslib_1.__importDefault(require("../../components/Radio"));
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ exports.LayoutRadioSelector = ({ data }) => {
9
+ const adaptable = AdaptableContext_1.useAdaptable();
10
+ const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
11
+ const layouts = adaptable.api.layoutApi.getAllLayout();
12
+ const isDisabled = (layouts === null || layouts === void 0 ? void 0 : layouts.length) === 1;
13
+ const isSelected = currentLayout.Name === data.Name;
14
+ const handleToggle = React.useCallback(() => {
15
+ adaptable.api.layoutApi.setLayout(data.Name);
16
+ }, [isSelected]);
17
+ return React.createElement(Radio_1.default, { disabled: isDisabled, checked: isSelected, onClick: handleToggle });
18
+ };
@@ -347,10 +347,7 @@ exports.LayoutEditor = React.memo((props) => {
347
347
  React.createElement(icons_1.Icon, { name: "clear" }))));
348
348
  } })),
349
349
  React.createElement(ListPanel, { className: "ab-LayoutEditor__PivotListPanel", header: React.createElement(rebass_1.Flex, { width: "100%", flexDirection: "row", justifyContent: "space-between", alignItems: "center" },
350
- React.createElement(rebass_1.Text, null, "Pivoted Columns"),
351
- React.createElement(CheckBox_1.CheckBox, { mt: 0, mb: 0, checked: layout.EnablePivot, onChange: (checked) => {
352
- setLayout(Object.assign(Object.assign({}, layout), { EnablePivot: checked }));
353
- } }, "Enable")), bodyProps: { padding: 0 } },
350
+ React.createElement(rebass_1.Text, null, "Pivoted Columns")), bodyProps: { padding: 0 } },
354
351
  React.createElement(PivotList_1.PivotList, { pivotColumns: layout.PivotColumns, onPivotColumnsChange: onPivotColumnsChange, isDropDisabled: state.dropDisabledOnPivot, onReady: (dragEnd) => {
355
352
  onDragEndRef.current.pivotList = dragEnd;
356
353
  }, renderItem: (colId, clear) => {
@@ -12,6 +12,7 @@ const AdaptablePopover_1 = require("../../AdaptablePopover");
12
12
  const rebass_1 = require("rebass");
13
13
  const Panel_1 = tslib_1.__importDefault(require("../../../components/Panel"));
14
14
  const ColumnLabels_1 = require("./LayoutEditor/ColumnLabels");
15
+ const CheckBox_1 = require("../../../components/CheckBox");
15
16
  class LayoutEditorWizard extends React.Component {
16
17
  constructor(props) {
17
18
  super(props);
@@ -80,7 +81,11 @@ class LayoutEditorWizard extends React.Component {
80
81
  ' '),
81
82
  this.state.errorMessage ? (React.createElement(FormLayout_1.FormRow, { label: "" },
82
83
  React.createElement(ErrorBox_1.default, null, this.state.errorMessage))) : null)),
83
- React.createElement(rebass_1.Flex, { flex: 1, pr: 2, alignItems: "center", justifyContent: "end" },
84
+ React.createElement(rebass_1.Flex, { flex: 1, alignItems: "center", justifyContent: "flex-end" },
85
+ React.createElement(CheckBox_1.CheckBox, { mt: 0, mb: 0, checked: this.state.layout.EnablePivot, onChange: (checked) => {
86
+ this.updateLayout({ EnablePivot: checked });
87
+ } }, "Enable Pivot Layout")),
88
+ React.createElement(rebass_1.Flex, { width: 120, pr: 2, alignItems: "center", justifyContent: "end" },
84
89
  React.createElement(rebass_1.Text, { mr: 2 }, "Legend"),
85
90
  React.createElement(AdaptablePopover_1.AdaptablePopover, { popoverMinWidth: 200, bodyText: [
86
91
  React.createElement(Panel_1.default, { variant: "modern", header: "Legend: Column Behaviour", className: "ab-LayoutEditor__LegendPanel", style: {
@@ -1,19 +1,3 @@
1
1
  import * as React from 'react';
2
- import * as QueryRedux from '../../Redux/ActionsReducers/QueryRedux';
3
- import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
4
- import { NamedQuery } from '../../PredefinedConfig/QueryState';
5
- import { ExpressionEditorNamedQuery } from '../../components/ExpressionEditor/NamedQueryContext';
6
- interface ExpandedQueryPopupComponentProps extends ModuleViewPopupProps<ExpandedQueryPopupComponent> {
7
- onRunQuery: (expression: string) => QueryRedux.QueryRunAction;
8
- onAddNamedQuery: (namedQuery: NamedQuery) => QueryRedux.NamedQueryAddAction;
9
- }
10
- export interface ExpandedQueryPopupState {
11
- namedQuery: ExpressionEditorNamedQuery;
12
- expression: string;
13
- }
14
- declare class ExpandedQueryPopupComponent extends React.Component<ExpandedQueryPopupComponentProps, ExpandedQueryPopupState> {
15
- constructor(props: ExpandedQueryPopupComponentProps);
16
- render(): JSX.Element;
17
- }
18
- export declare let ExpandedQueryPopup: import("react-redux").ConnectedComponent<typeof ExpandedQueryPopupComponent, Pick<React.ClassAttributes<ExpandedQueryPopupComponent> & ExpandedQueryPopupComponentProps, never>>;
19
- export {};
2
+ import { WindowPopupChildProps } from '../Components/Popups/WindowPopups/WindowPopups';
3
+ export declare const ExpandedQueryPopup: React.FunctionComponent<WindowPopupChildProps>;
@@ -9,62 +9,47 @@ const ExpressionEditor_1 = require("../../components/ExpressionEditor");
9
9
  const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
10
10
  const QueryRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/QueryRedux"));
11
11
  const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
12
- const PanelWithButton_1 = require("../Components/Panels/PanelWithButton");
13
12
  const NamedQueryContext_1 = require("../../components/ExpressionEditor/NamedQueryContext");
14
13
  const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
15
- class ExpandedQueryPopupComponent extends React.Component {
16
- constructor(props) {
17
- super(props);
18
- this.state = {
19
- namedQuery: false,
20
- expression: this.props.popupParams.value,
21
- };
22
- }
23
- render() {
24
- const isExpressionValid = this.props.api.internalApi
25
- .getQueryLanguageService()
26
- .validateBoolean(this.state.expression, ModuleConstants_1.QueryModuleId).isValid;
27
- const initialData = this.props.api.internalApi.getQueryPreviewData();
28
- const namedQueryValidationError = this.state.namedQuery
29
- ? this.props.api.queryApi.isValidNamedQueryName(this.state.namedQuery).message
30
- : '';
31
- const hasNamedQueryError = StringExtensions_1.IsNotNullOrEmpty(namedQueryValidationError);
32
- return (React.createElement(NamedQueryContext_1.NamedQueryContext.Provider, { value: {
33
- namedQuery: this.state.namedQuery,
34
- setNamedQuery: (namedQuery) => this.setState({ namedQuery }),
35
- } },
36
- React.createElement(PanelWithButton_1.PanelWithButton, { headerText: "Current Query", bodyProps: {
37
- padding: 0,
38
- style: { display: 'flex', flexDirection: 'column' },
39
- }, glyphicon: this.props.moduleInfo.Glyph },
40
- React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'boolean', module: ModuleConstants_1.QueryModuleId, value: this.state.expression, onChange: (expression) => this.setState({ expression }), initialData: initialData, columns: this.props.api.columnApi.getQueryableColumns(), namedQueries: this.props.api.queryApi.getAllNamedQuery(), api: this.props.api }),
41
- React.createElement(rebass_1.Flex, { flexDirection: "row", padding: 1, backgroundColor: "primary", alignItems: "center" },
42
- React.createElement(SimpleButton_1.default, { margin: 1, variant: "text", "data-name": "action-close", onClick: () => {
43
- this.props.onClosePopup();
44
- } }, "CLOSE"),
45
- React.createElement(rebass_1.Text, { fontSize: 2, mr: 3, style: {
46
- flex: 1,
47
- color: 'var(--ab-color-error)',
48
- textAlign: 'end',
49
- } }, namedQueryValidationError),
50
- React.createElement(SimpleButton_1.default, { variant: "raised", tone: "accent", "data-name": "action-run", margin: 1, onClick: () => {
51
- if (this.state.namedQuery) {
52
- this.props.onAddNamedQuery(this.state.namedQuery);
53
- }
54
- this.props.onRunQuery(this.state.expression);
55
- this.props.onClosePopup();
56
- }, disabled: !isExpressionValid || StringExtensions_1.IsNullOrEmpty(this.state.expression) || hasNamedQueryError }, "Run Query")))));
57
- }
58
- }
59
- function mapStateToProps() {
60
- return {
61
- // GridState: state.Grid,
62
- };
63
- }
64
- function mapDispatchToProps(dispatch) {
65
- return {
66
- onRunQuery: (expression) => dispatch(QueryRedux.QueryRun(expression)),
67
- onAddNamedQuery: (namedQuery) => dispatch(QueryRedux.NamedQueryAdd(namedQuery)),
68
- };
69
- }
70
- exports.ExpandedQueryPopup = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(ExpandedQueryPopupComponent);
14
+ exports.ExpandedQueryPopup = (props) => {
15
+ const dispatch = react_redux_1.useDispatch();
16
+ const [namedQuery, setNamedQuery] = React.useState(null);
17
+ const [expression, setExpression] = React.useState(props.popupProps.value);
18
+ const isExpressionValid = props.api.internalApi
19
+ .getQueryLanguageService()
20
+ .validateBoolean(expression, ModuleConstants_1.QueryModuleId).isValid;
21
+ const initialData = React.useMemo(() => props.api.internalApi.getQueryPreviewData(), []);
22
+ const namedQueryValidationError = namedQuery
23
+ ? props.api.queryApi.isValidNamedQueryName(namedQuery).message
24
+ : '';
25
+ const hasNamedQueryError = StringExtensions_1.IsNotNullOrEmpty(namedQueryValidationError);
26
+ const onRunQuery = (expression) => dispatch(QueryRedux.QueryRun(expression));
27
+ const onAddNamedQuery = (namedQuery) => dispatch(QueryRedux.NamedQueryAdd(namedQuery));
28
+ return (React.createElement(NamedQueryContext_1.NamedQueryContext.Provider, { value: {
29
+ namedQuery: namedQuery,
30
+ setNamedQuery: (newQuery) => {
31
+ setNamedQuery(newQuery);
32
+ },
33
+ } },
34
+ React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column" },
35
+ React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'boolean', module: ModuleConstants_1.QueryModuleId, value: expression, onChange: (expression) => setExpression(expression), initialData: initialData, columns: props.api.columnApi.getQueryableColumns(), namedQueries: props.api.queryApi.getAllNamedQuery(), api: props.api }),
36
+ React.createElement(rebass_1.Flex, { flexDirection: "row", padding: 1, backgroundColor: "primary", alignItems: "center" },
37
+ React.createElement(SimpleButton_1.default, { margin: 1, variant: "text", "data-name": "action-close", onClick: () => {
38
+ props.onDismiss();
39
+ } }, "CLOSE"),
40
+ React.createElement(rebass_1.Text, { fontSize: 2, mr: 3, style: {
41
+ flex: 1,
42
+ color: 'var(--ab-color-error)',
43
+ textAlign: 'end',
44
+ } }, namedQueryValidationError),
45
+ React.createElement(SimpleButton_1.default, { variant: "raised", tone: "accent", "data-name": "action-run", margin: 1, onClick: () => {
46
+ if (namedQuery) {
47
+ onAddNamedQuery({
48
+ Name: namedQuery.Name,
49
+ BooleanExpression: expression,
50
+ });
51
+ }
52
+ onRunQuery(expression);
53
+ props.onDismiss();
54
+ }, disabled: !isExpressionValid || StringExtensions_1.IsNullOrEmpty(expression) || hasNamedQueryError }, "Run Query")))));
55
+ };
@@ -22,6 +22,7 @@ const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Exte
22
22
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
23
23
  const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
24
24
  const react_redux_1 = require("react-redux");
25
+ const windowFactory_1 = require("../Components/Popups/WindowPopups/windowFactory");
25
26
  class QueryViewPanelComponent extends React.Component {
26
27
  constructor(props) {
27
28
  super(props);
@@ -165,11 +166,13 @@ function mapDispatchToProps(dispatch) {
165
166
  source: 'Toolbar',
166
167
  value,
167
168
  })),
168
- onExpand: (value) => dispatch(PopupRedux.PopupShowScreen(ModuleConstants.QueryModuleId, 'ExpandedQueryPopup', {
169
- source: 'Toolbar',
170
- value,
171
- }, {
172
- footer: null,
169
+ onExpand: (value) => dispatch(PopupRedux.PopupShowWindow({
170
+ Id: windowFactory_1.WINDOW_QUERY_EDITOR,
171
+ Title: 'Current Query',
172
+ Icon: 'query',
173
+ PopupProps: {
174
+ value: value,
175
+ },
173
176
  })),
174
177
  };
175
178
  }
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import * as SmartEditRedux from '../../Redux/ActionsReducers/SmartEditRedux';
3
3
  import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
4
- import { MathOperation } from '../../PredefinedConfig/Common/Enums';
5
4
  import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
6
5
  import { PreviewInfo } from '../../Utilities/Interface/Preview';
6
+ import { SmartEditOperation } from '../../AdaptableOptions/SmartEdit';
7
7
  interface SmartEditPopupProps extends ModuleViewPopupProps<SmartEditPopupComponent> {
8
8
  SmartEditValue: number;
9
- MathOperation: 'Add' | 'Subtract' | 'Multiply' | 'Divide';
9
+ SmartEditOperation: SmartEditOperation;
10
10
  PreviewInfo: PreviewInfo;
11
11
  onSmartEditValueChange: (value: number) => SystemRedux.SmartEditChangeValueAction;
12
- onSmartEditOperationChange: (MathOperation: MathOperation) => SystemRedux.SmartEditChangeOperationAction;
12
+ onSmartEditOperationChange: (SmartEditOperation: SmartEditOperation) => SystemRedux.SmartEditChangeOperationAction;
13
13
  onSmartEditCheckSelectedCells: () => SystemRedux.SmartEditCheckCellSelectionAction;
14
14
  onRunSmartEdit: () => SmartEditRedux.SmartEditRunAction;
15
15
  }
@@ -27,6 +27,7 @@ class SmartEditPopupComponent extends React.Component {
27
27
  this.props.onSmartEditCheckSelectedCells();
28
28
  }
29
29
  render() {
30
+ var _a, _b, _c;
30
31
  let col;
31
32
  if (this.props.PreviewInfo) {
32
33
  col = this.props.PreviewInfo.column;
@@ -34,7 +35,7 @@ class SmartEditPopupComponent extends React.Component {
34
35
  let globalValidationMessage = PreviewHelper_1.PreviewHelper.GetValidationMessage(this.props.PreviewInfo, `${this.props.SmartEditValue}`);
35
36
  let showPanel = this.props.PreviewInfo && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(`${this.props.SmartEditValue}`);
36
37
  let previewPanel = showPanel ? (React.createElement(PreviewResultsPanel_1.PreviewResultsPanel, { style: { flex: '1 1 100%', overflow: 'initial', height: '100%' }, previewInfo: this.props.PreviewInfo, api: this.props.api, selectedColumn: col, showPanel: showPanel, showHeader: true })) : null;
37
- let operationMenuItems = EnumExtensions_1.EnumExtensions.getNames(Enums_1.MathOperation).map((mathOperation, index) => {
38
+ const operationMenuItems = EnumExtensions_1.EnumExtensions.getNames(Enums_1.MathOperation).map((mathOperation, index) => {
38
39
  return {
39
40
  label: mathOperation,
40
41
  onClick: () => {
@@ -42,6 +43,15 @@ class SmartEditPopupComponent extends React.Component {
42
43
  },
43
44
  };
44
45
  });
46
+ const customOperations = (_c = (_b = (_a = this.props.api.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.editOptions) === null || _b === void 0 ? void 0 : _b.smartEdit) === null || _c === void 0 ? void 0 : _c.customOperations;
47
+ if (customOperations === null || customOperations === void 0 ? void 0 : customOperations.length) {
48
+ operationMenuItems.push(...customOperations.map((operation) => {
49
+ return {
50
+ onClick: () => this.props.onSmartEditOperationChange(operation),
51
+ label: operation.Name,
52
+ };
53
+ }));
54
+ }
45
55
  return (React.createElement(PanelWithImage_1.PanelWithImage, { flex: 1, style: { height: '100%' }, variant: "primary", bodyProps: {
46
56
  style: { display: 'flex', flexFlow: 'column' },
47
57
  }, bodyScroll: true, glyphicon: this.props.moduleInfo.Glyph, header: this.props.moduleInfo.FriendlyName, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), onKeyDown: (e) => {
@@ -50,7 +60,9 @@ class SmartEditPopupComponent extends React.Component {
50
60
  }
51
61
  } },
52
62
  React.createElement(rebass_1.Flex, { flexDirection: "row", padding: 2, "data-name": "smart-edit-operation" },
53
- React.createElement(DropdownButton_1.default, { items: operationMenuItems, columns: ['label'], onMouseDown: preventDefault }, Enums_1.MathOperation[this.props.MathOperation]),
63
+ React.createElement(DropdownButton_1.default, { items: operationMenuItems, columns: ['label'], onMouseDown: preventDefault }, typeof this.props.SmartEditOperation === 'object'
64
+ ? this.props.SmartEditOperation.Name
65
+ : this.props.SmartEditOperation),
54
66
  React.createElement(Input_1.default, { value: this.props.SmartEditValue.toString(), marginLeft: 2, marginRight: 2, type: "number", placeholder: "Enter a Number", onChange: (e) => this.onSmartEditValueChange(e) }),
55
67
  React.createElement(SimpleButton_1.default, { tone: this.getButtonStyle(), variant: "raised", disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(`${this.props.SmartEditValue}`) ||
56
68
  (this.props.PreviewInfo &&
@@ -87,7 +99,7 @@ class SmartEditPopupComponent extends React.Component {
87
99
  function mapStateToProps(state, ownProps) {
88
100
  return {
89
101
  SmartEditValue: state.System.SmartEditValue,
90
- MathOperation: state.System.SmartEditOperation,
102
+ SmartEditOperation: state.System.SmartEditOperation,
91
103
  PreviewInfo: state.System.SmartEditPreviewInfo,
92
104
  };
93
105
  }
@@ -2,16 +2,16 @@ import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
2
2
  import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
3
3
  import * as SmartEditRedux from '../../Redux/ActionsReducers/SmartEditRedux';
4
4
  import { PreviewInfo } from '../../Utilities/Interface/Preview';
5
- import { MathOperation } from '../../PredefinedConfig/Common/Enums';
6
5
  import * as React from 'react';
6
+ import { SmartEditOperation } from '../../AdaptableOptions/SmartEdit';
7
7
  export interface SmartEditViewPanelComponentProps extends ViewPanelProps {
8
8
  SmartEditValue: number | undefined;
9
- MathOperation: 'Add' | 'Subtract' | 'Multiply' | 'Divide' | undefined;
9
+ SmartEditOperation: SmartEditOperation | undefined;
10
10
  IsValidSelection: boolean;
11
11
  PreviewInfo: PreviewInfo;
12
12
  InPivotMode: Boolean;
13
13
  onSmartEditValueChange: (value: number) => SystemRedux.SmartEditChangeValueAction;
14
- onSmartEditOperationChange: (MathOperation: MathOperation) => SystemRedux.SmartEditChangeOperationAction;
14
+ onSmartEditOperationChange: (MathOperation: SmartEditOperation) => SystemRedux.SmartEditChangeOperationAction;
15
15
  onSmartEditCheckSelectedCells: () => SystemRedux.SmartEditCheckCellSelectionAction;
16
16
  onRunSmartEdit: () => SmartEditRedux.SmartEditRunAction;
17
17
  }
@@ -28,7 +28,6 @@ declare class SmartEditViewPanelComponent extends React.Component<SmartEditViewP
28
28
  private onSmartEditValueChange;
29
29
  private getStatusColour;
30
30
  private onApplyClick;
31
- private onchangeMathOperation;
32
31
  onApplySmartEdit(): any;
33
32
  }
34
33
  export declare let SmartEditViewPanelControl: import("react-redux").ConnectedComponent<typeof SmartEditViewPanelComponent, any>;
@@ -39,17 +39,27 @@ class SmartEditViewPanelComponent extends React.Component {
39
39
  (_a = this.cleanupEvent) === null || _a === void 0 ? void 0 : _a.call(this);
40
40
  }
41
41
  render() {
42
+ var _a, _b, _c;
42
43
  let statusColour = this.getStatusColour();
43
44
  let selectedColumn = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.state.SelectedColumnId)
44
45
  ? this.props.api.columnApi.getColumnFromId(this.state.SelectedColumnId)
45
46
  : null;
46
47
  let previewPanel = (React.createElement(PreviewResultsPanel_1.PreviewResultsPanel, { previewInfo: this.props.PreviewInfo, api: this.props.api, selectedColumn: selectedColumn, showPanel: true, showHeader: false }));
47
- let operationMenuItems = EnumExtensions_1.EnumExtensions.getNames(Enums_1.MathOperation).map((mathOperation, index) => {
48
+ const operationMenuItems = EnumExtensions_1.EnumExtensions.getNames(Enums_1.MathOperation).map((mathOperation, index) => {
48
49
  return {
49
50
  onClick: () => this.props.onSmartEditOperationChange(mathOperation),
50
51
  label: mathOperation,
51
52
  };
52
53
  });
54
+ const customOperations = (_c = (_b = (_a = this.props.api.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.editOptions) === null || _b === void 0 ? void 0 : _b.smartEdit) === null || _c === void 0 ? void 0 : _c.customOperations;
55
+ if (customOperations === null || customOperations === void 0 ? void 0 : customOperations.length) {
56
+ operationMenuItems.push(...customOperations.map((operation) => {
57
+ return {
58
+ onClick: () => this.props.onSmartEditOperationChange(operation),
59
+ label: operation.Name,
60
+ };
61
+ }));
62
+ }
53
63
  const applyButtonStyle = {
54
64
  color: statusColour,
55
65
  fill: 'currentColor',
@@ -60,7 +70,9 @@ class SmartEditViewPanelComponent extends React.Component {
60
70
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
61
71
  return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__SmartEdit__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
62
72
  React.createElement(rebass_1.Flex, null,
63
- React.createElement(DropdownButton_1.default, { className: `ab-${elementType}__SmartEdit__select`, marginRight: 2, items: operationMenuItems, style: { fontSize: 'small' }, columns: ['label'], disabled: shouldDisable, variant: "outlined" }, this.props.MathOperation),
73
+ React.createElement(DropdownButton_1.default, { className: `ab-${elementType}__SmartEdit__select`, marginRight: 2, items: operationMenuItems, style: { fontSize: 'small' }, columns: ['label'], disabled: shouldDisable, variant: "outlined" }, typeof this.props.SmartEditOperation === 'object'
74
+ ? this.props.SmartEditOperation.Name
75
+ : this.props.SmartEditOperation),
64
76
  React.createElement(Input_1.default, { style: {
65
77
  width: '5rem',
66
78
  }, className: `ab-${elementType}__SmartEdit__select-value`, value: this.props.SmartEditValue.toString(), type: "number", placeholder: "Enter a Number", step: "any", onChange: (e) => this.onSmartEditValueChange(e), disabled: shouldDisable, marginRight: 2 })),
@@ -94,9 +106,6 @@ class SmartEditViewPanelComponent extends React.Component {
94
106
  onApplyClick() {
95
107
  this.onApplySmartEdit();
96
108
  }
97
- onchangeMathOperation(mathOperation) {
98
- this.props.onSmartEditOperationChange(mathOperation);
99
- }
100
109
  onApplySmartEdit() {
101
110
  this.props.onRunSmartEdit();
102
111
  }
@@ -104,7 +113,7 @@ class SmartEditViewPanelComponent extends React.Component {
104
113
  function mapStateToProps(state, ownProps) {
105
114
  return {
106
115
  SmartEditValue: state.System.SmartEditValue,
107
- MathOperation: state.System.SmartEditOperation,
116
+ SmartEditOperation: state.System.SmartEditOperation,
108
117
  IsValidSelection: state.System.IsValidSmartEditSelection,
109
118
  PreviewInfo: state.System.SmartEditPreviewInfo,
110
119
  InPivotMode: state.Grid.IsGridInPivotMode,