@adaptabletools/adaptable 11.2.4 → 12.0.0-canary.1

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 (278) hide show
  1. package/base.css +568 -273
  2. package/bundle.cjs.js +120 -120
  3. package/index.css +642 -270
  4. package/package.json +2 -2
  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/{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 +91 -4
  19. package/src/AdaptableOptions/EntitlementOptions.d.ts +7 -1
  20. package/src/AdaptableOptions/ExportOptions.d.ts +9 -8
  21. package/src/AdaptableOptions/FilterOptions.d.ts +6 -1
  22. package/src/AdaptableOptions/GeneralOptions.d.ts +25 -23
  23. package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.d.ts → MasterDetailPluginOptions.d.ts} +2 -4
  24. package/src/AdaptableOptions/{SmartEdit.js → 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 +95 -50
  28. package/src/Api/AdaptableApi.d.ts +6 -3
  29. package/src/Api/ColumnApi.d.ts +9 -4
  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/Api/{DataSourceApi.js → DataSetApi.js} +0 -0
  35. package/src/Api/EventApi.d.ts +29 -1
  36. package/src/Api/Events/DataSetChanged.d.ts +5 -0
  37. package/src/{PredefinedConfig/DataSourceState.js → Api/Events/DataSetChanged.js} +0 -0
  38. package/src/Api/Events/RowFormSubmitted.d.ts +19 -0
  39. package/src/{PredefinedConfig/FilterState.js → Api/Events/RowFormSubmitted.js} +0 -0
  40. package/src/Api/Events/SearchChanged.d.ts +4 -5
  41. package/src/Api/ExportApi.d.ts +2 -2
  42. package/src/Api/FilterApi.d.ts +28 -36
  43. package/src/Api/FormatColumnApi.d.ts +6 -0
  44. package/src/Api/GridApi.d.ts +15 -1
  45. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
  46. package/src/Api/Implementation/AdaptableApiImpl.js +3 -3
  47. package/src/Api/Implementation/AlertApiImpl.js +5 -1
  48. package/src/Api/Implementation/ApiBase.d.ts +3 -0
  49. package/src/Api/Implementation/ApiBase.js +6 -0
  50. package/src/Api/Implementation/ColumnApiImpl.d.ts +4 -4
  51. package/src/Api/Implementation/ColumnApiImpl.js +17 -16
  52. package/src/Api/Implementation/ConditionalStyleApiImpl.d.ts +2 -0
  53. package/src/Api/Implementation/ConditionalStyleApiImpl.js +8 -0
  54. package/src/Api/Implementation/ConfigApiImpl.d.ts +0 -4
  55. package/src/Api/Implementation/ConfigApiImpl.js +2 -24
  56. package/src/Api/Implementation/DashboardApiImpl.d.ts +3 -6
  57. package/src/Api/Implementation/DashboardApiImpl.js +5 -29
  58. package/src/Api/Implementation/DataSetApiImpl.d.ts +12 -0
  59. package/src/Api/Implementation/DataSetApiImpl.js +42 -0
  60. package/src/Api/Implementation/EventApiImpl.js +1 -0
  61. package/src/Api/Implementation/ExportApiImpl.d.ts +2 -2
  62. package/src/Api/Implementation/FilterApiImpl.d.ts +11 -11
  63. package/src/Api/Implementation/FilterApiImpl.js +59 -72
  64. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -0
  65. package/src/Api/Implementation/FormatColumnApiImpl.js +7 -2
  66. package/src/Api/Implementation/GridApiImpl.d.ts +4 -1
  67. package/src/Api/Implementation/GridApiImpl.js +45 -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 +3 -0
  71. package/src/Api/Implementation/LayoutApiImpl.js +20 -0
  72. package/src/Api/Implementation/PredicateApiImpl.d.ts +2 -0
  73. package/src/Api/Implementation/PredicateApiImpl.js +19 -1
  74. package/src/Api/Implementation/SmartEditApiImpl.d.ts +5 -2
  75. package/src/Api/Implementation/SmartEditApiImpl.js +9 -0
  76. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +5 -3
  77. package/src/Api/Implementation/TeamSharingApiImpl.js +28 -10
  78. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +1 -1
  79. package/src/Api/Implementation/UserInterfaceApiImpl.js +7 -25
  80. package/src/Api/InternalApi.d.ts +6 -2
  81. package/src/Api/LayoutApi.d.ts +16 -0
  82. package/src/Api/PredicateApi.d.ts +7 -0
  83. package/src/Api/SmartEditApi.d.ts +14 -3
  84. package/src/Api/TeamSharingApi.d.ts +18 -5
  85. package/src/Api/UserInterfaceApi.d.ts +4 -4
  86. package/src/PredefinedConfig/AdaptableState.d.ts +0 -4
  87. package/src/PredefinedConfig/CalculatedColumnState.d.ts +5 -0
  88. package/src/PredefinedConfig/Common/AdaptableButton.d.ts +3 -3
  89. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +5 -1
  90. package/src/PredefinedConfig/Common/AdaptableForm.d.ts +3 -2
  91. package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +1 -3
  92. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +2 -11
  93. package/src/PredefinedConfig/Common/AdaptablePredicate.js +18 -1
  94. package/src/PredefinedConfig/Common/BaseContext.d.ts +1 -1
  95. package/src/PredefinedConfig/{FilterState.d.ts → Common/ColumnFilter.d.ts} +2 -33
  96. package/src/PredefinedConfig/Common/ColumnFilter.js +2 -0
  97. package/src/PredefinedConfig/Common/Enums.d.ts +2 -2
  98. package/src/PredefinedConfig/Common/Enums.js +1 -1
  99. package/src/PredefinedConfig/Common/FormContext.d.ts +8 -0
  100. package/src/PredefinedConfig/Common/FormContext.js +2 -0
  101. package/src/PredefinedConfig/Common/Types.d.ts +6 -5
  102. package/src/PredefinedConfig/Common/Types.js +2 -3
  103. package/src/PredefinedConfig/LayoutState.d.ts +5 -0
  104. package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -10
  105. package/src/PredefinedConfig/StatusBarState.d.ts +1 -2
  106. package/src/PredefinedConfig/SystemState.d.ts +4 -2
  107. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +47 -0
  108. package/src/Redux/ActionsReducers/LayoutRedux.js +134 -1
  109. package/src/Redux/ActionsReducers/PopupRedux.d.ts +3 -2
  110. package/src/Redux/ActionsReducers/SystemRedux.d.ts +23 -1
  111. package/src/Redux/ActionsReducers/SystemRedux.js +39 -1
  112. package/src/Redux/Store/AdaptableStore.js +37 -39
  113. package/src/Strategy/AdaptableModuleBase.js +1 -2
  114. package/src/Strategy/AlertModule.d.ts +11 -0
  115. package/src/Strategy/AlertModule.js +14 -0
  116. package/src/Strategy/BulkUpdateModule.js +3 -4
  117. package/src/Strategy/CellSummaryModule.d.ts +3 -0
  118. package/src/Strategy/CellSummaryModule.js +29 -16
  119. package/src/Strategy/DataSetModule.d.ts +25 -0
  120. package/src/Strategy/DataSetModule.js +65 -0
  121. package/src/Strategy/ExportModule.js +6 -1
  122. package/src/Strategy/FilterModule.d.ts +7 -11
  123. package/src/Strategy/FilterModule.js +26 -20
  124. package/src/Strategy/FlashingCellModule.d.ts +1 -1
  125. package/src/Strategy/FlashingCellModule.js +2 -2
  126. package/src/Strategy/Interface/IModule.d.ts +3 -1
  127. package/src/Strategy/LayoutModule.js +25 -2
  128. package/src/Strategy/PlusMinusModule.js +1 -4
  129. package/src/Strategy/SmartEditModule.d.ts +1 -1
  130. package/src/Strategy/SmartEditModule.js +7 -8
  131. package/src/Strategy/StatusBarModule.js +1 -3
  132. package/src/Strategy/TeamSharingModule.js +1 -1
  133. package/src/Strategy/ToolPanelModule.js +1 -4
  134. package/src/Utilities/Constants/GeneralConstants.d.ts +8 -2
  135. package/src/Utilities/Constants/GeneralConstants.js +8 -2
  136. package/src/Utilities/Constants/ModuleConstants.d.ts +1 -1
  137. package/src/Utilities/Constants/ModuleConstants.js +2 -2
  138. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +24 -13
  139. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
  140. package/src/Utilities/Helpers/AdaptableHelper.js +4 -1
  141. package/src/Utilities/ObjectFactory.d.ts +3 -6
  142. package/src/Utilities/ObjectFactory.js +3 -7
  143. package/src/Utilities/Services/CalculatedColumnExpressionService.js +6 -7
  144. package/src/Utilities/Services/EntitlementService.js +7 -1
  145. package/src/Utilities/Services/Interface/IRowEditService.d.ts +8 -0
  146. package/src/Utilities/Services/Interface/IRowEditService.js +2 -0
  147. package/src/Utilities/Services/ModuleService.js +1 -1
  148. package/src/Utilities/Services/ReportService.js +2 -3
  149. package/src/Utilities/Services/RowEditService.d.ts +26 -0
  150. package/src/Utilities/Services/RowEditService.js +197 -0
  151. package/src/Utilities/Services/TeamSharingService.js +4 -4
  152. package/src/View/AdaptablePopover/index.d.ts +1 -0
  153. package/src/View/AdaptablePopover/index.js +5 -6
  154. package/src/View/AdaptableView.js +1 -1
  155. package/src/View/AdaptableViewFactory.js +2 -2
  156. package/src/View/Alert/ActiveAlertsPanel.d.ts +2 -0
  157. package/src/View/Alert/ActiveAlertsPanel.js +15 -0
  158. package/src/View/Alert/AlertStatusSubPanel.js +3 -8
  159. package/src/View/Alert/AlertViewPanel.js +2 -2
  160. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +1 -1
  161. package/src/View/BulkUpdate/BulkUpdatePopup.js +2 -3
  162. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +1 -1
  163. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +2 -3
  164. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +13 -7
  165. package/src/View/CellSummary/CellSummaryDetails.js +4 -4
  166. package/src/View/CellSummary/CellSummaryPopover.d.ts +2 -4
  167. package/src/View/CellSummary/CellSummaryPopover.js +3 -6
  168. package/src/View/CellSummary/CellSummaryPopup.js +8 -0
  169. package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -1
  170. package/src/View/CellSummary/CellSummaryStatusPanel.js +2 -2
  171. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  172. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +18 -8
  173. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -2
  174. package/src/View/Components/ExternalRenderer.d.ts +3 -6
  175. package/src/View/Components/ExternalRenderer.js +5 -5
  176. package/src/View/Components/FilterForm/FilterForm.d.ts +1 -1
  177. package/src/View/Components/FilterForm/FilterForm.js +10 -8
  178. package/src/View/Components/FilterForm/QuickFilterForm.d.ts +1 -1
  179. package/src/View/Components/FilterForm/QuickFilterForm.js +5 -4
  180. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +1 -1
  181. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +2 -0
  182. package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +0 -2
  183. package/src/View/Components/Popups/AdaptablePopupAlert.js +13 -11
  184. package/src/View/Components/Popups/AdaptableToaster.js +29 -9
  185. package/src/View/Components/Popups/FormPopups/FormPopups.js +2 -2
  186. package/src/View/Components/PreviewResultsPanel.js +3 -3
  187. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -2
  188. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +11 -9
  189. package/src/View/Components/WizardSummaryPage.js +2 -2
  190. package/src/View/Dashboard/CustomDashboardButton.d.ts +11 -0
  191. package/src/View/Dashboard/CustomDashboardButton.js +47 -0
  192. package/src/View/Dashboard/CustomToolbarWrapper.d.ts +1 -0
  193. package/src/View/Dashboard/CustomToolbarWrapper.js +30 -11
  194. package/src/View/Dashboard/Dashboard.d.ts +1 -0
  195. package/src/View/Dashboard/Dashboard.js +8 -34
  196. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +19 -36
  197. package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +3 -0
  198. package/src/View/DataChangeHistory/buildActionColumnButton.js +70 -0
  199. package/src/View/DataSet/DataSetSelector.d.ts +7 -0
  200. package/src/View/DataSet/DataSetSelector.js +18 -0
  201. package/src/View/DataSet/DataSetStatusPanelPopover.d.ts +2 -0
  202. package/src/View/DataSet/DataSetStatusPanelPopover.js +19 -0
  203. package/src/View/DataSet/DataSetViewPanel.d.ts +19 -0
  204. package/src/View/DataSet/DataSetViewPanel.js +58 -0
  205. package/src/View/Filter/ActiveFiltersPanel.js +1 -1
  206. package/src/View/Filter/FilterSummary.d.ts +5 -5
  207. package/src/View/Filter/FilterSummary.js +5 -4
  208. package/src/View/Filter/FilterViewPanel.d.ts +4 -4
  209. package/src/View/Filter/FilterViewPanel.js +10 -13
  210. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +5 -7
  211. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +4 -5
  212. package/src/View/GridInfo/ColumnInfoComponent.js +1 -1
  213. package/src/View/GridInfo/GridInfoPopup.js +1 -1
  214. package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +6 -24
  215. package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
  216. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +2 -1
  217. package/src/View/SmartEdit/SmartEditPopup.d.ts +1 -1
  218. package/src/View/SmartEdit/SmartEditPopup.js +3 -4
  219. package/src/View/SmartEdit/SmartEditViewPanel.d.ts +1 -1
  220. package/src/View/SmartEdit/SmartEditViewPanel.js +3 -4
  221. package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
  222. package/src/View/StatusBar/AdaptableStatusBar.js +1 -1
  223. package/src/View/StatusBar/StatusBarPanel.d.ts +1 -0
  224. package/src/View/StatusBar/StatusBarPanel.js +5 -4
  225. package/src/View/Theme/ThemeStatusPanelPopover.js +5 -25
  226. package/src/View/UIHelper.d.ts +4 -4
  227. package/src/View/UIHelper.js +10 -10
  228. package/src/agGrid/ActionColumnRenderer.d.ts +6 -1
  229. package/src/agGrid/ActionColumnRenderer.js +9 -6
  230. package/src/agGrid/Adaptable.d.ts +7 -2
  231. package/src/agGrid/Adaptable.js +213 -69
  232. package/src/agGrid/FilterWrapper.js +1 -1
  233. package/src/agGrid/agGridHelper.d.ts +7 -8
  234. package/src/agGrid/agGridHelper.js +68 -86
  235. package/src/agGrid/agGridMenuHelper.js +4 -1
  236. package/src/agGrid/rowEditIcons.d.ts +5 -0
  237. package/src/agGrid/rowEditIcons.js +10 -0
  238. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +9 -18
  239. package/src/components/Dashboard/DashboardToolbar.js +2 -2
  240. package/src/components/Datepicker/index.js +19 -18
  241. package/src/components/InfiniteTable/index.js +1 -0
  242. package/src/components/List/GridList/index.js +1 -1
  243. package/src/components/SelectList.d.ts +10 -0
  244. package/src/components/SelectList.js +9 -0
  245. package/src/components/WindowModal/WindowModal.d.ts +2 -0
  246. package/src/components/WindowModal/WindowModal.js +1 -1
  247. package/src/components/icons/{data-source.d.ts → add-row.d.ts} +0 -0
  248. package/src/components/icons/add-row.js +7 -0
  249. package/src/components/icons/data-set.d.ts +3 -0
  250. package/src/components/icons/{data-source.js → data-set.js} +0 -0
  251. package/src/components/icons/index.js +4 -2
  252. package/src/metamodel/adaptable.metamodel.d.ts +226 -69
  253. package/src/metamodel/adaptable.metamodel.js +532 -311
  254. package/src/types.d.ts +18 -13
  255. package/version.d.ts +1 -1
  256. package/version.js +1 -1
  257. package/src/AdaptableOptions/FormatColumnOptions.d.ts +0 -9
  258. package/src/AdaptableOptions/SmartEdit.d.ts +0 -34
  259. package/src/Api/DataSourceApi.d.ts +0 -58
  260. package/src/Api/Implementation/DataSourceApiImpl.d.ts +0 -15
  261. package/src/Api/Implementation/DataSourceApiImpl.js +0 -51
  262. package/src/PredefinedConfig/DataSourceState.d.ts +0 -34
  263. package/src/Redux/ActionsReducers/DataSourceRedux.d.ts +0 -42
  264. package/src/Redux/ActionsReducers/DataSourceRedux.js +0 -76
  265. package/src/Redux/ActionsReducers/FilterRedux.d.ts +0 -70
  266. package/src/Redux/ActionsReducers/FilterRedux.js +0 -126
  267. package/src/Strategy/DataSourceModule.d.ts +0 -20
  268. package/src/Strategy/DataSourceModule.js +0 -56
  269. package/src/View/Components/Forms/AdaptableForm.d.ts +0 -6
  270. package/src/View/Components/Forms/AdaptableForm.js +0 -21
  271. package/src/View/DataSource/DataSourceViewPanel.d.ts +0 -19
  272. package/src/View/DataSource/DataSourceViewPanel.js +0 -69
  273. package/src/View/DataSource/Wizard/DataSourceSettingsSummary.d.ts +0 -2
  274. package/src/View/DataSource/Wizard/DataSourceSettingsSummary.js +0 -17
  275. package/src/View/DataSource/Wizard/DataSourceSettingsWizard.d.ts +0 -8
  276. package/src/View/DataSource/Wizard/DataSourceSettingsWizard.js +0 -42
  277. package/src/View/DataSource/Wizard/DataSourceWizard.d.ts +0 -8
  278. package/src/View/DataSource/Wizard/DataSourceWizard.js +0 -53
@@ -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, { 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,
@@ -103,7 +105,7 @@ class FilterFormComponent extends React.Component {
103
105
  this._isMounted = false;
104
106
  }
105
107
  componentDidMount() {
106
- if (this.props.currentColumn.dataType != Enums_1.DataType.Boolean) {
108
+ if (this.props.currentColumn.dataType != 'Boolean') {
107
109
  this.loadPermittedValues();
108
110
  }
109
111
  }
@@ -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);
@@ -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;
@@ -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();
@@ -9,9 +9,9 @@ const check_1 = tslib_1.__importDefault(require("../../components/icons/check"))
9
9
  const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
10
10
  const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
11
11
  const columnsMap = new Map([
12
- ['InitialValue', { field: 'InitialValue', flex: 1, header: 'Current', align: 'center' }],
13
- ['ComputedValue', { field: 'ComputedValue', flex: 1, header: 'New', align: 'center' }],
14
- ['ValidInfo', { field: 'ValidInfo', width: 80, header: 'Valid', align: 'center' }],
12
+ ['InitialValue', { field: 'InitialValue', defaultFlex: 1, header: 'Current', align: 'center' }],
13
+ ['ComputedValue', { field: 'ComputedValue', defaultFlex: 1, header: 'New', align: 'center' }],
14
+ ['ValidInfo', { field: 'ValidInfo', defaultWidth: 80, header: 'Valid', align: 'center' }],
15
15
  ]);
16
16
  const tableDOMProps = {
17
17
  style: { flex: 1 },
@@ -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
  };
@@ -6,8 +6,8 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const WizardPanel_1 = tslib_1.__importDefault(require("../../components/WizardPanel"));
7
7
  const InfiniteTable_1 = require("../../components/InfiniteTable");
8
8
  const columnsMap = new Map([
9
- ['Key', { field: 'Key', header: 'Property', flex: 1 }],
10
- ['Value', { field: 'Value', header: 'Value', flex: 3 }],
9
+ ['Key', { field: 'Key', header: 'Property', defaultFlex: 1 }],
10
+ ['Value', { field: 'Value', header: 'Value', defaultFlex: 3 }],
11
11
  ]);
12
12
  const tableDOMProps = {
13
13
  className: 'ab-WizardSummary__list',
@@ -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 {};