@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
@@ -12,29 +12,40 @@ exports.CustomToolbarWrapper = (props) => {
12
12
  let buttonsDivId = 'ab-CustomToolbar__' + props.customToolbar.name + '__buttons';
13
13
  const [contentsHTML, setContentsHTML] = react_1.useState('');
14
14
  // dummy object which is used to force a re-render of the toolbar
15
- const [revision, setRevision] = react_1.useState(1);
15
+ const [componentRevision, setComponentRevision] = react_1.useState(1);
16
16
  const contentsDivRef = react_1.useRef(null);
17
17
  const { api } = AdaptableContext_1.useAdaptable();
18
18
  react_1.useLayoutEffect(() => {
19
- const node = contentsDivRef.current;
19
+ const element = contentsDivRef.current;
20
20
  const adaptableApi = api;
21
21
  if (props.customToolbar.render) {
22
22
  const html = props.customToolbar.render({
23
23
  visible: true,
24
- node,
24
+ element,
25
25
  adaptableApi,
26
26
  });
27
27
  setContentsHTML(html);
28
28
  }
29
- else if (props.customToolbar.frameworkComponent) {
30
- adaptableApi.internalApi.createFrameworkComponent(node, props.customToolbar.frameworkComponent, 'toolbar');
31
- }
29
+ }, [componentRevision, props.dashboardRevision]);
30
+ react_1.useLayoutEffect(() => {
31
+ const element = contentsDivRef.current;
32
+ const adaptableApi = api;
33
+ // cleanup runs in a separate effect, this way it's executed only once on unmount
32
34
  return () => {
33
35
  if (props.customToolbar.render) {
34
- props.customToolbar.render({ visible: false, node, adaptableApi });
36
+ props.customToolbar.render({ visible: false, element, adaptableApi });
35
37
  }
36
- else if (props.customToolbar.frameworkComponent) {
37
- adaptableApi.internalApi.destroyFrameworkComponent(node, props.customToolbar.frameworkComponent, 'toolbar');
38
+ };
39
+ }, []);
40
+ react_1.useLayoutEffect(() => {
41
+ const element = contentsDivRef.current;
42
+ const adaptableApi = api;
43
+ if (props.customToolbar.frameworkComponent) {
44
+ adaptableApi.internalApi.createFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
45
+ }
46
+ return () => {
47
+ if (props.customToolbar.frameworkComponent) {
48
+ adaptableApi.internalApi.destroyFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
38
49
  }
39
50
  };
40
51
  }, []);
@@ -58,6 +69,14 @@ exports.CustomToolbarWrapper = (props) => {
58
69
  adaptableApi: api,
59
70
  dashboardState: api.dashboardApi.getDashboardState(),
60
71
  };
72
+ const defaultIconProps = {
73
+ style: {
74
+ height: 'var(--ab-cmp-simple-button__height)',
75
+ width: 'var(--ab-cmp-simple-button__width)',
76
+ },
77
+ };
78
+ const buttonIcon = api.internalApi.getIconForButton(button, dashboardContext);
79
+ const iconProps = buttonIcon && Object.assign({}, defaultIconProps, buttonIcon);
61
80
  let buttonStyle = api.internalApi.getStyleForButton(button, dashboardContext);
62
81
  let buttonLabel = api.internalApi.getLabelForButton(button, dashboardContext);
63
82
  let buttonTooltip = api.internalApi.getTooltipForButton(button, dashboardContext);
@@ -71,10 +90,10 @@ exports.CustomToolbarWrapper = (props) => {
71
90
  button.onClick ? button.onClick(button, dashboardContext) : null;
72
91
  setTimeout(() => {
73
92
  // mutate state to force a re-rendering
74
- setRevision(revision + 1);
93
+ setComponentRevision(componentRevision + 1);
75
94
  }, 16);
76
95
  } },
77
- button.icon ? React.createElement("img", Object.assign({}, button.icon)) : null,
96
+ buttonIcon ? React.createElement("img", Object.assign({}, iconProps)) : null,
78
97
  buttonLabel));
79
98
  }))));
80
99
  };
