@adaptabletools/adaptable 11.3.0 → 12.0.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/base.css +22 -4
  2. package/bundle.cjs.js +108 -108
  3. package/index.css +26 -4
  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 -1
  8. package/src/AdaptableOptions/ActionOptions.d.ts +1 -0
  9. package/src/AdaptableOptions/{FormatColumnOptions.js → ActionOptions.js} +0 -0
  10. package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +5 -0
  11. package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -10
  12. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +5 -0
  13. package/src/AdaptableOptions/AlertOptions.d.ts +14 -1
  14. package/src/AdaptableOptions/ColumnOptions.d.ts +49 -0
  15. package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.js → ColumnOptions.js} +0 -0
  16. package/src/AdaptableOptions/DashboardOptions.d.ts +2 -7
  17. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +19 -0
  18. package/src/AdaptableOptions/EditOptions.d.ts +2 -2
  19. package/src/AdaptableOptions/EntitlementOptions.d.ts +7 -1
  20. package/src/AdaptableOptions/ExportOptions.d.ts +5 -1
  21. package/src/AdaptableOptions/FilterOptions.d.ts +6 -1
  22. package/src/AdaptableOptions/GeneralOptions.d.ts +22 -23
  23. package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.d.ts → MasterDetailPluginOptions.d.ts} +2 -4
  24. package/src/{Api/DataSourceApi.js → AdaptableOptions/MasterDetailPluginOptions.js} +0 -0
  25. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +3 -6
  26. package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -49
  27. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +75 -62
  28. package/src/Api/AdaptableApi.d.ts +6 -3
  29. package/src/Api/ColumnApi.d.ts +2 -2
  30. package/src/Api/ConditionalStyleApi.d.ts +10 -0
  31. package/src/Api/ConfigApi.d.ts +0 -12
  32. package/src/Api/DashboardApi.d.ts +6 -19
  33. package/src/Api/DataSetApi.d.ts +40 -0
  34. package/src/{PredefinedConfig/DataSourceState.js → Api/DataSetApi.js} +0 -0
  35. package/src/Api/EventApi.d.ts +15 -1
  36. package/src/Api/Events/DataSetChanged.d.ts +5 -0
  37. package/src/{PredefinedConfig/FilterState.js → Api/Events/DataSetChanged.js} +0 -0
  38. package/src/Api/Events/SearchChanged.d.ts +3 -4
  39. package/src/Api/FilterApi.d.ts +1 -77
  40. package/src/Api/GridApi.d.ts +1 -1
  41. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
  42. package/src/Api/Implementation/AdaptableApiImpl.js +3 -3
  43. package/src/Api/Implementation/AlertApiImpl.js +5 -1
  44. package/src/Api/Implementation/ApiBase.d.ts +3 -0
  45. package/src/Api/Implementation/ApiBase.js +6 -0
  46. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
  47. package/src/Api/Implementation/ColumnApiImpl.js +2 -2
  48. package/src/Api/Implementation/ConditionalStyleApiImpl.d.ts +2 -0
  49. package/src/Api/Implementation/ConditionalStyleApiImpl.js +8 -0
  50. package/src/Api/Implementation/ConfigApiImpl.d.ts +0 -4
  51. package/src/Api/Implementation/ConfigApiImpl.js +2 -24
  52. package/src/Api/Implementation/DashboardApiImpl.d.ts +3 -6
  53. package/src/Api/Implementation/DashboardApiImpl.js +5 -29
  54. package/src/Api/Implementation/DataSetApiImpl.d.ts +12 -0
  55. package/src/Api/Implementation/DataSetApiImpl.js +42 -0
  56. package/src/Api/Implementation/EventApiImpl.js +1 -0
  57. package/src/Api/Implementation/FilterApiImpl.d.ts +1 -16
  58. package/src/Api/Implementation/FilterApiImpl.js +5 -159
  59. package/src/Api/Implementation/FormatColumnApiImpl.js +1 -1
  60. package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
  61. package/src/Api/Implementation/GridApiImpl.js +1 -1
  62. package/src/Api/Implementation/InternalApiImpl.d.ts +3 -2
  63. package/src/Api/Implementation/InternalApiImpl.js +14 -3
  64. package/src/Api/Implementation/LayoutApiImpl.d.ts +18 -1
  65. package/src/Api/Implementation/LayoutApiImpl.js +172 -0
  66. package/src/Api/Implementation/PredicateApiImpl.js +1 -1
  67. package/src/Api/Implementation/SmartEditApiImpl.d.ts +3 -1
  68. package/src/Api/Implementation/SmartEditApiImpl.js +6 -0
  69. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +5 -3
  70. package/src/Api/Implementation/TeamSharingApiImpl.js +28 -10
  71. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +1 -1
  72. package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -4
  73. package/src/Api/InternalApi.d.ts +3 -2
  74. package/src/Api/LayoutApi.d.ts +88 -1
  75. package/src/Api/SmartEditApi.d.ts +8 -2
  76. package/src/Api/TeamSharingApi.d.ts +18 -5
  77. package/src/Api/UserInterfaceApi.d.ts +4 -4
  78. package/src/PredefinedConfig/AdaptableState.d.ts +0 -4
  79. package/src/PredefinedConfig/Common/AdaptableButton.d.ts +3 -3
  80. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +5 -1
  81. package/src/PredefinedConfig/Common/AdaptablePredicate.js +18 -1
  82. package/src/PredefinedConfig/{FilterState.d.ts → Common/ColumnFilter.d.ts} +2 -33
  83. package/src/PredefinedConfig/Common/ColumnFilter.js +2 -0
  84. package/src/PredefinedConfig/Common/Enums.d.ts +2 -2
  85. package/src/PredefinedConfig/Common/Enums.js +1 -1
  86. package/src/PredefinedConfig/Common/Types.d.ts +6 -5
  87. package/src/PredefinedConfig/Common/Types.js +2 -3
  88. package/src/PredefinedConfig/LayoutState.d.ts +5 -0
  89. package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -10
  90. package/src/PredefinedConfig/StatusBarState.d.ts +1 -2
  91. package/src/PredefinedConfig/SystemState.d.ts +3 -0
  92. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +47 -0
  93. package/src/Redux/ActionsReducers/LayoutRedux.js +135 -1
  94. package/src/Redux/ActionsReducers/SystemRedux.d.ts +22 -0
  95. package/src/Redux/ActionsReducers/SystemRedux.js +39 -1
  96. package/src/Redux/Store/AdaptableStore.js +37 -39
  97. package/src/Strategy/AlertModule.d.ts +11 -0
  98. package/src/Strategy/AlertModule.js +14 -0
  99. package/src/Strategy/CellSummaryModule.d.ts +3 -0
  100. package/src/Strategy/CellSummaryModule.js +28 -14
  101. package/src/Strategy/DataSetModule.d.ts +25 -0
  102. package/src/Strategy/DataSetModule.js +65 -0
  103. package/src/Strategy/ExportModule.js +6 -1
  104. package/src/Strategy/FilterModule.d.ts +7 -11
  105. package/src/Strategy/FilterModule.js +24 -15
  106. package/src/Strategy/FlashingCellModule.d.ts +1 -1
  107. package/src/Strategy/FlashingCellModule.js +2 -2
  108. package/src/Strategy/Interface/IModule.d.ts +3 -1
  109. package/src/Strategy/LayoutModule.js +24 -2
  110. package/src/Strategy/SmartEditModule.js +1 -1
  111. package/src/Strategy/StatusBarModule.js +1 -3
  112. package/src/Strategy/TeamSharingModule.js +1 -1
  113. package/src/Strategy/ToolPanelModule.js +1 -4
  114. package/src/Utilities/Constants/GeneralConstants.d.ts +6 -2
  115. package/src/Utilities/Constants/GeneralConstants.js +6 -2
  116. package/src/Utilities/Constants/ModuleConstants.d.ts +1 -1
  117. package/src/Utilities/Constants/ModuleConstants.js +2 -2
  118. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +15 -15
  119. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
  120. package/src/Utilities/Helpers/AdaptableHelper.js +3 -1
  121. package/src/Utilities/ObjectFactory.d.ts +3 -6
  122. package/src/Utilities/ObjectFactory.js +3 -7
  123. package/src/Utilities/Services/EntitlementService.js +7 -1
  124. package/src/Utilities/Services/ModuleService.js +1 -1
  125. package/src/Utilities/Services/ReportService.js +2 -3
  126. package/src/Utilities/Services/TeamSharingService.js +4 -4
  127. package/src/View/AdaptablePopover/index.d.ts +1 -0
  128. package/src/View/AdaptablePopover/index.js +5 -6
  129. package/src/View/AdaptableView.js +1 -1
  130. package/src/View/AdaptableViewFactory.js +2 -2
  131. package/src/View/Alert/ActiveAlertsPanel.d.ts +2 -0
  132. package/src/View/Alert/ActiveAlertsPanel.js +15 -0
  133. package/src/View/Alert/AlertStatusSubPanel.js +3 -8
  134. package/src/View/Alert/AlertViewPanel.js +2 -2
  135. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +1 -1
  136. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +1 -1
  137. package/src/View/CellSummary/CellSummaryDetails.js +2 -2
  138. package/src/View/CellSummary/CellSummaryPopover.d.ts +2 -4
  139. package/src/View/CellSummary/CellSummaryPopover.js +3 -6
  140. package/src/View/CellSummary/CellSummaryPopup.js +8 -0
  141. package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -1
  142. package/src/View/CellSummary/CellSummaryStatusPanel.js +2 -2
  143. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  144. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +18 -8
  145. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -2
  146. package/src/View/Components/ExternalRenderer.d.ts +3 -6
  147. package/src/View/Components/ExternalRenderer.js +5 -5
  148. package/src/View/Components/FilterForm/FilterForm.d.ts +1 -1
  149. package/src/View/Components/FilterForm/FilterForm.js +9 -7
  150. package/src/View/Components/FilterForm/QuickFilterForm.d.ts +1 -1
  151. package/src/View/Components/FilterForm/QuickFilterForm.js +6 -5
  152. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +1 -1
  153. package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +0 -2
  154. package/src/View/Components/Popups/AdaptablePopupAlert.js +13 -11
  155. package/src/View/Components/Popups/AdaptableToaster.js +29 -9
  156. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -2
  157. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +11 -9
  158. package/src/View/Dashboard/CustomDashboardButton.d.ts +11 -0
  159. package/src/View/Dashboard/CustomDashboardButton.js +47 -0
  160. package/src/View/Dashboard/CustomToolbarWrapper.d.ts +1 -0
  161. package/src/View/Dashboard/CustomToolbarWrapper.js +30 -11
  162. package/src/View/Dashboard/Dashboard.d.ts +1 -0
  163. package/src/View/Dashboard/Dashboard.js +8 -34
  164. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +19 -36
  165. package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +3 -0
  166. package/src/View/DataChangeHistory/buildActionColumnButton.js +70 -0
  167. package/src/View/DataSet/DataSetSelector.d.ts +7 -0
  168. package/src/View/DataSet/DataSetSelector.js +18 -0
  169. package/src/View/DataSet/DataSetStatusPanelPopover.d.ts +2 -0
  170. package/src/View/DataSet/DataSetStatusPanelPopover.js +19 -0
  171. package/src/View/DataSet/DataSetViewPanel.d.ts +19 -0
  172. package/src/View/DataSet/DataSetViewPanel.js +58 -0
  173. package/src/View/Filter/ActiveFiltersPanel.js +1 -1
  174. package/src/View/Filter/FilterSummary.d.ts +5 -5
  175. package/src/View/Filter/FilterSummary.js +6 -5
  176. package/src/View/Filter/FilterViewPanel.d.ts +4 -4
  177. package/src/View/Filter/FilterViewPanel.js +11 -14
  178. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
  179. package/src/View/GridInfo/GridInfoPopup.js +1 -1
  180. package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +6 -24
  181. package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
  182. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
  183. package/src/View/SmartEdit/SmartEditPopup.js +2 -2
  184. package/src/View/SmartEdit/SmartEditViewPanel.js +2 -2
  185. package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
  186. package/src/View/StatusBar/AdaptableStatusBar.js +1 -1
  187. package/src/View/StatusBar/StatusBarPanel.d.ts +1 -0
  188. package/src/View/StatusBar/StatusBarPanel.js +5 -4
  189. package/src/View/Theme/ThemeStatusPanelPopover.js +5 -25
  190. package/src/View/UIHelper.d.ts +4 -4
  191. package/src/View/UIHelper.js +4 -4
  192. package/src/agGrid/ActionColumnRenderer.js +3 -2
  193. package/src/agGrid/Adaptable.d.ts +4 -2
  194. package/src/agGrid/Adaptable.js +79 -52
  195. package/src/agGrid/FilterWrapper.js +1 -1
  196. package/src/agGrid/agGridHelper.d.ts +6 -6
  197. package/src/agGrid/agGridHelper.js +34 -56
  198. package/src/agGrid/agGridMenuHelper.js +4 -1
  199. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -2
  200. package/src/components/Dashboard/DashboardToolbar.js +2 -2
  201. package/src/components/SelectList.d.ts +10 -0
  202. package/src/components/SelectList.js +9 -0
  203. package/src/components/icons/{data-source.d.ts → data-set.d.ts} +0 -0
  204. package/src/components/icons/{data-source.js → data-set.js} +0 -0
  205. package/src/components/icons/index.js +2 -2
  206. package/src/metamodel/adaptable.metamodel.d.ts +162 -77
  207. package/src/metamodel/adaptable.metamodel.js +422 -375
  208. package/src/types.d.ts +15 -12
  209. package/version.d.ts +1 -1
  210. package/version.js +1 -1
  211. package/src/AdaptableOptions/FormatColumnOptions.d.ts +0 -10
  212. package/src/Api/DataSourceApi.d.ts +0 -58
  213. package/src/Api/Implementation/DataSourceApiImpl.d.ts +0 -15
  214. package/src/Api/Implementation/DataSourceApiImpl.js +0 -51
  215. package/src/PredefinedConfig/DataSourceState.d.ts +0 -34
  216. package/src/Redux/ActionsReducers/DataSourceRedux.d.ts +0 -42
  217. package/src/Redux/ActionsReducers/DataSourceRedux.js +0 -76
  218. package/src/Redux/ActionsReducers/FilterRedux.d.ts +0 -70
  219. package/src/Redux/ActionsReducers/FilterRedux.js +0 -126
  220. package/src/Strategy/DataSourceModule.d.ts +0 -20
  221. package/src/Strategy/DataSourceModule.js +0 -56
  222. package/src/View/DataSource/DataSourceViewPanel.d.ts +0 -19
  223. package/src/View/DataSource/DataSourceViewPanel.js +0 -69
  224. package/src/View/DataSource/Wizard/DataSourceSettingsSummary.d.ts +0 -2
  225. package/src/View/DataSource/Wizard/DataSourceSettingsSummary.js +0 -17
  226. package/src/View/DataSource/Wizard/DataSourceSettingsWizard.d.ts +0 -8
  227. package/src/View/DataSource/Wizard/DataSourceSettingsWizard.js +0 -42
  228. package/src/View/DataSource/Wizard/DataSourceWizard.d.ts +0 -8
  229. package/src/View/DataSource/Wizard/DataSourceWizard.js +0 -53
