@adaptabletools/adaptable 11.2.4-canary.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 (266) hide show
  1. package/base.css +22 -4
  2. package/bundle.cjs.js +111 -111
  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 +6 -1
  8. package/src/AdaptableOptions/ActionOptions.d.ts +1 -0
  9. package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.js → ActionOptions.js} +0 -0
  10. package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +5 -0
  11. package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -3
  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/{SmartEdit.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 +92 -4
  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/FinancePluginOptions.d.ts +33 -3
  23. package/src/AdaptableOptions/GeneralOptions.d.ts +22 -23
  24. package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.d.ts → MasterDetailPluginOptions.d.ts} +2 -4
  25. package/src/{Api/DataSourceApi.js → AdaptableOptions/MasterDetailPluginOptions.js} +0 -0
  26. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +3 -6
  27. package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -49
  28. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +81 -54
  29. package/src/Api/AdaptableApi.d.ts +6 -3
  30. package/src/Api/ColumnApi.d.ts +6 -3
  31. package/src/Api/ConditionalStyleApi.d.ts +10 -0
  32. package/src/Api/ConfigApi.d.ts +0 -12
  33. package/src/Api/DashboardApi.d.ts +6 -19
  34. package/src/Api/DataSetApi.d.ts +40 -0
  35. package/src/{PredefinedConfig/DataSourceState.js → Api/DataSetApi.js} +0 -0
  36. package/src/Api/EventApi.d.ts +18 -1
  37. package/src/Api/Events/DataSetChanged.d.ts +5 -0
  38. package/src/{PredefinedConfig/FilterState.js → Api/Events/DataSetChanged.js} +0 -0
  39. package/src/Api/Events/RowFormSubmitted.d.ts +19 -0
  40. package/src/Api/Events/RowFormSubmitted.js +2 -0
  41. package/src/Api/Events/SearchChanged.d.ts +3 -4
  42. package/src/Api/FilterApi.d.ts +1 -77
  43. package/src/Api/FinanceApi.d.ts +3 -2
  44. package/src/Api/FormatColumnApi.d.ts +28 -1
  45. package/src/Api/GridApi.d.ts +15 -1
  46. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
  47. package/src/Api/Implementation/AdaptableApiImpl.js +3 -3
  48. package/src/Api/Implementation/AlertApiImpl.js +5 -1
  49. package/src/Api/Implementation/ApiBase.d.ts +3 -0
  50. package/src/Api/Implementation/ApiBase.js +6 -0
  51. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
  52. package/src/Api/Implementation/ColumnApiImpl.js +6 -3
  53. package/src/Api/Implementation/ConditionalStyleApiImpl.d.ts +2 -0
  54. package/src/Api/Implementation/ConditionalStyleApiImpl.js +8 -0
  55. package/src/Api/Implementation/ConfigApiImpl.d.ts +0 -4
  56. package/src/Api/Implementation/ConfigApiImpl.js +2 -24
  57. package/src/Api/Implementation/DashboardApiImpl.d.ts +3 -6
  58. package/src/Api/Implementation/DashboardApiImpl.js +5 -29
  59. package/src/Api/Implementation/DataSetApiImpl.d.ts +12 -0
  60. package/src/Api/Implementation/DataSetApiImpl.js +42 -0
  61. package/src/Api/Implementation/EventApiImpl.js +1 -0
  62. package/src/Api/Implementation/FilterApiImpl.d.ts +1 -16
  63. package/src/Api/Implementation/FilterApiImpl.js +5 -164
  64. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +6 -0
  65. package/src/Api/Implementation/FormatColumnApiImpl.js +34 -0
  66. package/src/Api/Implementation/GridApiImpl.d.ts +4 -1
  67. package/src/Api/Implementation/GridApiImpl.js +41 -1
  68. package/src/Api/Implementation/InternalApiImpl.d.ts +7 -2
  69. package/src/Api/Implementation/InternalApiImpl.js +51 -10
  70. package/src/Api/Implementation/LayoutApiImpl.d.ts +18 -1
  71. package/src/Api/Implementation/LayoutApiImpl.js +172 -0
  72. package/src/Api/Implementation/PredicateApiImpl.js +1 -1
  73. package/src/Api/Implementation/SmartEditApiImpl.d.ts +5 -2
  74. package/src/Api/Implementation/SmartEditApiImpl.js +9 -0
  75. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +5 -3
  76. package/src/Api/Implementation/TeamSharingApiImpl.js +28 -10
  77. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +1 -1
  78. package/src/Api/Implementation/UserInterfaceApiImpl.js +7 -25
  79. package/src/Api/InternalApi.d.ts +6 -2
  80. package/src/Api/LayoutApi.d.ts +88 -1
  81. package/src/Api/SmartEditApi.d.ts +14 -3
  82. package/src/Api/TeamSharingApi.d.ts +18 -5
  83. package/src/Api/UserInterfaceApi.d.ts +4 -4
  84. package/src/PredefinedConfig/AdaptableState.d.ts +0 -4
  85. package/src/PredefinedConfig/CalculatedColumnState.d.ts +5 -0
  86. package/src/PredefinedConfig/Common/AdaptableButton.d.ts +3 -3
  87. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +5 -1
  88. package/src/PredefinedConfig/Common/AdaptableForm.d.ts +3 -2
  89. package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +6 -3
  90. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +2 -11
  91. package/src/PredefinedConfig/Common/AdaptablePredicate.js +35 -2
  92. package/src/PredefinedConfig/Common/BaseContext.d.ts +1 -1
  93. package/src/PredefinedConfig/{FilterState.d.ts → Common/ColumnFilter.d.ts} +2 -33
  94. package/src/PredefinedConfig/Common/ColumnFilter.js +2 -0
  95. package/src/PredefinedConfig/Common/Enums.d.ts +2 -2
  96. package/src/PredefinedConfig/Common/Enums.js +1 -1
  97. package/src/PredefinedConfig/Common/FDC3Context.d.ts +5 -1
  98. package/src/PredefinedConfig/Common/Types.d.ts +6 -5
  99. package/src/PredefinedConfig/Common/Types.js +2 -3
  100. package/src/PredefinedConfig/LayoutState.d.ts +5 -0
  101. package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -10
  102. package/src/PredefinedConfig/StatusBarState.d.ts +1 -2
  103. package/src/PredefinedConfig/SystemState.d.ts +4 -2
  104. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +47 -0
  105. package/src/Redux/ActionsReducers/LayoutRedux.js +135 -1
  106. package/src/Redux/ActionsReducers/SystemRedux.d.ts +23 -1
  107. package/src/Redux/ActionsReducers/SystemRedux.js +39 -1
  108. package/src/Redux/Store/AdaptableStore.js +37 -39
  109. package/src/Strategy/AlertModule.d.ts +11 -0
  110. package/src/Strategy/AlertModule.js +14 -0
  111. package/src/Strategy/CellSummaryModule.d.ts +3 -0
  112. package/src/Strategy/CellSummaryModule.js +28 -14
  113. package/src/Strategy/DataSetModule.d.ts +25 -0
  114. package/src/Strategy/DataSetModule.js +65 -0
  115. package/src/Strategy/ExportModule.js +6 -1
  116. package/src/Strategy/FilterModule.d.ts +7 -11
  117. package/src/Strategy/FilterModule.js +24 -15
  118. package/src/Strategy/FlashingCellModule.d.ts +1 -1
  119. package/src/Strategy/FlashingCellModule.js +2 -2
  120. package/src/Strategy/FormatColumnModule.js +1 -1
  121. package/src/Strategy/Interface/IModule.d.ts +3 -1
  122. package/src/Strategy/LayoutModule.js +24 -2
  123. package/src/Strategy/SmartEditModule.d.ts +1 -1
  124. package/src/Strategy/SmartEditModule.js +5 -6
  125. package/src/Strategy/StatusBarModule.js +1 -3
  126. package/src/Strategy/TeamSharingModule.js +1 -1
  127. package/src/Strategy/ToolPanelModule.js +1 -4
  128. package/src/Utilities/Constants/GeneralConstants.d.ts +6 -2
  129. package/src/Utilities/Constants/GeneralConstants.js +6 -2
  130. package/src/Utilities/Constants/ModuleConstants.d.ts +1 -1
  131. package/src/Utilities/Constants/ModuleConstants.js +2 -2
  132. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +22 -13
  133. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
  134. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +2 -4
  135. package/src/Utilities/Helpers/AdaptableHelper.js +4 -1
  136. package/src/Utilities/ObjectFactory.d.ts +3 -6
  137. package/src/Utilities/ObjectFactory.js +3 -7
  138. package/src/Utilities/Services/EntitlementService.js +7 -1
  139. package/src/Utilities/Services/Interface/IRowEditService.d.ts +8 -0
  140. package/src/Utilities/Services/Interface/IRowEditService.js +2 -0
  141. package/src/Utilities/Services/ModuleService.js +1 -1
  142. package/src/Utilities/Services/ReportService.js +2 -3
  143. package/src/Utilities/Services/RowEditService.d.ts +25 -0
  144. package/src/Utilities/Services/RowEditService.js +165 -0
  145. package/src/Utilities/Services/TeamSharingService.js +4 -4
  146. package/src/View/AdaptablePopover/index.d.ts +1 -0
  147. package/src/View/AdaptablePopover/index.js +5 -6
  148. package/src/View/AdaptableView.js +1 -1
  149. package/src/View/AdaptableViewFactory.js +2 -2
  150. package/src/View/Alert/ActiveAlertsPanel.d.ts +2 -0
  151. package/src/View/Alert/ActiveAlertsPanel.js +15 -0
  152. package/src/View/Alert/AlertStatusSubPanel.js +3 -8
  153. package/src/View/Alert/AlertViewPanel.js +2 -2
  154. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +1 -1
  155. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +1 -1
  156. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
  157. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +9 -2
  158. package/src/View/CellSummary/CellSummaryDetails.js +2 -2
  159. package/src/View/CellSummary/CellSummaryPopover.d.ts +2 -4
  160. package/src/View/CellSummary/CellSummaryPopover.js +3 -6
  161. package/src/View/CellSummary/CellSummaryPopup.js +8 -0
  162. package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -1
  163. package/src/View/CellSummary/CellSummaryStatusPanel.js +2 -2
  164. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  165. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +18 -8
  166. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -2
  167. package/src/View/Components/ExternalRenderer.d.ts +3 -6
  168. package/src/View/Components/ExternalRenderer.js +5 -5
  169. package/src/View/Components/FilterForm/FilterForm.d.ts +5 -2
  170. package/src/View/Components/FilterForm/FilterForm.js +9 -7
  171. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +4 -1
  172. package/src/View/Components/FilterForm/ListBoxFilterForm.js +7 -7
  173. package/src/View/Components/FilterForm/QuickFilterForm.d.ts +1 -1
  174. package/src/View/Components/FilterForm/QuickFilterForm.js +21 -7
  175. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +1 -1
  176. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +2 -0
  177. package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +0 -2
  178. package/src/View/Components/Popups/AdaptablePopupAlert.js +13 -11
  179. package/src/View/Components/Popups/AdaptableToaster.js +29 -9
  180. package/src/View/Components/Popups/FormPopups/FormPopups.js +2 -2
  181. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -2
  182. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +11 -9
  183. package/src/View/Dashboard/CustomDashboardButton.d.ts +11 -0
  184. package/src/View/Dashboard/CustomDashboardButton.js +47 -0
  185. package/src/View/Dashboard/CustomToolbarWrapper.d.ts +1 -0
  186. package/src/View/Dashboard/CustomToolbarWrapper.js +30 -11
  187. package/src/View/Dashboard/Dashboard.d.ts +1 -0
  188. package/src/View/Dashboard/Dashboard.js +8 -34
  189. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +19 -36
  190. package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +3 -0
  191. package/src/View/DataChangeHistory/buildActionColumnButton.js +70 -0
  192. package/src/View/DataSet/DataSetSelector.d.ts +7 -0
  193. package/src/View/DataSet/DataSetSelector.js +18 -0
  194. package/src/View/DataSet/DataSetStatusPanelPopover.d.ts +2 -0
  195. package/src/View/DataSet/DataSetStatusPanelPopover.js +19 -0
  196. package/src/View/DataSet/DataSetViewPanel.d.ts +19 -0
  197. package/src/View/DataSet/DataSetViewPanel.js +58 -0
  198. package/src/View/Filter/ActiveFiltersPanel.js +1 -1
  199. package/src/View/Filter/FilterSummary.d.ts +5 -5
  200. package/src/View/Filter/FilterSummary.js +6 -5
  201. package/src/View/Filter/FilterViewPanel.d.ts +4 -4
  202. package/src/View/Filter/FilterViewPanel.js +11 -14
  203. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +3 -2
  204. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +51 -22
  205. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +1 -1
  206. package/src/View/GridInfo/GridInfoPopup.js +1 -1
  207. package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +6 -24
  208. package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
  209. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +2 -1
  210. package/src/View/SmartEdit/SmartEditPopup.d.ts +1 -1
  211. package/src/View/SmartEdit/SmartEditPopup.js +3 -4
  212. package/src/View/SmartEdit/SmartEditViewPanel.d.ts +1 -1
  213. package/src/View/SmartEdit/SmartEditViewPanel.js +3 -4
  214. package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
  215. package/src/View/StatusBar/AdaptableStatusBar.js +1 -1
  216. package/src/View/StatusBar/StatusBarPanel.d.ts +1 -0
  217. package/src/View/StatusBar/StatusBarPanel.js +5 -4
  218. package/src/View/Theme/ThemeStatusPanelPopover.js +5 -25
  219. package/src/View/UIHelper.d.ts +4 -4
  220. package/src/View/UIHelper.js +4 -4
  221. package/src/agGrid/ActionColumnRenderer.d.ts +6 -1
  222. package/src/agGrid/ActionColumnRenderer.js +9 -6
  223. package/src/agGrid/Adaptable.d.ts +7 -2
  224. package/src/agGrid/Adaptable.js +217 -87
  225. package/src/agGrid/FilterWrapper.js +1 -1
  226. package/src/agGrid/agGridHelper.d.ts +6 -6
  227. package/src/agGrid/agGridHelper.js +34 -56
  228. package/src/agGrid/agGridMenuHelper.js +4 -1
  229. package/src/agGrid/rowEditIcons.d.ts +4 -0
  230. package/src/agGrid/rowEditIcons.js +9 -0
  231. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +9 -18
  232. package/src/components/Dashboard/DashboardToolbar.js +2 -2
  233. package/src/components/Datepicker/index.js +19 -18
  234. package/src/components/SelectList.d.ts +10 -0
  235. package/src/components/SelectList.js +9 -0
  236. package/src/components/WindowModal/WindowModal.d.ts +2 -0
  237. package/src/components/WindowModal/WindowModal.js +1 -1
  238. package/src/components/icons/{data-source.d.ts → data-set.d.ts} +0 -0
  239. package/src/components/icons/{data-source.js → data-set.js} +0 -0
  240. package/src/components/icons/index.js +2 -2
  241. package/src/metamodel/adaptable.metamodel.d.ts +242 -70
  242. package/src/metamodel/adaptable.metamodel.js +620 -376
  243. package/src/types.d.ts +19 -15
  244. package/version.d.ts +1 -1
  245. package/version.js +1 -1
  246. package/src/AdaptableOptions/SmartEdit.d.ts +0 -34
  247. package/src/Api/DataSourceApi.d.ts +0 -58
  248. package/src/Api/Implementation/DataSourceApiImpl.d.ts +0 -15
  249. package/src/Api/Implementation/DataSourceApiImpl.js +0 -51
  250. package/src/PredefinedConfig/DataSourceState.d.ts +0 -34
  251. package/src/Redux/ActionsReducers/DataSourceRedux.d.ts +0 -42
  252. package/src/Redux/ActionsReducers/DataSourceRedux.js +0 -76
  253. package/src/Redux/ActionsReducers/FilterRedux.d.ts +0 -70
  254. package/src/Redux/ActionsReducers/FilterRedux.js +0 -126
  255. package/src/Strategy/DataSourceModule.d.ts +0 -20
  256. package/src/Strategy/DataSourceModule.js +0 -56
  257. package/src/View/Components/Forms/AdaptableForm.d.ts +0 -6
  258. package/src/View/Components/Forms/AdaptableForm.js +0 -21
  259. package/src/View/DataSource/DataSourceViewPanel.d.ts +0 -19
  260. package/src/View/DataSource/DataSourceViewPanel.js +0 -69
  261. package/src/View/DataSource/Wizard/DataSourceSettingsSummary.d.ts +0 -2
  262. package/src/View/DataSource/Wizard/DataSourceSettingsSummary.js +0 -17
  263. package/src/View/DataSource/Wizard/DataSourceSettingsWizard.d.ts +0 -8
  264. package/src/View/DataSource/Wizard/DataSourceSettingsWizard.js +0 -42
  265. package/src/View/DataSource/Wizard/DataSourceWizard.d.ts +0 -8
  266. package/src/View/DataSource/Wizard/DataSourceWizard.js +0 -53