@@ -8,6 +8,7 @@ import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
8
8
  import * as QuickSearchRedux from '../../Redux/ActionsReducers/QuickSearchRedux';
9
9
  import { SystemStatusMessageInfo } from '../../PredefinedConfig/Common/SystemStatusMessageInfo';
10
10
  interface DashboardComponentProps extends ModuleViewPopupProps<any> {
11
+ DashboardRevision: number;
11
12
  DashboardState: DashboardState;
12
13
  GridState: GridState;
13
14
  SystemStatusMessageInfos: SystemStatusMessageInfo[];
@@ -21,6 +21,7 @@ const ModuleToolbarWrapper_1 = require("./ModuleToolbarWrapper");
21
21
  const CustomToolbarWrapper_1 = require("./CustomToolbarWrapper");
22
22
  const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
23
23
  const ApplicationIcon_1 = require("../../components/ApplicationIcon");
24
+ const CustomDashboardButton_1 = require("./CustomDashboardButton");
24
25
  const DashboardComponent = (props) => {
25
26
  const [searchText, search] = useQuickSearchDebounced_1.useQuickSearchDebounced(props);
26
27
  const dashboardAccessLevel = props.api.internalApi
@@ -35,7 +36,7 @@ const DashboardComponent = (props) => {
35
36
  if (customToolbar) {
36
37
  if (dashboardAccessLevel != 'Hidden') {
37
38
  return (React.createElement(rebass_1.Box, { key: customToolbar.name, className: `ab-Dashboard__container ab-Dashboard__container--customToolbar` },
38
- React.createElement(CustomToolbarWrapper_1.CustomToolbarWrapper, { customToolbar: customToolbar })));
39
+ React.createElement(CustomToolbarWrapper_1.CustomToolbarWrapper, { customToolbar: customToolbar, dashboardRevision: props.DashboardRevision })));
39
40
  }
40
41
  }
41
42
  else {
@@ -88,40 +89,12 @@ const DashboardComponent = (props) => {
88
89
  return shortcuts;
89
90
  };
90
91
  const renderDashboardButtons = () => {
91
- var _a;
92
- let dashboardButtonsArray = (_a = props.api.dashboardApi
93
- .getCustomDashboardButtons()) === null || _a === void 0 ? void 0 : _a.filter((c) => c);
92
+ let dashboardButtonsArray = props.api.dashboardApi
93
+ .getCustomDashboardButtons()
94
+ .filter(Boolean);
94
95
  let customDashboardButtons = null;
95
- if (dashboardButtonsArray) {
96
- customDashboardButtons = dashboardButtonsArray.map((button) => {
97
- // TODO: variants of this mapping are present in several places (just search for api.internalApi.getStyleForButton() usages)
98
- // with the next opportunity we should abstract it
99
- const defaultIconProps = {
100
- style: {
101
- height: 'var(--ab-cmp-simple-button__height)',
102
- width: 'var(--ab-cmp-simple-button__width)',
103
- },
104
- };
105
- const iconProps = button.icon && Object.assign({}, defaultIconProps, button.icon);
106
- // const iconProps: any = button.icon ? { ...button.icon } : null;
107
- // if (iconProps) {
108
- // delete iconProps.Uuid;
109
- // }
110
- const dashboardContext = {
111
- adaptableApi: props.api,
112
- dashboardState: props.api.dashboardApi.getDashboardState(),
113
- };
114
- let buttonStyle = props.api.internalApi.getStyleForButton(button, dashboardContext);
115
- let buttonLabel = props.api.internalApi.getLabelForButton(button, dashboardContext);
116
- let buttonTooltip = props.api.internalApi.getTooltipForButton(button, dashboardContext);
117
- if (button.hidden && button.hidden(button, dashboardContext)) {
118
- return null;
119
- }
120
- const disabled = button.disabled && button.disabled(button, dashboardContext);
121
- 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: () => button.onClick(button, dashboardContext), accessLevel: 'Full' },
122
- button.icon ? React.createElement("img", Object.assign({}, iconProps)) : null,
123
- buttonLabel));
124
- });
96
+ if (dashboardButtonsArray === null || dashboardButtonsArray === void 0 ? void 0 : dashboardButtonsArray.length) {
97
+ customDashboardButtons = dashboardButtonsArray.map((button, index) => (React.createElement(CustomDashboardButton_1.CustomDashboardButton, { key: `${button.label}-${index}`, button: button, api: props.api, accessLevel: props.accessLevel })));
125
98
  }
126
99
  return customDashboardButtons;
127
100
  };