@@ -53,7 +53,7 @@ exports.AlertPreview = (_a) => {
53
53
  return result;
54
54
  }, [alertDefinition]);
55
55
  return (React.createElement(rebass_1.Box, Object.assign({}, boxProps, { style: Object.assign({ border: '1px solid var(--ab-color-inputborder)' }, boxProps.style) }),
56
- React.createElement(AdaptablePopupAlert_1.AdaptablePopupAlert, { headless: true, focusFirstButton: focusFirstButton, adaptableAlert: alertToPreview, api: api, onClose: () => { } })));
56
+ React.createElement(AdaptablePopupAlert_1.AdaptablePopupAlert, { headless: true, focusFirstButton: focusFirstButton, adaptableAlert: alertToPreview, onClose: () => { } })));
57
57
  };
58
58
  exports.AlertDisplayWizardSection = (props) => {
59
59
  var _a, _b, _c, _d;
@@ -59,7 +59,7 @@ class BulkUpdateViewPanelComponent extends React.Component {
59
59
  !shouldDisable && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue) && (React.createElement(ButtonApply_1.ButtonApply, { marginLeft: 2, className: `ab-${elementType}__BulkUpdate__apply`, onClick: () => this.onApplyClick(), style: applyStyle, tooltip: "Apply Bulk Update", disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
60
60
  (this.props.PreviewInfo != null &&
61
61
  this.props.PreviewInfo.previewValidationSummary.validationResult == 'All'), accessLevel: this.props.accessLevel }, this.props.viewType === 'ToolPanel' && 'Update')),
62
- !shouldDisable && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue) && (React.createElement(AdaptablePopover_1.AdaptablePopover, { className: `ab-${elementType}__BulkUpdate__info`, headerText: "Preview Results", bodyText: [previewPanel], MessageType: UIHelper_1.UIHelper.getMessageTypeByStatusColour(statusColour), useButton: true, showEvent: 'focus', hideEvent: "blur" })))));
62
+ !shouldDisable && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue) && (React.createElement(AdaptablePopover_1.AdaptablePopover, { popoverMinWidth: 360, className: `ab-${elementType}__BulkUpdate__info`, headerText: "Preview Results", bodyText: [previewPanel], MessageType: UIHelper_1.UIHelper.getMessageTypeByStatusColour(statusColour), useButton: true, showEvent: 'focus', hideEvent: "blur" })))));
63
63
  }