@@ -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, { 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,10 +1,13 @@
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
- distinctColumnValues: any[];
7
+ distinctColumnValues: {
8
+ label: string;
9
+ value: any;
10
+ }[];
8
11
  isDistinctColumnValuesLoading: boolean;
9
12
  showTab: boolean;
10
13
  selectedTab: ColumnMenuTab;
@@ -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);
@@ -5,7 +5,10 @@ export interface ListBoxFilterFormProps extends ListGroupProps {
5
5
  currentColumn: AdaptableColumn;
6
6
  columns: AdaptableColumn[];
7
7
  useAgGridStyle?: boolean;
8
- columnDistinctValues: any[];
8
+ columnDistinctValues: {
9
+ label: string;
10
+ value: any;
11
+ }[];
9
12
  uiSelectedColumnValues: Array<string>;
10
13
  onColumnValueSelectedChange: (SelectedValues: Array<any>) => void;
11
14
  dataType: 'String' | 'Number' | 'NumberArray' | 'Boolean' | 'Date' | 'Object' | 'Unknown';
@@ -40,9 +40,9 @@ exports.ListBoxFilterForm = (props) => {
40
40
  setUiSelectedColumnValues([...UiSelectedColumnValues, item]);
41
41
  }
42
42
  };
43
- const columnValuesItemsElements = props.columnDistinctValues.map((x, y) => {
44
- const isActive = UiSelectedColumnValues.indexOf(x) >= 0;
45
- const columnValue = x;
43
+ const columnValuesItemsElements = props.columnDistinctValues.map((distinctValue, index) => {
44
+ const isActive = UiSelectedColumnValues.indexOf(distinctValue.value) >= 0;
45
+ const columnValue = distinctValue.value;
46
46
  if (StringExtensions_1.StringExtensions.IsNullOrEmpty(columnValue)) {
47
47
  return null;
48
48
  }
@@ -53,13 +53,13 @@ exports.ListBoxFilterForm = (props) => {
53
53
  }
54
54
  if (props.useAgGridStyle) {
55
55
  return renderItemForAgGridStyle({
56
- key: 'columnValue' + y,
57
- children: columnValue,
56
+ key: 'columnValue' + index,
57
+ children: distinctValue.label,
58
58
  checked: isActive,
59
- onChange: () => onClickItemColumnValue(x),
59
+ onChange: () => onClickItemColumnValue(distinctValue.value),
60
60
  });
61
61
  }
62
- return (React.createElement(ListGroupItem_1.default, { noZebra: props.useAgGridStyle, key: 'columnValue' + y, onClick: () => onClickItemColumnValue(x), active: isActive, value: columnValue }, columnValue));
62
+ return (React.createElement(ListGroupItem_1.default, { noZebra: props.useAgGridStyle, key: 'columnValue' + index, onClick: () => onClickItemColumnValue(distinctValue.value), active: isActive, value: columnValue }, distinctValue.label));
63
63
  });
64
64
  const textClear = (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { autoFocus: true, type: "text", placeholder: "Search Column Values", value: FilterValue, style: {
65
65
  paddingTop: 'var(--ab-space-1)',
@@ -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"));
@@ -19,6 +19,8 @@ const CheckBox_1 = require("../../../components/CheckBox");
19
19
  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
+ const date_fns_1 = require("date-fns");
23
+ const LayoutRedux_1 = require("../../../Redux/ActionsReducers/LayoutRedux");
22
24
  class QuickFilterFormComponent extends React.Component {
23
25
  constructor(props) {
24
26
  super(props);
@@ -214,6 +216,19 @@ class QuickFilterFormComponent extends React.Component {
214
216
  if (this.props.quickFilterValuesTrigger === 'click') {
215
217
  showEvent = 'click';
216
218
  }
219
+ let selectedValues = filter.Predicate.PredicateId === 'Values' ? 'Select Values' : 'Exclude Values';
220
+ if (filter.Predicate.Inputs.length) {
221
+ selectedValues = filter.Predicate.Inputs.map((input) => {
222
+ var _a, _b;
223
+ const label = (_b = (_a = this.state.distinctColumnValues) === null || _a === void 0 ? void 0 : _a.find((distinctValue) => {
224
+ if (input instanceof Date) {
225
+ return date_fns_1.isSameDay(input, distinctValue.value);
226
+ }
227
+ return distinctValue.value === input;
228
+ })) === null || _b === void 0 ? void 0 : _b.label;
229
+ return label !== null && label !== void 0 ? label : input;
230
+ }).join(', ');
231
+ }
217
232
  return (React.createElement(OverlayTrigger_1.default, { alignHorizontal: "left", showEvent: showEvent,
218
233
  // cannot hide on blur, because the form input receives the input when this is opened
219
234
  hideEvent: "mouseleave", hideDelay: 300, ref: (api) => {
@@ -248,8 +263,7 @@ class QuickFilterFormComponent extends React.Component {
248
263
  borderRadius: 0,
249
264
  borderLeftWidth: 0,
250
265
  borderColor: 'var(--ab-color-primarydark)',
251
- }, disabled: ArrayExtensions_1.default.IsNullOrEmptyOrContainsSingleEmptyValue(this.state.distinctColumnValues) }, filter.Predicate.Inputs.join(', ') ||
252
- (filter.Predicate.PredicateId === 'Values' ? 'Select Values' : 'Exclude Values'))));
266
+ }, disabled: ArrayExtensions_1.default.IsNullOrEmptyOrContainsSingleEmptyValue(this.state.distinctColumnValues) }, selectedValues)));
253
267
  }
254
268
  onColumnValuesChange(columnValues) {
255
269
  var _a;
@@ -307,7 +321,7 @@ class QuickFilterFormComponent extends React.Component {
307
321
  }
308
322
  clearFilter() {
309
323
  const { filter } = this.state;
310
- this.props.api.filterApi.clearColumnFilterByColumn(filter.ColumnId);
324
+ this.props.api.layoutApi.clearColumnFilterByColumn(filter.ColumnId);
311
325
  }
312
326
  hasValuesPredicate(predicate) {
313
327
  return (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'Values' || (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'ExcludeValues';
@@ -316,13 +330,13 @@ class QuickFilterFormComponent extends React.Component {
316
330
  function mapStateToProps(state, ownProps) {
317
331
  return {
318
332
  currentColumn: ownProps.currentColumn,
319
- columnFilters: state.Filter.ColumnFilters,
333
+ columnFilters: LayoutRedux_1.getColumnFilterSelector(state),
320
334
  };
321
335
  }
322
336
  function mapDispatchToProps(dispatch) {
323
337
  return {
324
- onAddColumnFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterAdd(columnFilter)),
325
- onEditColumnFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterEdit(columnFilter)),
338
+ onAddColumnFilter: (columnFilter) => dispatch(LayoutRedux.LayoutColumnFilterAdd(columnFilter)),
339
+ onEditColumnFilter: (columnFilter) => dispatch(LayoutRedux.LayoutColumnFilterEdit(columnFilter)),
326
340
  };
327
341
  }
328
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;
@@ -32,6 +32,8 @@ const WindowDialog = (props) => {
32
32
  handleSelector: isActionModule
33
33
  ? `.${baseClassName} .ab-Panel__header`
34
34
  : '.ab-Adaptable-Popup__TopBar',
35
+ minHeight: 460,
36
+ minWidth: 400,
35
37
  size: popupSettings.size,
36
38
  position: popupSettings.position,
37
39
  onChange: handleWindowSettings,
@@ -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':
@@ -20,8 +20,8 @@ exports.FormDialog = ({ id, formProps, form, prepareContext, }) => {
20
20
  dispatch(PopupRedux_1.PopupHideForm(id));
21
21
  };
22
22
  const context = Object.assign({ adaptableApi: adaptable.api, formData: data }, formProps);
23
- return (React.createElement(Dialog_1.default, { isOpen: true, showCloseButton: false, style: { minHeight: 'auto', minWidth: 400 }, onDismiss: handleDismiss },
24
- React.createElement(rebass_1.Box, { padding: 4 },
23
+ return (React.createElement(Dialog_1.default, { isOpen: true, showCloseButton: false, style: { minHeight: 'auto', minWidth: 400, maxHeight: '80vh' }, onDismiss: handleDismiss },
24
+ React.createElement(rebass_1.Flex, { flexDirection: 'column', "data-name": "form-dialog", padding: 4, height: '100%' },
25
25
  React.createElement(AdaptableFormComponent_1.AdaptableFormComponent, { formDef: form, data: data, context: context, onChange: setData, api: adaptable.api, displayTitle: true, onButtonClick: async (button) => {
26
26
  var _a;
27
27
  handleDismiss();
@@ -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 {};