@@ -159,6 +132,7 @@ const DashboardComponent = (props) => {
159
132
  };
160
133
  function mapStateToProps(state, ownProps) {
161
134
  return {
135
+ DashboardRevision: state.System.DashboardRevision,
162
136
  DashboardState: state.Dashboard,
163
137
  GridState: state.Grid,
164
138
  SystemStatusMessageInfos: state.System.SystemStatusMessages,
@@ -8,6 +8,7 @@ const all_modules_1 = require("@ag-grid-community/all-modules");
8
8
  const react_1 = require("react");
9
9
  const usePrevious_1 = tslib_1.__importDefault(require("../../components/utils/usePrevious"));
10
10
  const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
11
+ const buildActionColumnButton_1 = require("./buildActionColumnButton");
11
12
  exports.DataChangeHistoryGrid = (props) => {
12
13
  const { changeHistoryLog, adaptableContainerId, agGridContainerId, onUndoChange } = props;
13
14
  const mainAdaptableInstance = AdaptableContext_1.useAdaptable();
@@ -72,7 +73,7 @@ exports.DataChangeHistoryGrid = (props) => {
72
73
  return React.createElement(React.Fragment, null);
73
74
  };
74
75
  const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange) => {
75
- var _a, _b;
76
+ var _a, _b, _c;
76
77
  const mainAdaptableOptions = mainAdaptableInstance.adaptableOptions;
77
78
  const mainAdaptableTheme = mainAdaptableInstance.api.themeApi.getCurrentTheme();
78
79
  const undoRowNode = (rowNode) => {
@@ -80,6 +81,21 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
80
81
  const changeKey = (_a = rowNode === null || rowNode === void 0 ? void 0 : rowNode.data) === null || _a === void 0 ? void 0 : _a['changeKey'];
81
82
  changeKey && onUndoChange(changeKey);
82
83
  };
84
+ const actionColumnButton = buildActionColumnButton_1.buildActionColumnButton((_a = mainAdaptableInstance.adaptableOptions) === null || _a === void 0 ? void 0 : _a.dataChangeHistoryOptions, undoRowNode);
85
+ let actionOptions = undefined;
86
+ if (actionColumnButton) {
87
+ actionOptions = {
88
+ actionColumns: [
89
+ {
90
+ columnId: 'undoActionColumn',
91
+ friendlyName: ' ',
92
+ includeGroupedRows: true,
93
+ actionColumnSettings: { suppressMenu: true, suppressMovable: true },
94
+ actionColumnButton,
95
+ },
96
+ ],
97
+ };
98
+ }
83
99
  const options = {
84
100
  gridOptions: gridOptions,
85
101
  modules: [...all_modules_1.AllCommunityModules],
@@ -98,40 +114,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
98
114
  createDefaultLayout: false,
99
115
  },
100
116
  userInterfaceOptions: {
101
- actionColumns: [
102
- {
103
- columnId: 'undoActionColumn',
104
- friendlyName: ' ',
105
- includeGroupedRows: true,
106
- actionColumnSettings: { suppressMenu: true, suppressMovable: true },
107
- actionColumnButton: {
108
- label: (button, context) => {
109
- if (context.adaptableApi.gridApi.isGroupRowNode(context.rowNode)) {
110
- return 'Undo Group';
111
- }
112
- return 'Undo Change';
113
- },
114
- onClick: (button, context) => {
115
- var _a;
116
- const rowNode = context.rowNode;
117
- if (context.adaptableApi.gridApi.isGroupRowNode(rowNode)) {
118
- // undo all children
119
- const childrenNodes = (_a = context.rowNode) === null || _a === void 0 ? void 0 : _a.childrenAfterFilter;
120
- if (childrenNodes) {
121
- childrenNodes.forEach((childNode) => undoRowNode(childNode));
122
- }
123
- }
124
- else {
125
- undoRowNode(rowNode);
126
- }
127
- },
128
- buttonStyle: {
129
- variant: 'raised',
130
- tone: 'accent',
131
- },
132
- },
133
- },
134
- ],
117
+ actionOptions: actionOptions,
135
118
  },
136
119
  predefinedConfig: {
137
120
  Layout: {
@@ -174,7 +157,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
174
157
  DisplayFormat: {
175
158
  Formatter: 'DateFormatter',
176
159
  Options: {
177
- Pattern: `${(_b = (_a = mainAdaptableOptions.userInterfaceOptions) === null || _a === void 0 ? void 0 : _a.dateInputOptions) === null || _b === void 0 ? void 0 : _b.dateFormat} HH:mm:ss`,
160
+ Pattern: `${(_c = (_b = mainAdaptableOptions.userInterfaceOptions) === null || _b === void 0 ? void 0 : _b.dateInputOptions) === null || _c === void 0 ? void 0 : _c.dateFormat} HH:mm:ss`,
178
161
  },
179
162
  },
180
163
  },
@@ -0,0 +1,3 @@
1
+ import { RowNode } from '@ag-grid-community/all-modules';
2
+ import { ActionColumnButtonContext, AdaptableButton, DataChangeHistoryOptions } from '../../types';
3
+ export declare const buildActionColumnButton: (options: DataChangeHistoryOptions, undoRowNode: (rowNode: RowNode) => void) => AdaptableButton<ActionColumnButtonContext>[];
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildActionColumnButton = void 0;
4
+ exports.buildActionColumnButton = (options, undoRowNode) => {
5
+ let actionColumnButtonsOptions = options.actionColumnButton;
6
+ if (!actionColumnButtonsOptions ||
7
+ (Array.isArray(actionColumnButtonsOptions) && actionColumnButtonsOptions.length === 0)) {
8
+ return null;
9
+ }
10
+ if (!Array.isArray(actionColumnButtonsOptions)) {
11
+ actionColumnButtonsOptions = [actionColumnButtonsOptions];
12
+ }
13
+ const isGroupNode = (context) => context.adaptableApi.gridApi.isGroupRowNode(context.rowNode);
14
+ const onUndo = (context) => {
15
+ var _a;
16
+ const rowNode = context.rowNode;
17
+ if (context.adaptableApi.gridApi.isGroupRowNode(rowNode)) {
18
+ // undo all children
19
+ const childrenNodes = (_a = context.rowNode) === null || _a === void 0 ? void 0 : _a.childrenAfterFilter;
20
+ if (childrenNodes) {
21
+ childrenNodes.forEach((childNode) => undoRowNode(childNode));
22
+ }
23
+ }
24
+ else {
25
+ undoRowNode(rowNode);
26
+ }
27
+ };
28
+ const buildContext = (context) => (Object.assign(Object.assign({}, context), { isGroupNode: isGroupNode(context), undoDataChange: () => onUndo(context) }));
29
+ return actionColumnButtonsOptions.map((actionColumnOption) => ({
30
+ label: (button, context) => {
31
+ if (typeof actionColumnOption.label !== 'function') {
32
+ return actionColumnOption.label;
33
+ }
34
+ return actionColumnOption.label(button, buildContext(context));
35
+ },
36
+ buttonStyle: (button, context) => {
37
+ if (typeof actionColumnOption.buttonStyle !== 'function') {
38
+ return actionColumnOption.buttonStyle;
39
+ }
40
+ return actionColumnOption.buttonStyle(button, buildContext(context));
41
+ },
42
+ tooltip: (button, context) => {
43
+ if (typeof actionColumnOption.tooltip !== 'function') {
44
+ return actionColumnOption.tooltip;
45
+ }
46
+ return actionColumnOption.tooltip(button, buildContext(context));
47
+ },
48
+ disabled: (button, context) => {
49
+ if (typeof actionColumnOption.disabled !== 'function') {
50
+ return actionColumnOption.disabled;
51
+ }
52
+ return actionColumnOption.disabled(button, buildContext(context));
53
+ },
54
+ onClick: (button, context) => {
55
+ if (actionColumnOption.Action === 'undo') {
56
+ onUndo(buildContext(context));
57
+ }
58
+ if (typeof actionColumnOption.onClick === 'function') {
59
+ actionColumnOption.onClick(button, buildContext(context));
60
+ }
61
+ },
62
+ hidden: (button, context) => {
63
+ if (typeof actionColumnOption.hidden !== 'function') {
64
+ return actionColumnOption.hidden;
65
+ }
66
+ return actionColumnOption.hidden(button, buildContext(context));
67
+ },
68
+ icon: actionColumnOption.icon,
69
+ }));
70
+ };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { AccessLevel, DataSet } from '../../../types';
3
+ export declare const DataSetSelector: React.FunctionComponent<{
4
+ data: DataSet;
5
+ id?: string;
6
+ accessLevel: AccessLevel;
7
+ }>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataSetSelector = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const Radio_1 = tslib_1.__importDefault(require("../../components/Radio"));
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ exports.DataSetSelector = ({ data }) => {
9
+ const adaptable = AdaptableContext_1.useAdaptable();
10
+ const dataSets = adaptable.api.dataSetApi.getAllDataSets();
11
+ const selectedDataSet = adaptable.api.dataSetApi.getCurrentDataSet();
12
+ const isDisabled = (dataSets === null || dataSets === void 0 ? void 0 : dataSets.length) === 1;
13
+ const isSelected = (selectedDataSet === null || selectedDataSet === void 0 ? void 0 : selectedDataSet.name) === (data === null || data === void 0 ? void 0 : data.name);
14
+ const handleToggle = React.useCallback(() => {
15
+ adaptable.api.dataSetApi.setDataSet(data.name);
16
+ }, [isSelected]);
17
+ return React.createElement(Radio_1.default, { id: data.name, disabled: isDisabled, checked: isSelected, onClick: handleToggle });
18
+ };
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const DataSetStatusPanelPopover: React.FunctionComponent;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataSetStatusPanelPopover = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const SelectList_1 = require("../../components/SelectList");
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ exports.DataSetStatusPanelPopover = () => {
9
+ const adaptable = AdaptableContext_1.useAdaptable();
10
+ const dataSets = adaptable.api.dataSetApi.getAllDataSets();
11
+ const handleDataSetChange = React.useCallback((option) => {
12
+ adaptable.api.dataSetApi.setDataSet(option.label);
13
+ }, []);
14
+ const options = dataSets.map((dataSet) => ({
15
+ label: dataSet.name,
16
+ value: dataSet.name,
17
+ }));
18
+ return React.createElement(SelectList_1.SelectList, { options: options, onChange: handleDataSetChange });
19
+ };
@@ -0,0 +1,19 @@
1
+ import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
2
+ import * as React from 'react';
3
+ import * as Redux from 'redux';
4
+ import { DataSet } from '../../types';
5
+ export interface DataSetViewPanelComponentProps extends ViewPanelProps {
6
+ CurrentDataSetName: string;
7
+ onSelectDataSet: (dataSet: DataSet) => Redux.Action;
8
+ }
9
+ interface DataSetViewPanelComponentState {
10
+ CurrentDataSet: DataSet;
11
+ }
12
+ declare class DataSetViewPanelComponent extends React.Component<DataSetViewPanelComponentProps, DataSetViewPanelComponentState> {
13
+ getCurrentDataSet(): DataSet;
14
+ getDataSets(): DataSet[];
15
+ render(): JSX.Element;
16
+ onSelectedDataSetChanged(dataSetName: string): void;
17
+ }
18
+ export declare let DataSetViewPanelControl: import("react-redux").ConnectedComponent<typeof DataSetViewPanelComponent, Pick<React.ClassAttributes<DataSetViewPanelComponent> & DataSetViewPanelComponentProps, "ref" | "key">>;
19
+ export {};
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataSetViewPanelControl = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
6
+ const React = tslib_1.__importStar(require("react"));
7
+ const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
8
+ const rebass_1 = require("rebass");
9
+ const DropdownButton_1 = tslib_1.__importDefault(require("../../components/DropdownButton"));
10
+ const react_redux_1 = require("react-redux");
11
+ class DataSetViewPanelComponent extends React.Component {
12
+ getCurrentDataSet() {
13
+ return StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.CurrentDataSetName)
14
+ ? null
15
+ : this.getDataSets().find((ds) => ds.name == this.props.CurrentDataSetName);
16
+ }
17
+ getDataSets() {
18
+ return this.props.api.dataSetApi.getAllDataSets();
19
+ }
20
+ render() {
21
+ var _a, _b;
22
+ const selectDataSetString = 'Select Data Set';
23
+ let currentDataSetName = (_b = (_a = this.getCurrentDataSet()) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : selectDataSetString;
24
+ let availableDataSets = this.getDataSets().map((dataSet) => {
25
+ return {
26
+ value: dataSet.name,
27
+ label: dataSet.name,
28
+ onClick: () => this.onSelectedDataSetChanged(dataSet.name),
29
+ };
30
+ });
31
+ const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
32
+ return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__DataSet__wrap` },
33
+ React.createElement(DropdownButton_1.default, { marginRight: 2, columns: ['label'], style: { minWidth: 160, fontSize: 'small' }, className: `ab-${elementType}__DataSet__select`, items: availableDataSets, variant: "outlined", tone: 'neutral' }, currentDataSetName)));
34
+ }
35
+ onSelectedDataSetChanged(dataSetName) {
36
+ if (StringExtensions_1.StringExtensions.IsNullOrEmpty(dataSetName)) {
37
+ this.setState({ CurrentDataSet: null });
38
+ }
39
+ else {
40
+ let newDataSet = this.getDataSets().find((ds) => ds.name == dataSetName);
41
+ this.setState({ CurrentDataSet: newDataSet });
42
+ this.props.onSelectDataSet(newDataSet);
43
+ }
44
+ }
45
+ }
46
+ function mapStateToProps(state) {
47
+ return {
48
+ CurrentDataSetName: state.System.CurrentDataSet,
49
+ };
50
+ }
51
+ function mapDispatchToProps(dispatch) {
52
+ return {
53
+ onSelectDataSet: (dataSet) => {
54
+ return dispatch(SystemRedux.SystemDataSetSelect(dataSet));
55
+ },
56
+ };
57
+ }
58
+ exports.DataSetViewPanelControl = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(DataSetViewPanelComponent);
@@ -9,6 +9,6 @@ const AdaptableObjectCompactList_1 = require("../Components/AdaptableObjectList/
9
9
  exports.ActiveFiltersPanel = () => {
10
10
  const adaptable = AdaptableContext_1.useAdaptable();
11
11
  const filterModule = adaptable.ModuleService.getModuleById(ModuleConstants.FilterModuleId);
12
- const columnFilters = adaptable.api.filterApi.getAllColumnFilter();
12
+ const columnFilters = adaptable.api.filterApi.getColumnFilters();
13
13
  return React.createElement(AdaptableObjectCompactList_1.AdaptableObjectCompactList, { abObjects: columnFilters, module: filterModule });
14
14
  };
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { ModuleSummaryProps } from '../Components/SharedProps/ModuleSummaryProps';
3
3
  import { EditableConfigEntityState } from '../Components/SharedProps/EditableConfigEntityState';
4
- import * as FilterRedux from '../../Redux/ActionsReducers/FilterRedux';
5
- import { ColumnFilter } from '../../PredefinedConfig/FilterState';
6
- export interface FilterSummaryProps extends ModuleSummaryProps<FilterSummaryComponent> {
4
+ import * as LayoutRedux from '../../Redux/ActionsReducers/LayoutRedux';
5
+ import { ColumnFilter } from '../../types';
6
+ export interface FilterSummaryProps extends Omit<ModuleSummaryProps<FilterSummaryComponent>, 'onClosePopup' | 'modalContainer'> {
7
7
  ColumnFilters: ColumnFilter[];
8
- onClearFilter: (columnfilter: ColumnFilter) => FilterRedux.ColumnFilterClearAction;
8
+ onClearFilter: (columnFilter: ColumnFilter) => LayoutRedux.LayoutFilterClearAction;
9
9
  }
10
10
  export declare class FilterSummaryComponent extends React.Component<FilterSummaryProps, EditableConfigEntityState> {
11
11
  constructor(props: FilterSummaryProps);
12
12
  render(): any;
13
13
  getDescription(columnFilter: ColumnFilter): string;
14
14
  }
15
- export declare let FilterSummary: import("react-redux").ConnectedComponent<typeof FilterSummaryComponent, any>;
15
+ export declare let FilterSummary: import("react-redux").ConnectedComponent<typeof FilterSummaryComponent, Pick<React.ClassAttributes<FilterSummaryComponent> & FilterSummaryProps, "ref" | "key" | "api" | "onSuspend" | "accessLevel" | "popupParams" | "teamSharingActivated" | "moduleInfo" | "onUnSuspend" | "summarisedColumn">>;
@@ -7,11 +7,12 @@ const react_redux_1 = require("react-redux");
7
7
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
8
8
  const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
9
9
  const TeamSharingRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/TeamSharingRedux"));
10
- const FilterRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/FilterRedux"));
10
+ const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
11
11
  const SummaryRowItem_1 = require("../Components/ModuleSummary/SummaryRowItem");
12
12
  const ModuleProfile_1 = require("../Components/ModuleProfile");
13
13
  const ButtonClear_1 = require("../Components/Buttons/ButtonClear");
14
14
  const UIHelper_1 = require("../UIHelper");
15
+ const LayoutRedux_1 = require("../../Redux/ActionsReducers/LayoutRedux");
15
16
  class FilterSummaryComponent extends React.Component {
16
17
  constructor(props) {
17
18
  super(props);
@@ -37,14 +38,14 @@ class FilterSummaryComponent extends React.Component {
37
38
  }
38
39
  }
39
40
  exports.FilterSummaryComponent = FilterSummaryComponent;
40
- function mapStateToProps(state, ownProps) {
41
+ function mapStateToProps(state) {
41
42
  return {
42
- ColumnFilters: state.Filter.ColumnFilters,
43
+ ColumnFilters: LayoutRedux_1.getColumnFilterSelector(state),
43
44
  };
44
45
  }
45
46
  function mapDispatchToProps(dispatch) {
46
47
  return {
47
- onClearFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterClear(columnFilter)),
48
+ onClearFilter: (columnFilter) => dispatch(LayoutRedux.LayoutColumnFilterClear(columnFilter)),
48
49
  onClearPopupParams: () => dispatch(PopupRedux.PopupClearParam()),
49
50
  onShare: (entity, config) => dispatch(TeamSharingRedux.TeamSharingShare(entity, ModuleConstants.FilterModuleId, config)),
50
51
  };
@@ -1,12 +1,12 @@
1
1
  import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
2
- import * as FilterRedux from '../../Redux/ActionsReducers/FilterRedux';
3
- import { ColumnFilter } from '../../PredefinedConfig/FilterState';
2
+ import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
4
3
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
5
4
  import { Entitlement } from '../../PredefinedConfig/Common/Entitlement';
6
5
  import * as React from 'react';
6
+ import { ColumnFilter } from '../../types';
7
7
  export interface FilterViewPanelComponentProps extends ViewPanelProps {
8
- onHideQuickFilterBar: () => FilterRedux.QuickFilterBarHideAction;
9
- onShowQuickFilterBar: () => FilterRedux.QuickFilterBarShowAction;
8
+ onHideQuickFilterBar: () => SystemRedux.SystemQuickFilterBarHideAction;
9
+ onShowQuickFilterBar: () => SystemRedux.SystemQuickFilterBarShowAction;
10
10
  ColumnFilters: ColumnFilter[];
11
11
  Columns: AdaptableColumn[];
12
12
  Entitlements: Entitlement[];
@@ -2,35 +2,32 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FilterViewPanelControl = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const FilterRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/FilterRedux"));
5
+ const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
6
6
  const React = tslib_1.__importStar(require("react"));
7
7
  const ActiveFiltersPanel_1 = require("./ActiveFiltersPanel");
8
8
  const rebass_1 = require("rebass");
9
9
  const ArrayExtensions_1 = require("../../Utilities/Extensions/ArrayExtensions");
10
10
  const AdaptablePopover_1 = require("../AdaptablePopover");
11
- const ButtonClear_1 = require("../Components/Buttons/ButtonClear");
12
11
  const CheckBox_1 = require("../../components/CheckBox");
13
12
  const react_redux_1 = require("react-redux");
13
+ const LayoutRedux_1 = require("../../Redux/ActionsReducers/LayoutRedux");
14
14
  class FilterViewPanelComponent extends React.Component {
15
15
  constructor(props) {
16
16
  super(props);
17
17
  }
18
18
  render() {
19
- const activeFiltersPanel = React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, null);
20
19
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
21
20
  return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Filter__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
22
- React.createElement(rebass_1.Flex, null, ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(this.props.ColumnFilters) && (React.createElement(React.Fragment, null,
23
- React.createElement(AdaptablePopover_1.AdaptablePopover, { popupPadding: 0, className: `ab-${elementType}__Filter__info`, headerText: "", bodyText: [activeFiltersPanel],
24
- // tooltipText={'Show Filter Details'}
25
- useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 }),
26
- React.createElement(ButtonClear_1.ButtonClear, { marginLeft: 1, marginBottom: 0, marginRight: 1, className: `ab-${elementType}__Filter__clear`, onClick: () => this.onClearFilters(), tooltip: "Clear Filters", disabled: this.props.ColumnFilters.length == 0, showText: this.props.viewType === 'ToolPanel' }, this.props.viewType === 'ToolPanel' && 'Clear')))),
21
+ React.createElement(rebass_1.Flex, null, ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(this.props.ColumnFilters) && (React.createElement(AdaptablePopover_1.AdaptablePopover, { popupPadding: 0, className: `ab-${elementType}__Filter__info`, headerText: "", bodyText: [React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, null)],
22
+ // tooltipText={'Show Filter Details'}
23
+ useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 }))),
27
24
  React.createElement(rebass_1.Flex, { alignItems: "center" }, this.props.api.filterApi.isQuickFilterAvailable() && (React.createElement(CheckBox_1.CheckBox, { className: `ab-${elementType}__Filter__active-check`, disabled: this.props.accessLevel === 'ReadOnly' ||
28
25
  this.props.api.internalApi.isGridInPivotMode(), marginTop: 0, marginBottom: 0, fontSize: 2, padding: 1, checked: this.props.IsQuickFilterVisible, onChange: (checked) => {
29
26
  checked ? this.props.onShowQuickFilterBar() : this.props.onHideQuickFilterBar();
30
27
  } }, "Show Quick Filter")))));
31
28
  }
32
29
  onClearFilters() {
33
- this.props.api.filterApi.clearAllColumnFilter();
30
+ this.props.api.filterApi.clearColumnFilters();
34
31
  }
35
32
  onClearColumnFilter(columnFilter) {
36
33
  this.props.api.filterApi.clearColumnFilterByColumn(columnFilter.ColumnId);
@@ -38,14 +35,14 @@ class FilterViewPanelComponent extends React.Component {
38
35
  }
39
36
  function mapStateToProps(state) {
40
37
  return {
41
- ColumnFilters: state.Filter.ColumnFilters,
42
- IsQuickFilterVisible: state.Filter.IsQuickFilterVisible,
38
+ ColumnFilters: LayoutRedux_1.getColumnFilterSelector(state),
39
+ IsQuickFilterVisible: state.System.IsQuickFilterVisible,
43
40
  };
44
41
  }
45
42
  function mapDispatchToProps(dispatch) {
46
43
  return {
47
- onHideQuickFilterBar: () => dispatch(FilterRedux.QuickFilterBarHide()),
48
- onShowQuickFilterBar: () => dispatch(FilterRedux.QuickFilterBarShow()),
44
+ onHideQuickFilterBar: () => dispatch(SystemRedux.SystemQuickFilterBarHide()),
45
+ onShowQuickFilterBar: () => dispatch(SystemRedux.SystemQuickFilterBarShow()),
49
46
  };
50
47
  }
51
48
  exports.FilterViewPanelControl = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(FilterViewPanelComponent);