64
64
  onColumnValueSelectedChanged(selectedColumnValue) {
65
65
  this.props.onBulkUpdateValueChange(selectedColumnValue);
@@ -12,8 +12,8 @@ const columnsMap = new Map([
12
12
  const tableDOMProps = {
13
13
  style: {
14
14
  height: '100%',
15
- minWidth: '15rem',
16
- minHeight: '20rem',
15
+ minWidth: '20rem',
16
+ minHeight: 380,
17
17
  },
18
18
  };
19
19
  class CellSummaryDetails extends React.Component {
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { CellSummmary } from '../../PredefinedConfig/Common/CellSummary';
3
- export interface CellSummaryPopoverProps extends React.ClassAttributes<CellSummaryPopover> {
3
+ export interface CellSummaryPopoverProps {
4
4
  CellSummary: CellSummmary;
5
5
  }
6
- export declare class CellSummaryPopover extends React.Component<CellSummaryPopoverProps, {}> {
7
- render(): any;
8
- }
6
+ export declare const CellSummaryPopover: React.FunctionComponent<CellSummaryPopoverProps>;
@@ -4,9 +4,6 @@ exports.CellSummaryPopover = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const CellSummaryDetails_1 = require("./CellSummaryDetails");
7
- class CellSummaryPopover extends React.Component {
8
- render() {
9
- return React.createElement(CellSummaryDetails_1.CellSummaryDetails, { CellSummary: this.props.CellSummary });
10
- }
11
- }
12
- exports.CellSummaryPopover = CellSummaryPopover;
7
+ exports.CellSummaryPopover = (props) => {
8
+ return React.createElement(CellSummaryDetails_1.CellSummaryDetails, { CellSummary: props.CellSummary });
9
+ };
@@ -9,6 +9,14 @@ const CellSummaryDetails_1 = require("./CellSummaryDetails");
9
9
  const PanelWithButton_1 = require("../Components/Panels/PanelWithButton");
10
10
  class CellSummaryPopupComponent extends React.Component {
11
11
  componentDidMount() {
12
+ var _a, _b, _c;
13
+ if (((_a = this.props.popupParams) === null || _a === void 0 ? void 0 : _a.source) === 'ColumnMenu' && ((_b = this.props.popupParams) === null || _b === void 0 ? void 0 : _b.column)) {
14
+ // if the summary was requested from the column menu, we need to select the entire column
15
+ // afterwards, we will go on with the cell summary logic, as that will evaluate the current(column) cell selection
16
+ this.props.api.columnApi.selectColumn((_c = this.props.popupParams) === null || _c === void 0 ? void 0 : _c.column.columnId);
17
+ // we also need to update the internal state of the selected cells
18
+ this.props.api.internalApi.getAdaptableInstance().setSelectedCells();
19
+ }
12
20
  this.props.onCreateCellSummary();
13
21
  }
14
22
  render() {
@@ -11,5 +11,5 @@ exports.CellSummaryStatusBarSubPanelPopover = () => {
11
11
  return cellSummary && cellSummary.Count ? (summary) : (
12
12
  // the extra wrapper is added because the empty text is rendered
13
13
  // inside a EmptyContent, hat has position absolute
14
- React.createElement("div", { style: { position: 'relative', width: 200, height: 80 } }, summary));
14
+ React.createElement("div", { style: { position: 'relative', width: '100%', height: 80 } }, summary));
15
15
  };
@@ -14,7 +14,7 @@ exports.CellSummaryStatusPanel = () => {
14
14
  const adaptable = AdaptableContext_1.useAdaptable();
15
15
  const dispatch = react_redux_1.useDispatch();
16
16
  const cellSummaryApi = adaptable.api.cellSummaryApi;
17
- const cellSummaryModule = adaptable.ModuleService.getModuleById(ModuleConstants.CellSummaryModuleId);
17
+ const module = adaptable.ModuleService.getModuleById(ModuleConstants.CellSummaryModuleId);
18
18
  const text = `${cellSummaryApi.getCurrentCellSummaryOperation()}: ${(_a = cellSummaryApi.getCurrentCellSummaryOperationValue()) !== null && _a !== void 0 ? _a : 'N/A'}`;
19
19
  const onAction = () => {
20
20
  adaptable.api.cellSummaryApi.showCellSummaryPopup();
@@ -32,5 +32,5 @@ exports.CellSummaryStatusPanel = () => {
32
32
  checkSelectedCells();
33
33
  return () => cleanupEvent === null || cleanupEvent === void 0 ? void 0 : cleanupEvent();
34
34
  }, []);
35
- return (React.createElement(StatusBarPanel_1.StatusBarPanel, { icon: cellSummaryModule.moduleInfo.Glyph, onAction: onAction, content: text, popover: CellSummaryStatusBarSubPanelPopover_1.CellSummaryStatusBarSubPanelPopover }));
35
+ return (React.createElement(StatusBarPanel_1.StatusBarPanel, { tooltip: module.moduleInfo.ModuleName, "data-name": module.moduleInfo.ModuleName, icon: module.moduleInfo.Glyph, onAction: onAction, content: text, popover: CellSummaryStatusBarSubPanelPopover_1.CellSummaryStatusBarSubPanelPopover, popoverMinWidth: 360 }));
36
36
  };
@@ -67,7 +67,7 @@ class CellSummaryViewPanelComponent extends React.Component {
67
67
  React.createElement(DropdownButton_1.default, { style: { fontSize: 'small', width: '100%' }, marginRight: 2, columns: ['label'], className: `ab-${elementType}__CellSummary__select`, items: [...operationMenuItems, ...operationDefinitions], disabled: shouldDisable, variant: "outlined", tone: 'neutral' }, this.props.CellSummaryOperation)),
68
68
  React.createElement(rebass_1.Flex, { alignItems: "center" }, React.createElement(React.Fragment, null,
69
69
  renderOperationValue(),
70
- this.props.CellSummary != null && this.props.CellSummary.Count > 0 && (React.createElement(AdaptablePopover_1.AdaptablePopover, { className: "ab-ToolPanel__CellSummary__info", bodyText: [cellSummaryPopover], useButton: true, showEvent: 'focus', hideEvent: "blur" }))))));
70
+ this.props.CellSummary != null && this.props.CellSummary.Count > 0 && (React.createElement(AdaptablePopover_1.AdaptablePopover, { popoverMaxWidth: 360, className: "ab-ToolPanel__CellSummary__info", bodyText: [cellSummaryPopover], useButton: true, showEvent: 'focus', hideEvent: "blur" }))))));
71
71
  }
72
72
  checkSelectedCells() {
73
73
  this.props.onCreateCellSummary();
@@ -11,31 +11,41 @@ const ValueSelector_1 = require("../ValueSelector");
11
11
  const baseClassName = 'ab-Adaptable-Object-Compact-List';
12
12
  const ICON_SIZE = 20;
13
13
  exports.AdaptableObjectCompactListItem = (props) => {
14
- var _a, _b, _c, _d, _e, _f, _g;
14
+ var _a, _b, _c, _d, _e, _f, _g, _h;
15
15
  const dispatch = react_redux_1.useDispatch();
16
16
  const adaptable = AdaptableContext_1.useAdaptable();
17
17
  const objectView = props.module.toViewCompact(props.abObject);
18
18
  const viewOptions = (_b = (_a = props.module) === null || _a === void 0 ? void 0 : _a.getViewProperties) === null || _b === void 0 ? void 0 : _b.call(_a);
19
- const deleteAction = (_c = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getDeleteAction) === null || _c === void 0 ? void 0 : _c.call(viewOptions, props.abObject);
19
+ const deleteAction = (_c = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getCompactDeleteAction) === null || _c === void 0 ? void 0 : _c.call(viewOptions, props.abObject);
20
20
  const moduleAccessLevel = adaptable.api.internalApi
21
21
  .getEntitlementService()
22
22
  .getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
23
23
  const handleDelete = React.useCallback(() => {
24
24
  dispatch(deleteAction);
25
25
  }, []);
26
+ const name = (_d = objectView.item.label) !== null && _d !== void 0 ? _d : objectView.item.name;
26
27
  return (React.createElement(rebass_1.Flex, { className: `${baseClassName}__Item`, alignItems: "center" },
27
- React.createElement(rebass_1.Flex, { className: `${baseClassName}__Item__Name` }, (_d = objectView.item.label) !== null && _d !== void 0 ? _d : objectView.item.name),
28
+ name && (React.createElement(rebass_1.Flex, { className: `${baseClassName}__Item__Name` }, (_e = objectView.item.label) !== null && _e !== void 0 ? _e : objectView.item.name)),
28
29
  React.createElement(rebass_1.Box, { flex: 1 },
29
30
  objectView.item.view &&
30
31
  React.createElement(objectView.item.view, {
31
32
  data: props.abObject,
32
33
  }),
33
- Boolean(((_e = objectView.item) === null || _e === void 0 ? void 0 : _e.values) && ((_g = (_f = objectView.item) === null || _f === void 0 ? void 0 : _f.values) === null || _g === void 0 ? void 0 : _g.length)) && (React.createElement(rebass_1.Box, { mb: 2, className: `${baseClassName}__Item__Values` },
34
+ Boolean(((_f = objectView.item) === null || _f === void 0 ? void 0 : _f.values) && ((_h = (_g = objectView.item) === null || _g === void 0 ? void 0 : _g.values) === null || _h === void 0 ? void 0 : _h.length)) && (React.createElement(rebass_1.Box, { mb: 2, className: `${baseClassName}__Item__Values` },
34
35
  React.createElement(ValueSelector_1.ValueOptionsTags, { style: { marginRight: 0 }, readOnly: true, options: objectView.item.values, value: objectView.item.values, allowWrap: true, toIdentifier: (c) => c, toLabel: (c) => React.createElement(React.Fragment, null, c) })))),
35
- React.createElement(rebass_1.Flex, null, deleteAction && (React.createElement(SimpleButton_1.default, { iconSize: ICON_SIZE, icon: "delete", variant: "text", onClick: handleDelete, accessLevel: moduleAccessLevel })))));
36
+ React.createElement(rebass_1.Flex, { ml: 1 }, deleteAction && (React.createElement(SimpleButton_1.default, { iconSize: ICON_SIZE, icon: "delete", variant: "text", onClick: handleDelete, accessLevel: moduleAccessLevel })))));
36
37
  };
37
38
  exports.AdaptableObjectCompactList = (props) => {
38
- return (React.createElement("div", { className: baseClassName }, props.abObjects.map((abObject) => {
39
- return (React.createElement(exports.AdaptableObjectCompactListItem, { key: abObject.Uuid, abObject: abObject, module: props.module }));
40
- })));
39
+ var _a, _b, _c;
40
+ const viewProperties = (_b = (_a = props.module).getViewProperties) === null || _b === void 0 ? void 0 : _b.call(_a);
41
+ const deleteAllAction = (_c = viewProperties === null || viewProperties === void 0 ? void 0 : viewProperties.getDeleteAllAction) === null || _c === void 0 ? void 0 : _c.call(viewProperties);
42
+ const dispatch = react_redux_1.useDispatch();
43
+ return (React.createElement(rebass_1.Flex, { flexDirection: "column", className: baseClassName },
44
+ React.createElement(rebass_1.Flex, { className: `${baseClassName}__Header`, fontSize: 3 },
45
+ React.createElement(rebass_1.Box, { className: `${baseClassName}__Title` }, props.module.moduleInfo.FriendlyName),
46
+ React.createElement(rebass_1.Box, { flex: 1 }),
47
+ deleteAllAction && (React.createElement(SimpleButton_1.default, { onClick: () => dispatch(deleteAllAction), variant: "raised", tone: "neutral", accessLevel: 'Full' }, "Clear All"))),
48
+ React.createElement(rebass_1.Box, { className: `${baseClassName}__Body` }, props.abObjects.map((abObject) => {
49
+ return (React.createElement(exports.AdaptableObjectCompactListItem, { key: abObject.Uuid, abObject: abObject, module: props.module }));
50
+ }))));
41
51
  };
@@ -7,7 +7,6 @@ const react_redux_1 = require("react-redux");
7
7
  const rebass_1 = require("rebass");
8
8
  const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
9
9
  const join_1 = tslib_1.__importDefault(require("../../../components/utils/join"));
10
- const TeamSharingRedux_1 = require("../../../Redux/ActionsReducers/TeamSharingRedux");
11
10
  const AdaptableHelper_1 = tslib_1.__importDefault(require("../../../Utilities/Helpers/AdaptableHelper"));
12
11
  const AdaptableContext_1 = require("../../AdaptableContext");
13
12
  const ButtonDelete_1 = require("../Buttons/ButtonDelete");
@@ -76,7 +75,7 @@ exports.AdaptableObjectListItem = (props) => {
76
75
  React.createElement(rebass_1.Flex, { flexDirection: "column", className: `${baseClassName}__buttons` },
77
76
  React.createElement(rebass_1.Flex, { justifyContent: "end" },
78
77
  actions,
79
- teamSharingActivated && (React.createElement(ButtonShare_1.ButtonShare, { iconSize: ICON_SIZE, Header: `TeamSharing ${entityType}`, accessLevel: accessLevel, onShare: (config) => dispatch(TeamSharingRedux_1.TeamSharingShare(props.data.abObject, props.module.moduleInfo.ModuleName, config)) })),
78
+ teamSharingActivated && (React.createElement(ButtonShare_1.ButtonShare, { iconSize: ICON_SIZE, Header: `TeamSharing ${entityType}`, accessLevel: accessLevel, onShare: (config) => adaptable.api.teamSharingApi.shareEntity(props.data.abObject, props.module.moduleInfo.ModuleName, config) })),
80
79
  deleteAction && (React.createElement(ButtonDelete_1.ButtonDelete, { iconSize: ICON_SIZE, ConfirmationMsg: `Are you sure you want to delete this ${entityType}?`, ConfirmationTitle: `Delete ${entityType}`, ConfirmAction: deleteAction, accessLevel: accessLevel })),
81
80
  React.createElement(ButtonEdit_1.ButtonEdit, { iconSize: ICON_SIZE, disabled: isEditDisabled, accessLevel: accessLevel, onClick: () => handleOnEdit() })),
82
81
  React.createElement(rebass_1.Box, { flex: 1 }),
@@ -1,10 +1,7 @@
1
1
  import * as React from 'react';
2
- import { AdaptableApi, AdaptableFrameworkComponent } from '../../types';
3
- declare type Render = ({ visible, node, adaptableApi, }: {
4
- visible: boolean;
5
- node: HTMLDivElement;
6
- adaptableApi: AdaptableApi;
7
- }) => string | null;
2
+ import { CustomRenderContext } from '../../../types';
3
+ import { AdaptableFrameworkComponent } from '../../types';
4
+ declare type Render = (customRenderContext: CustomRenderContext) => string | null;
8
5
  interface ExternalRendererProps {
9
6
  componentName?: string;
10
7
  render?: Render;
@@ -10,21 +10,21 @@ exports.ExternalRenderer = (_a) => {
10
10
  const adaptable = AdaptableContext_1.useAdaptable();
11
11
  const [contentsHTML, setContentsHTML] = React.useState('');
12
12
  React.useLayoutEffect(() => {
13
- const node = ref.current;
13
+ const element = ref.current;
14
14
  const adaptableApi = adaptable.api;
15
15
  if (render) {
16
- const html = render({ visible: true, node, adaptableApi });
16
+ const html = render({ visible: true, element, adaptableApi });
17
17
  setContentsHTML(html);
18
18
  }
19
19
  else if (frameworkComponent) {
20
- adaptableApi.internalApi.createFrameworkComponent(node, frameworkComponent, 'toolbar');
20
+ adaptableApi.internalApi.createFrameworkComponent(element, frameworkComponent, 'toolbar');
21
21
  }
22
22
  return () => {
23
23
  if (render) {
24
- render({ visible: false, node, adaptableApi });
24
+ render({ visible: false, element: element, adaptableApi });
25
25
  }
26
26
  else if (frameworkComponent) {
27
- adaptableApi.internalApi.destroyFrameworkComponent(node, frameworkComponent, componentName);
27
+ adaptableApi.internalApi.destroyFrameworkComponent(element, frameworkComponent, componentName);
28
28
  }
29
29
  };
30
30
  }, []);
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ColumnFilterContext } from '../../../Utilities/Interface/ColumnFilterContext';
3
3
  import { ColumnMenuTab } from '../../../PredefinedConfig/Common/Enums';
4
- import { ColumnFilter } from '../../../PredefinedConfig/FilterState';
4
+ import { ColumnFilter } from '../../../types';
5
5
  export interface FilterFormState {
6
6
  columnFilters: ColumnFilter[];
7
7
  distinctColumnValues: {
@@ -4,7 +4,8 @@ exports.FilterFormReact = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const react_redux_1 = require("react-redux");
7
- const FilterRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/FilterRedux"));
7
+ const LayoutRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/LayoutRedux"));
8
+ const SystemRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/SystemRedux"));
8
9
  const Enums_1 = require("../../../PredefinedConfig/Common/Enums");
9
10
  const ListBoxFilterForm_1 = require("./ListBoxFilterForm");
10
11
  const ButtonClose_1 = require("../Buttons/ButtonClose");
@@ -22,6 +23,7 @@ const renderWithAdaptableContext_1 = require("../../renderWithAdaptableContext")
22
23
  const CheckBox_1 = require("../../../components/CheckBox");
23
24
  const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
24
25
  const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredicate");
26
+ const LayoutRedux_1 = require("../../../Redux/ActionsReducers/LayoutRedux");
25
27
  const panelStyle = {
26
28
  width: '100%',
27
29
  minWidth: 150,
@@ -264,18 +266,18 @@ function mapStateToProps(state, ownProps) {
264
266
  return {
265
267
  currentColumn: ownProps.currentColumn,
266
268
  columns: state.Grid.Columns,
267
- columnFilters: state.Filter.ColumnFilters,
269
+ columnFilters: LayoutRedux_1.getColumnFilterSelector(state),
268
270
  showCloseButton: ownProps.showCloseButton,
269
271
  };
270
272
  }
271
273
  function mapDispatchToProps(dispatch) {
272
274
  return {
273
275
  onMenuItemClick: (action) => dispatch(action),
274
- onClearColumnFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterClear(columnFilter)),
275
- onAddColumnFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterAdd(columnFilter)),
276
- onEditColumnFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterEdit(columnFilter)),
277
- onSetColumnFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterSet(columnFilter)),
278
- onHideFilterForm: () => dispatch(FilterRedux.FilterFormHide()),
276
+ onClearColumnFilter: (columnFilter) => dispatch(LayoutRedux.LayoutColumnFilterClear(columnFilter)),
277
+ onAddColumnFilter: (columnFilter) => dispatch(LayoutRedux.LayoutColumnFilterAdd(columnFilter)),
278
+ onEditColumnFilter: (columnFilter) => dispatch(LayoutRedux.LayoutColumnFilterEdit(columnFilter)),
279
+ onSetColumnFilter: (columnFilter) => dispatch(LayoutRedux.LayoutColumnFilterSet(columnFilter)),
280
+ onHideFilterForm: () => dispatch(SystemRedux.SystemFilterFormHide()),
279
281
  };
280
282
  }
281
283
  const FilterForm = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(FilterFormComponent);
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ColumnFilterContext } from '../../../Utilities/Interface/ColumnFilterContext';
3
- import { ColumnFilter } from '../../../PredefinedConfig/FilterState';
3
+ import { ColumnFilter } from '../../../types';
4
4
  export interface QuickFilterFormState {
5
5
  filter: ColumnFilter;
6
6
  distinctColumnValues: any[];
@@ -4,7 +4,7 @@ exports.QuickFilterFormReact = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
7
- const FilterRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/FilterRedux"));
7
+ const LayoutRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/LayoutRedux"));
8
8
  const react_redux_1 = require("react-redux");
9
9
  const ObjectFactory_1 = require("../../../Utilities/ObjectFactory");
10
10
  const OverlayTrigger_1 = tslib_1.__importDefault(require("../../../components/OverlayTrigger"));
@@ -20,6 +20,7 @@ const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
20
20
  const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
21
21
  const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredicate");
22
22
  const date_fns_1 = require("date-fns");
23
+ const LayoutRedux_1 = require("../../../Redux/ActionsReducers/LayoutRedux");
23
24
  class QuickFilterFormComponent extends React.Component {
24
25
  constructor(props) {
25
26
  super(props);
@@ -320,7 +321,7 @@ class QuickFilterFormComponent extends React.Component {
320
321
  }
321
322
  clearFilter() {
322
323
  const { filter } = this.state;
323
- this.props.api.filterApi.clearColumnFilterByColumn(filter.ColumnId);
324
+ this.props.api.layoutApi.clearColumnFilterByColumn(filter.ColumnId);
324
325
  }
325
326
  hasValuesPredicate(predicate) {
326
327
  return (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'Values' || (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'ExcludeValues';
@@ -329,13 +330,13 @@ class QuickFilterFormComponent extends React.Component {
329
330
  function mapStateToProps(state, ownProps) {
330
331
  return {
331
332
  currentColumn: ownProps.currentColumn,
332
- columnFilters: state.Filter.ColumnFilters,
333
+ columnFilters: LayoutRedux_1.getColumnFilterSelector(state),
333
334
  };
334
335
  }
335
336
  function mapDispatchToProps(dispatch) {
336
337
  return {
337
- onAddColumnFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterAdd(columnFilter)),
338
- onEditColumnFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterEdit(columnFilter)),
338
+ onAddColumnFilter: (columnFilter) => dispatch(LayoutRedux.LayoutColumnFilterAdd(columnFilter)),
339
+ onEditColumnFilter: (columnFilter) => dispatch(LayoutRedux.LayoutColumnFilterEdit(columnFilter)),
339
340
  };
340
341
  }
341
342
  const QuickFilterForm = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(QuickFilterFormComponent);
@@ -1,3 +1,3 @@
1
1
  import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
2
- import { SystemFilterPredicateId } from '../../../PredefinedConfig/FilterState';
2
+ import { SystemFilterPredicateId } from '../../../types';
3
3
  export declare const getDefaultColumnFilterPredicate: (column: AdaptableColumn, defaultColumnFilter: "Before" | "After" | "Blanks" | "NonBlanks" | "Equals" | "NotEquals" | "GreaterThan" | "LessThan" | "Positive" | "Negative" | "Zero" | "Between" | "NotBetween" | "Is" | "IsNot" | "Contains" | "NotContains" | "StartsWith" | "EndsWith" | "Regex" | "Today" | "Yesterday" | "Tomorrow" | "ThisWeek" | "ThisMonth" | "ThisQuarter" | "ThisYear" | "InPast" | "InFuture" | "On" | "NotOn" | "NextWorkDay" | "LastWorkDay" | "True" | "False" | "Values" | "ExcludeValues" | "InRange" | "BooleanToggle" | ((column: AdaptableColumn) => SystemFilterPredicateId)) => SystemFilterPredicateId;
@@ -1,9 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { AdaptableAlert } from '../../../PredefinedConfig/Common/AdaptableAlert';
3
- import { AdaptableApi } from '../../../Api/AdaptableApi';
4
3
  export interface AdaptablePopupAlertProps {
5
4
  onClose: () => void;
6
- api: AdaptableApi;
7
5
  adaptableAlert: AdaptableAlert;
8
6
  headless?: boolean;
9
7
  focusFirstButton?: boolean;
@@ -43,7 +43,10 @@ exports.AdaptablePopupAlert = (props) => {
43
43
  };
44
44
  }, [JSON.stringify(formData), props.adaptableAlert]);
45
45
  const adaptableForm = React.useMemo(() => {
46
- return props.api.internalApi.getAdaptableFormFromAlertForm(props.adaptableAlert.alertDefinition.AlertForm || defaultForm, context, messageType);
46
+ if (api.isDestroyed()) {
47
+ return null;
48
+ }
49
+ return api.internalApi.getAdaptableFormFromAlertForm(props.adaptableAlert.alertDefinition.AlertForm || defaultForm, context, messageType);
47
50
  }, [props.adaptableAlert.alertDefinition.AlertForm, defaultForm, messageType, context]);
48
51
  const renderApplicationIcon = (icon) => {
49
52
  if (!icon) {
@@ -68,16 +71,15 @@ exports.AdaptablePopupAlert = (props) => {
68
71
  React.createElement("br", null))));
69
72
  })
70
73
  : msg),
71
- React.createElement(rebass_1.Box, { margin: 2 },
72
- React.createElement(AdaptableFormComponent_1.AdaptableFormComponent, { focusFirstButton: props.focusFirstButton, data: formData, formDef: adaptableForm, displayTitle: true, onChange: setFormData, api: props.api, context: context, onButtonClick: (button) => {
73
- props.onClose();
74
- // we want to give the current popup time to close
75
- // and we reopen with a delay in case this button action causes another popup
76
- setTimeout(() => {
77
- var _a;
78
- (_a = button.onClick) === null || _a === void 0 ? void 0 : _a.call(button, button, context);
79
- }, 20);
80
- } })))));
74
+ React.createElement(rebass_1.Box, { margin: 2 }, adaptableForm ? (React.createElement(AdaptableFormComponent_1.AdaptableFormComponent, { focusFirstButton: props.focusFirstButton, data: formData, formDef: adaptableForm, displayTitle: true, onChange: setFormData, api: api, context: context, onButtonClick: (button) => {
75
+ props.onClose();
76
+ // we want to give the current popup time to close
77
+ // and we reopen with a delay in case this button action causes another popup
78
+ setTimeout(() => {
79
+ var _a;
80
+ (_a = button.onClick) === null || _a === void 0 ? void 0 : _a.call(button, button, context);
81
+ }, 20);
82
+ } })) : null))));
81
83
  return props.headless ? (content) : (React.createElement(Dialog_1.default, { "data-name": `alert-popup alert-popup-${messageType.toLowerCase()}`, showCloseButton: false, isOpen: true, onDismiss: props.onClose, style: {
82
84
  minHeight: 'auto',
83
85
  minWidth: '20vw',
@@ -6,27 +6,47 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
7
7
  const AdaptablePopupAlert_1 = require("./AdaptablePopupAlert");
8
8
  const react_toastify_1 = require("react-toastify");
9
+ const apiInstances = new WeakMap();
10
+ const weakMapKeys = new Map();
9
11
  exports.showToast = (props) => {
10
12
  // we're doing this hack and not simply using props.api in order not to have a memory
11
13
  // leak where the api is still kept around in memory by the toaster
12
- let api = props.api;
13
- const off = api.eventApi.on('AdaptableDestroy', () => {
14
+ const adaptableOptions = props.api.internalApi.getAdaptableOptions();
15
+ const adaptableId = adaptableOptions.adaptableId;
16
+ let weakMapKey = weakMapKeys.get(adaptableId);
17
+ if (!weakMapKey) {
18
+ weakMapKeys.set(adaptableId, { adaptableId });
19
+ }
20
+ weakMapKey = weakMapKeys.get(adaptableId);
21
+ const off = props.api.eventApi.on('AdaptableDestroy', () => {
14
22
  react_toastify_1.toast.dismiss(); // remove all toasts
15
- api = null;
23
+ let weakMapKey = weakMapKeys.get(adaptableId);
24
+ if (weakMapKey) {
25
+ apiInstances.delete(weakMapKey);
26
+ weakMapKeys.delete(adaptableId);
27
+ }
16
28
  });
17
- const toastProps = ObjectFactory_1.default.CreateToastOptions(props.api.internalApi.getAdaptableOptions().notificationsOptions, {
29
+ apiInstances.set(weakMapKey, props.api);
30
+ const toastProps = ObjectFactory_1.default.CreateToastOptions(adaptableOptions.notificationsOptions, {
31
+ containerId: adaptableId,
18
32
  onClose: () => {
19
- if (api) {
33
+ const weakMapKey = weakMapKeys.get(adaptableId);
34
+ const adaptableApi = weakMapKey ? apiInstances.get(weakMapKey) : null;
35
+ if (adaptableApi) {
20
36
  off();
21
- if (!api.isDestroyed()) {
22
- api.internalApi.hidePopupAlert();
37
+ if (!adaptableApi.isDestroyed()) {
38
+ adaptableApi.internalApi.hidePopupAlert();
39
+ }
40
+ else {
41
+ apiInstances.delete(weakMapKey);
42
+ weakMapKeys.delete(adaptableId);
23
43
  }
24
44
  }
25
45
  },
26
46
  });
27
- const content = (React.createElement(AdaptablePopupAlert_1.AdaptablePopupAlert, Object.assign({ headless: true }, props, { onClose: () => {
47
+ const content = (React.createElement(AdaptablePopupAlert_1.AdaptablePopupAlert, { headless: true, adaptableAlert: props.adaptableAlert, onClose: () => {
28
48
  react_toastify_1.toast.dismiss(toastId);
29
- } })));
49
+ } }));
30
50
  let toastId;
31
51
  switch (props.adaptableAlert.alertDefinition.MessageType) {
32
52
  case 'Info':
@@ -155,11 +155,12 @@ const AdaptableToolPanelComponent = (props) => {
155
155
  width: 'var(--ab-cmp-simple-button__width)',
156
156
  },
157
157
  };
158
- const iconProps = button.icon && Object.assign({}, defaultIconProps, button.icon);
159
158
  const toolPanelContext = {
160
159
  adaptableApi: props.api,
161
160
  toolPanelState: props.api.toolPanelApi.getToolPanelState(),
162
161
  };
162
+ const buttonIcon = props.api.internalApi.getIconForButton(button, toolPanelContext);
163
+ const iconProps = buttonIcon && Object.assign({}, defaultIconProps, buttonIcon);
163
164
  let buttonStyle = props.api.internalApi.getStyleForButton(button, toolPanelContext);
164
165
  let buttonLabel = props.api.internalApi.getLabelForButton(button, toolPanelContext);
165
166
  let buttonTooltip = props.api.internalApi.getTooltipForButton(button, toolPanelContext);
@@ -171,7 +172,7 @@ const AdaptableToolPanelComponent = (props) => {
171
172
  const buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none';
172
173
  const uniqueKey = buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : uuid_1.createUuid();
173
174
  return (React.createElement(SimpleButton_1.default, { key: uniqueKey, variant: buttonVariant, tone: buttonTone, className: `ab-ToolPanel__Home__${kebabCase_1.default(buttonLabel)} ${(buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className) || ''}`, tooltip: buttonTooltip, disabled: disabled, onClick: () => button.onClick(button, toolPanelContext), accessLevel: 'Full' },
174
- button.icon ? React.createElement("img", Object.assign({}, iconProps)) : null,
175
+ buttonIcon ? React.createElement("img", Object.assign({}, iconProps)) : null,
175
176
  buttonLabel));
176
177
  });
177
178
  };
@@ -17,24 +17,25 @@ exports.CustomToolPanelContent = (props) => {
17
17
  const buttonsDivId = `ab-ToolPanel__${customToolPanel.name}__buttons`;
18
18
  const [contentsHTML, setContentsHTML] = react_1.useState('');
19
19
  react_1.useLayoutEffect(() => {
20
- const node = contentsDivDomRef.current;
20
+ const element = contentsDivDomRef.current;
21
21
  if (hasCustomRenderFn(customToolPanel)) {
22
- const html = customToolPanel.render({
22
+ const customRenderContext = {
23
23
  visible: true,
24
- node,
24
+ element,
25
25
  adaptableApi: api,
26
- });
26
+ };
27
+ const html = customToolPanel.render(customRenderContext);
27
28
  setContentsHTML(html);
28
29
  }
29
30
  else if (hasCustomFrameworkComponent(customToolPanel)) {
30
- api.internalApi.createFrameworkComponent(node, customToolPanel.frameworkComponent, 'toolPanel');
31
+ api.internalApi.createFrameworkComponent(element, customToolPanel.frameworkComponent, 'toolPanel');
31
32
  }
32
33
  return () => {
33
34
  if (hasCustomRenderFn(customToolPanel)) {
34
- customToolPanel.render({ visible: false, node, adaptableApi: api });
35
+ customToolPanel.render({ visible: false, element, adaptableApi: api });
35
36
  }
36
37
  else if (hasCustomFrameworkComponent(customToolPanel)) {
37
- api.internalApi.destroyFrameworkComponent(node, customToolPanel.frameworkComponent, 'toolPanel');
38
+ api.internalApi.destroyFrameworkComponent(element, customToolPanel.frameworkComponent, 'toolPanel');
38
39
  }
39
40
  };
40
41
  }, []);
@@ -50,12 +51,13 @@ exports.CustomToolPanelContent = (props) => {
50
51
  width: 'var(--ab-cmp-simple-button__width)',
51
52
  },
52
53
  };
53
- const iconProps = button.icon && Object.assign({}, defaultIconProps, button.icon);
54
54
  const toolPanelContext = {
55
55
  adaptableApi: api,
56
56
  toolPanelState: api.toolPanelApi.getToolPanelState(),
57
57
  customToolPanel: customToolPanel,
58
58
  };
59
+ const buttonIcon = api.internalApi.getIconForButton(button, toolPanelContext);
60
+ const iconProps = buttonIcon && Object.assign({}, defaultIconProps, buttonIcon);
59
61
  let buttonStyle = api.internalApi.getStyleForButton(button, toolPanelContext);
60
62
  let buttonLabel = api.internalApi.getLabelForButton(button, toolPanelContext);
61
63
  let buttonTooltip = api.internalApi.getTooltipForButton(button, toolPanelContext);
@@ -67,7 +69,7 @@ exports.CustomToolPanelContent = (props) => {
67
69
  const buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none';
68
70
  const uniqueKey = buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : uuid_1.createUuid();
69
71
  return (React.createElement(SimpleButton_1.default, { key: uniqueKey, variant: buttonVariant, tone: buttonTone, className: `ab-ToolPanel__Home__${kebabCase_1.default(buttonLabel)} ${(buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className) || ''}`, tooltip: buttonTooltip, disabled: disabled, onClick: () => button.onClick(button, toolPanelContext), accessLevel: 'Full' },
70
- button.icon ? React.createElement("img", Object.assign({}, iconProps)) : null,
72
+ buttonIcon ? React.createElement("img", Object.assign({}, iconProps)) : null,
71
73
  buttonLabel));
72
74
  })))));
73
75
  };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { AdaptableButton } from '../../PredefinedConfig/Common/AdaptableButton';
3
+ import { DashboardButtonContext } from '../../AdaptableOptions/DashboardOptions';
4
+ import { AdaptableApi } from '../../Api/AdaptableApi';
5
+ import { AccessLevel } from '../../PredefinedConfig/Common/Entitlement';
6
+ export interface CustomDashboardButtonProps {
7
+ button: AdaptableButton<DashboardButtonContext>;
8
+ api: AdaptableApi;
9
+ accessLevel: AccessLevel;
10
+ }
11
+ export declare const CustomDashboardButton: (props: CustomDashboardButtonProps) => JSX.Element;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomDashboardButton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const react_1 = require("react");
7
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
8
+ const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
9
+ exports.CustomDashboardButton = (props) => {
10
+ const { button } = props;
11
+ const [componentRevision, setComponentRevision] = react_1.useState(1);
12
+ // TODO: variants of this mapping are present in several places (just search for api.internalApi.getStyleForButton() usages)
13
+ // with the next opportunity we should abstract it
14
+ const dashboardContext = {
15
+ adaptableApi: props.api,
16
+ dashboardState: props.api.dashboardApi.getDashboardState(),
17
+ };
18
+ const defaultIconProps = {
19
+ style: {
20
+ height: 'var(--ab-cmp-simple-button__height)',
21
+ width: 'var(--ab-cmp-simple-button__width)',
22
+ },
23
+ };
24
+ const buttonIcon = props.api.internalApi.getIconForButton(button, dashboardContext);
25
+ const iconProps = buttonIcon && Object.assign({}, defaultIconProps, buttonIcon);
26
+ // const iconProps: any = button.icon ? { ...button.icon } : null;
27
+ // if (iconProps) {
28
+ // delete iconProps.Uuid;
29
+ // }
30
+ let buttonStyle = props.api.internalApi.getStyleForButton(button, dashboardContext);
31
+ let buttonLabel = props.api.internalApi.getLabelForButton(button, dashboardContext);
32
+ let buttonTooltip = props.api.internalApi.getTooltipForButton(button, dashboardContext);
33
+ if (button.hidden && button.hidden(button, dashboardContext)) {
34
+ return null;
35
+ }
36
+ const disabled = button.disabled && button.disabled(button, dashboardContext);
37
+ return (React.createElement(SimpleButton_1.default, { key: buttonLabel, variant: buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'text', tone: buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none', className: `ab-DashboardToolbar__Home__${kebabCase_1.default(buttonLabel)} ${(buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className) || ''}`, tooltip: buttonTooltip, disabled: disabled || props.accessLevel == 'ReadOnly', onClick: () => {
38
+ var _a;
39
+ (_a = button.onClick) === null || _a === void 0 ? void 0 : _a.call(button, button, dashboardContext);
40
+ setTimeout(() => {
41
+ // mutate state to force a re-rendering
42
+ setComponentRevision(componentRevision + 1);
43
+ }, 16);
44
+ }, accessLevel: 'Full' },
45
+ buttonIcon ? React.createElement("img", Object.assign({}, iconProps)) : null,
46
+ buttonLabel));
47
+ };
@@ -2,6 +2,7 @@
2
2
  import { CustomToolbar } from '../../AdaptableOptions/DashboardOptions';
3
3
  interface CustomToolbarWrapperProps {
4
4
  customToolbar: CustomToolbar;
5
+ dashboardRevision: number;
5
6
  }
6
7
  export declare const CustomToolbarWrapper: (props: CustomToolbarWrapperProps) => JSX.Element;
7
8
  export {};