@adaptabletools/adaptable 11.1.8 → 11.1.11

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 (203) hide show
  1. package/base.css +16 -0
  2. package/bundle.cjs.js +106 -106
  3. package/index.css +20 -0
  4. package/package.json +1 -1
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -1
  8. package/src/AdaptableOptions/AdaptableOptions.d.ts +1 -1
  9. package/src/AdaptableOptions/AlertOptions.d.ts +9 -2
  10. package/src/AdaptableOptions/FinancePluginOptions.d.ts +57 -16
  11. package/src/AdaptableOptions/GeneralOptions.d.ts +7 -0
  12. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +7 -0
  13. package/src/Api/AdaptableApi.d.ts +5 -0
  14. package/src/Api/CellSummaryApi.d.ts +8 -0
  15. package/src/Api/ColumnApi.d.ts +6 -1
  16. package/src/Api/ConfigApi.d.ts +9 -3
  17. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
  18. package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
  19. package/src/Api/Implementation/AlertApiImpl.js +32 -15
  20. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +2 -0
  21. package/src/Api/Implementation/CellSummaryApiImpl.js +34 -0
  22. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -1
  23. package/src/Api/Implementation/ColumnApiImpl.js +7 -3
  24. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -2
  25. package/src/Api/Implementation/ConfigApiImpl.js +8 -29
  26. package/src/Api/Implementation/InternalApiImpl.d.ts +2 -1
  27. package/src/Api/Implementation/InternalApiImpl.js +29 -7
  28. package/src/Api/Implementation/LayoutApiImpl.d.ts +5 -4
  29. package/src/Api/Implementation/LayoutApiImpl.js +13 -7
  30. package/src/Api/Implementation/QueryApiImpl.d.ts +1 -0
  31. package/src/Api/Implementation/QueryApiImpl.js +12 -0
  32. package/src/Api/Implementation/StatusBarApiImpl.d.ts +8 -0
  33. package/src/Api/Implementation/StatusBarApiImpl.js +17 -0
  34. package/src/Api/InternalApi.d.ts +2 -1
  35. package/src/Api/LayoutApi.d.ts +16 -9
  36. package/src/Api/QueryApi.d.ts +6 -0
  37. package/src/Api/StatusBarApi.d.ts +10 -0
  38. package/src/Api/StatusBarApi.js +2 -0
  39. package/src/PredefinedConfig/AdaptableState.d.ts +20 -8
  40. package/src/PredefinedConfig/Common/FDC3Context.d.ts +61 -29
  41. package/src/PredefinedConfig/Common/Types.d.ts +6 -3
  42. package/src/PredefinedConfig/Common/Types.js +32 -1
  43. package/src/PredefinedConfig/FlashingCellState.d.ts +1 -1
  44. package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
  45. package/src/PredefinedConfig/GridState.d.ts +1 -1
  46. package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
  47. package/src/PredefinedConfig/StatusBarState.d.ts +27 -0
  48. package/src/PredefinedConfig/StatusBarState.js +7 -0
  49. package/src/PredefinedConfig/ToolPanelState.d.ts +1 -1
  50. package/src/Redux/ActionsReducers/GridRedux.d.ts +2 -2
  51. package/src/Redux/ActionsReducers/GridRedux.js +4 -4
  52. package/src/Redux/ActionsReducers/StatusBarRedux.d.ts +22 -0
  53. package/src/Redux/ActionsReducers/StatusBarRedux.js +31 -0
  54. package/src/Redux/ActionsReducers/SystemRedux.d.ts +8 -3
  55. package/src/Redux/ActionsReducers/SystemRedux.js +22 -5
  56. package/src/Redux/Store/AdaptableReduxMerger.js +2 -2
  57. package/src/Redux/Store/AdaptableStore.js +24 -10
  58. package/src/Strategy/AlertModule.d.ts +3 -0
  59. package/src/Strategy/AlertModule.js +6 -0
  60. package/src/Strategy/CellSummaryModule.d.ts +6 -0
  61. package/src/Strategy/CellSummaryModule.js +14 -0
  62. package/src/Strategy/DataChangeHistoryModule.d.ts +7 -0
  63. package/src/Strategy/DataChangeHistoryModule.js +11 -0
  64. package/src/Strategy/ExportModule.d.ts +1 -0
  65. package/src/Strategy/ExportModule.js +1 -0
  66. package/src/Strategy/FilterModule.d.ts +6 -0
  67. package/src/Strategy/FilterModule.js +21 -0
  68. package/src/Strategy/Interface/IModule.d.ts +21 -10
  69. package/src/Strategy/LayoutModule.d.ts +7 -0
  70. package/src/Strategy/LayoutModule.js +14 -1
  71. package/src/Strategy/QueryModule.d.ts +8 -0
  72. package/src/Strategy/QueryModule.js +18 -0
  73. package/src/Strategy/QuickSearchModule.d.ts +6 -0
  74. package/src/Strategy/QuickSearchModule.js +10 -0
  75. package/src/Strategy/StatusBarModule.d.ts +8 -0
  76. package/src/Strategy/StatusBarModule.js +39 -0
  77. package/src/Strategy/SystemStatusModule.d.ts +6 -0
  78. package/src/Strategy/SystemStatusModule.js +10 -0
  79. package/src/Strategy/ThemeModule.d.ts +7 -0
  80. package/src/Strategy/ThemeModule.js +12 -0
  81. package/src/Strategy/Utilities/getAlertBehaviourViewItems.js +1 -1
  82. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  83. package/src/Utilities/Constants/GeneralConstants.js +2 -1
  84. package/src/Utilities/Constants/ModuleConstants.d.ts +1 -0
  85. package/src/Utilities/Constants/ModuleConstants.js +2 -1
  86. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +4 -1
  87. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
  88. package/src/Utilities/Services/ModuleService.js +6 -6
  89. package/src/View/AdaptablePopover/index.d.ts +1 -0
  90. package/src/View/AdaptablePopover/index.js +5 -2
  91. package/src/View/AdaptableViewFactory.js +2 -2
  92. package/src/View/Alert/AlertStatusSubPanel.d.ts +2 -0
  93. package/src/View/Alert/AlertStatusSubPanel.js +56 -0
  94. package/src/View/Alert/AlertViewPanel.js +6 -7
  95. package/src/View/Alert/AlertsPanel.d.ts +1 -1
  96. package/src/View/Alert/AlertsPanel.js +2 -1
  97. package/src/View/Alert/Utilities/getAlertButtonStyle.d.ts +5 -0
  98. package/src/View/Alert/Utilities/getAlertButtonStyle.js +15 -0
  99. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +18 -7
  100. package/src/View/Alert/Wizard/AlertButtonsEditor.js +1 -8
  101. package/src/View/Alert/Wizard/AlertWizard.js +3 -2
  102. package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.d.ts +2 -0
  103. package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +15 -0
  104. package/src/View/CellSummary/CellSummaryStatusPanel.d.ts +2 -0
  105. package/src/View/CellSummary/CellSummaryStatusPanel.js +36 -0
  106. package/src/View/CellSummary/CellSummaryViewPanel.js +2 -20
  107. package/src/View/ColorPicker.d.ts +1 -1
  108. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  109. package/src/View/Components/AdaptableInput/index.d.ts +1 -1
  110. package/src/View/Components/Buttons/ButtonDelete.d.ts +1 -1
  111. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +1 -1
  112. package/src/View/Components/Forms/AdaptableFormControlTextClear.d.ts +1 -1
  113. package/src/View/Components/Forms/AdaptableFormControlTextClear.js +1 -1
  114. package/src/View/Components/Panels/PanelWithImage.d.ts +6 -6
  115. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +5 -4
  116. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +1 -1
  117. package/src/View/Components/RangesComponent.js +6 -2
  118. package/src/View/Components/StyleComponent.js +18 -6
  119. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
  120. package/src/View/Components/ToolPanel/ToolPanelPopup.js +3 -3
  121. package/src/View/Dashboard/DashboardPopup.js +2 -2
  122. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +5 -13
  123. package/src/View/DataChangeHistory/DataChangeHistoryStatusBarContent.d.ts +2 -0
  124. package/src/View/DataChangeHistory/DataChangeHistoryStatusBarContent.js +9 -0
  125. package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.d.ts +4 -16
  126. package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +32 -40
  127. package/src/View/Filter/ActiveFiltersPanel.d.ts +0 -2
  128. package/src/View/Filter/FilterStatusBarSubPanelPopover.d.ts +2 -0
  129. package/src/View/Filter/FilterStatusBarSubPanelPopover.js +18 -0
  130. package/src/View/Filter/FilterViewPanel.js +1 -1
  131. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +1 -1
  132. package/src/View/GridInfo/GridInfoPopup.js +4 -1
  133. package/src/View/Layout/EditCurrentLayoutButton.d.ts +2 -0
  134. package/src/View/Layout/EditCurrentLayoutButton.js +14 -0
  135. package/src/View/Layout/LayoutPopup.d.ts +1 -1
  136. package/src/View/Layout/LayoutPopup.js +3 -3
  137. package/src/View/Layout/LayoutRadioSelector.d.ts +1 -0
  138. package/src/View/Layout/LayoutRadioSelector.js +2 -2
  139. package/src/View/Layout/LayoutStatusBarSubPanelPopover.d.ts +2 -0
  140. package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +29 -0
  141. package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +2 -1
  142. package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
  143. package/src/View/Layout/Wizard/LayoutEditorWizard.js +2 -1
  144. package/src/View/Query/EditCurrentQueryButton.d.ts +2 -0
  145. package/src/View/Query/EditCurrentQueryButton.js +15 -0
  146. package/src/View/Query/QueryViewPanel.d.ts +0 -1
  147. package/src/View/Query/QueryViewPanel.js +2 -11
  148. package/src/View/QuickSearch/QuickSearchPopup.js +1 -1
  149. package/src/View/QuickSearch/QuickSearchStatusBarContent.d.ts +2 -0
  150. package/src/View/QuickSearch/QuickSearchStatusBarContent.js +16 -0
  151. package/src/View/StateManagement/StateManagementPopup.js +9 -7
  152. package/src/View/StateManagement/StateManagementViewPanel.js +1 -2
  153. package/src/View/StateManagement/components/ExportDropdown.d.ts +1 -1
  154. package/src/View/StateManagement/components/ExportDropdown.js +3 -7
  155. package/src/View/StateManagement/handleExportState.d.ts +1 -1
  156. package/src/View/StatusBar/AdaptableStatusBar.d.ts +3 -0
  157. package/src/View/StatusBar/AdaptableStatusBar.js +44 -0
  158. package/src/View/StatusBar/StatusBarPanel.d.ts +42 -0
  159. package/src/View/StatusBar/StatusBarPanel.js +45 -0
  160. package/src/View/StatusBar/StatusBarPopup.d.ts +3 -0
  161. package/src/View/StatusBar/StatusBarPopup.js +43 -0
  162. package/src/View/SystemStatus/SystemStatusStatusBarContent.d.ts +2 -0
  163. package/src/View/SystemStatus/SystemStatusStatusBarContent.js +15 -0
  164. package/src/View/SystemStatus/SystemStatusViewPanel.js +3 -7
  165. package/src/View/SystemStatus/Utilities/getStatusItemStyle.d.ts +5 -0
  166. package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +16 -0
  167. package/src/View/Theme/ThemeStatusPanelPopover.d.ts +2 -0
  168. package/src/View/Theme/ThemeStatusPanelPopover.js +36 -0
  169. package/src/agGrid/Adaptable.d.ts +2 -0
  170. package/src/agGrid/Adaptable.js +30 -3
  171. package/src/agGrid/agGridHelper.js +2 -0
  172. package/src/agGrid/agGridMenuHelper.js +2 -2
  173. package/src/agGrid/createAgStatusPanelComponent.d.ts +21 -0
  174. package/src/agGrid/createAgStatusPanelComponent.js +31 -0
  175. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +1 -1
  176. package/src/components/Dashboard/DashboardManager.js +9 -162
  177. package/src/components/Datepicker/index.d.ts +1 -1
  178. package/src/components/DragAndDropContext/DragAndDropContext.d.ts +7 -0
  179. package/src/components/DragAndDropContext/DragAndDropContext.js +14 -0
  180. package/src/components/DragAndDropContext/ModuleManager.d.ts +17 -0
  181. package/src/components/DragAndDropContext/ModuleManager.js +81 -0
  182. package/src/components/DragAndDropContext/TabList.d.ts +29 -0
  183. package/src/components/DragAndDropContext/TabList.js +72 -0
  184. package/src/components/DragAndDropContext/UnusedPanel.d.ts +6 -0
  185. package/src/components/DragAndDropContext/UnusedPanel.js +46 -0
  186. package/src/components/DragAndDropContext/types.d.ts +8 -0
  187. package/src/components/DragAndDropContext/types.js +2 -0
  188. package/src/components/FormLayout/index.d.ts +1 -0
  189. package/src/components/Input/index.d.ts +1 -1
  190. package/src/components/List/ListGroupItem/index.d.ts +1 -1
  191. package/src/components/PopupWithFooter.d.ts +1 -1
  192. package/src/components/SimpleButton/index.js +3 -0
  193. package/src/components/Textarea/index.d.ts +1 -1
  194. package/src/components/icons/DefaultIcon.d.ts +2 -1
  195. package/src/components/icons/DefaultIcon.js +2 -2
  196. package/src/components/icons/index.js +2 -0
  197. package/src/components/icons/statusbar.d.ts +3 -0
  198. package/src/components/icons/statusbar.js +8 -0
  199. package/src/metamodel/adaptable.metamodel.d.ts +236 -0
  200. package/src/metamodel/adaptable.metamodel.js +467 -48
  201. package/src/types.d.ts +5 -4
  202. package/version.d.ts +1 -1
  203. package/version.js +1 -1
@@ -10,16 +10,7 @@ import { FreeTextColumn } from '../../PredefinedConfig/FreeTextColumnState';
10
10
  import { AdaptableOnePageWizardProps } from '../../View/Wizard/Interface/IAdaptableWizard';
11
11
  import * as Redux from 'redux';
12
12
  import { SuspendableObject } from '../../../types';
13
- /**
14
- * This is the interface that all Moduless implement (as well as all deriving from AdaptableModulesBase).
15
- * Each Module is responsible for creating popup and context menu items, providing an entitlement ( the default is 'Default') and initialising with Redux
16
- * Most Modules map to their own Reducer (e.g. QuickSearchModules => QuickSearchReducer)
17
- * However these Moduless DONT store any State:
18
- * Application
19
- * GridInfo
20
- * StateManagement
21
- * TeamSharing
22
- */
13
+ import { StatusBarPanelProps } from '../../View/StatusBar/StatusBarPanel';
23
14
  export interface ModuleInfo {
24
15
  ModuleName: AdaptableModule;
25
16
  FriendlyName: string;
@@ -86,6 +77,7 @@ export interface AdaptableModuleView {
86
77
  emptyView?: React.FunctionComponent<{
87
78
  module: IModule;
88
79
  }> | string;
80
+ newTooltipText?: string;
89
81
  /**
90
82
  * Specifieds the types of objects the module manages.
91
83
  * When specified the new button will have these options.
@@ -96,7 +88,22 @@ export interface AdaptableModuleView {
96
88
  accessLevel?: AccessLevel;
97
89
  }[];
98
90
  getEditWizard?(abObject?: AdaptableObject): React.FunctionComponent<AdaptableOnePageWizardProps<AdaptableObject>>;
91
+ /**
92
+ * Specify status panel props.
93
+ * Can be extended to include custom rendereres.
94
+ */
95
+ getStatusBarPanelProps?(): StatusBarPanelProps;
99
96
  }
97
+ /**
98
+ * This is the interface that all Moduless implement (as well as all deriving from AdaptableModulesBase).
99
+ * Each Module is responsible for creating popup and context menu items, providing an entitlement ( the default is 'Default') and initialising with Redux
100
+ * Most Modules map to their own Reducer (e.g. QuickSearchModules => QuickSearchReducer)
101
+ * However these Moduless DONT store any State:
102
+ * Application
103
+ * GridInfo
104
+ * StateManagement
105
+ * TeamSharing
106
+ */
100
107
  export interface IModule {
101
108
  moduleInfo: ModuleInfo;
102
109
  AccessLevel: AccessLevel;
@@ -114,6 +121,10 @@ export interface IModule {
114
121
  getModuleFreeTextColumnReferences(): FreeTextColumn[];
115
122
  getPopupMaxWidth(): number | undefined;
116
123
  updateOldConfig(): void;
124
+ /**
125
+ * The following view options are used to render adaptable objects and
126
+ * module general views.
127
+ */
117
128
  toView?: (abObject: AdaptableObject) => AdaptableObjectView;
118
129
  toViewAll?: () => AdaptableObjectView[];
119
130
  getViewProperties?: () => AdaptableModuleView;
@@ -35,8 +35,15 @@ export declare class LayoutModule extends AdaptableModuleBase implements IModule
35
35
  getViewProperties(): {
36
36
  actions: import("react").FunctionComponent<{
37
37
  data: Layout;
38
+ id?: string;
38
39
  }>[];
39
40
  getDeleteAction: (layout: Layout) => LayoutRedux.LayoutDeleteAction;
40
41
  onOpenEditPopup: (layout?: Layout) => void;
42
+ getStatusBarPanelProps: () => {
43
+ content: string;
44
+ popover: import("react").FunctionComponent<{}>;
45
+ popoverMinWidth: number;
46
+ extraActions: import("react").FunctionComponent<{}>[];
47
+ };
41
48
  };
42
49
  }
@@ -7,6 +7,8 @@ const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/Mod
7
7
  const LayoutRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/LayoutRedux"));
8
8
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
9
9
  const LayoutRadioSelector_1 = require("../View/Layout/LayoutRadioSelector");
10
+ const LayoutStatusBarSubPanelPopover_1 = require("../View/Layout/LayoutStatusBarSubPanelPopover");
11
+ const EditCurrentLayoutButton_1 = require("../View/Layout/EditCurrentLayoutButton");
10
12
  class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
11
13
  constructor(api) {
12
14
  super(ModuleConstants.LayoutModuleId, 'Layout', 'layout', 'LayoutPopup', 'Named sets of column visibility, order, groupings, aggregation, pivots etc.', api);
@@ -138,7 +140,7 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
138
140
  const columnIdToFriendlyName = (columnId) => {
139
141
  return this.api.columnApi.getFriendlyNameFromColumnId(columnId);
140
142
  };
141
- let columns = layout.Columns;
143
+ let columns = layout.Columns.filter((c) => !this.api.columnApi.isAutoRowGroupColumn(c)).filter((c) => !this.api.columnApi.isAutoPivotColumn(c));
142
144
  if (columns.length >
143
145
  maxColumnsToDisplay + 1 /* +1 is to show tag only beginning with 2, 'other 2' */) {
144
146
  const extraColumns = columns.length - maxColumnsToDisplay;
@@ -196,6 +198,17 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
196
198
  this.api.layoutApi.showLayoutEditor(layout.Name);
197
199
  }
198
200
  },
201
+ getStatusBarPanelProps: () => {
202
+ const text = this.api.layoutApi.getCurrentLayoutName();
203
+ const layouts = this.api.layoutApi.getAllLayout();
204
+ const popover = layouts.length > 1 ? LayoutStatusBarSubPanelPopover_1.LayoutStatusBarSubPanelPopover : null;
205
+ return {
206
+ content: text,
207
+ popover: popover,
208
+ popoverMinWidth: 150,
209
+ extraActions: [EditCurrentLayoutButton_1.EditCurrentLayoutButton],
210
+ };
211
+ },
199
212
  };
200
213
  }
201
214
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
3
  import * as QueryRedux from '../Redux/ActionsReducers/QueryRedux';
3
4
  import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
@@ -28,6 +29,13 @@ export declare class QueryModule extends AdaptableModuleBase implements IModule
28
29
  }[];
29
30
  getViewProperties(): {
30
31
  getDeleteAction: (namedQuery: NamedQuery) => QueryRedux.NamedQueryDeleteAction;
32
+ newTooltipText: string;
33
+ emptyView: string;
31
34
  getEditWizard: () => typeof NamedQueryWizard;
35
+ getStatusBarPanelProps: () => {
36
+ content: string;
37
+ extraActions: (() => JSX.Element)[];
38
+ popover: string;
39
+ };
32
40
  };
33
41
  }
@@ -6,6 +6,7 @@ const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
7
7
  const QueryRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/QueryRedux"));
8
8
  const NamedQueryWizard_1 = require("../View/Query/Wizard/NamedQueryWizard");
9
+ const EditCurrentQueryButton_1 = require("../View/Query/EditCurrentQueryButton");
9
10
  class QueryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
10
11
  constructor(api) {
11
12
  super(ModuleConstants.QueryModuleId, 'Query', 'query', 'QueryPopup', 'Run real-time text-based queries using a wealth of powerful functions and operators', api);
@@ -47,7 +48,24 @@ class QueryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
47
48
  getViewProperties() {
48
49
  return {
49
50
  getDeleteAction: QueryRedux.NamedQueryDelete,
51
+ newTooltipText: 'Create New Named Query',
52
+ emptyView: "Click 'New' to create a Named Query that can be referenced in other Expressions",
50
53
  getEditWizard: () => NamedQueryWizard_1.NamedQueryWizard,
54
+ getStatusBarPanelProps: () => {
55
+ const queryMaxLength = 15;
56
+ const query = this.api.queryApi.getCurrentQuery();
57
+ let text = query;
58
+ let popover = null;
59
+ if (query.length > queryMaxLength) {
60
+ text = query.substring(0, queryMaxLength - 3) + '...';
61
+ popover = query;
62
+ }
63
+ return {
64
+ content: text || 'No Query',
65
+ extraActions: [EditCurrentQueryButton_1.EditCurrentQueryButton],
66
+ popover,
67
+ };
68
+ },
51
69
  };
52
70
  }
53
71
  }
@@ -1,6 +1,12 @@
1
+ /// <reference types="react" />
1
2
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
3
  import { IModule } from './Interface/IModule';
3
4
  import { AdaptableApi } from '../Api/AdaptableApi';
4
5
  export declare class QuickSearchModule extends AdaptableModuleBase implements IModule {
5
6
  constructor(api: AdaptableApi);
7
+ getViewProperties(): {
8
+ getStatusBarPanelProps(): {
9
+ content: import("react").FunctionComponent<{}>;
10
+ };
11
+ };
6
12
  }
@@ -4,9 +4,19 @@ exports.QuickSearchModule = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
7
+ const QuickSearchStatusBarContent_1 = require("../View/QuickSearch/QuickSearchStatusBarContent");
7
8
  class QuickSearchModule extends AdaptableModuleBase_1.AdaptableModuleBase {
8
9
  constructor(api) {
9
10
  super(ModuleConstants.QuickSearchModuleId, 'Quick Search', 'quick-search', 'QuickSearchPopup', 'Quickly highlight all cells in the grid that contain matching query text', api);
10
11
  }
12
+ getViewProperties() {
13
+ return {
14
+ getStatusBarPanelProps() {
15
+ return {
16
+ content: QuickSearchStatusBarContent_1.QuickSearchStatusBarContent,
17
+ };
18
+ },
19
+ };
20
+ }
11
21
  }
12
22
  exports.QuickSearchModule = QuickSearchModule;
@@ -0,0 +1,8 @@
1
+ import { AdaptableModuleBase } from './AdaptableModuleBase';
2
+ import { IModule } from './Interface/IModule';
3
+ import { AdaptableApi } from '../Api/AdaptableApi';
4
+ export declare class StatusBarModule extends AdaptableModuleBase implements IModule {
5
+ constructor(api: AdaptableApi);
6
+ syncStateWithOptions(): void;
7
+ isModuleAvailable(): boolean;
8
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatusBarModule = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
6
+ const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
7
+ class StatusBarModule extends AdaptableModuleBase_1.AdaptableModuleBase {
8
+ constructor(api) {
9
+ super(ModuleConstants.StatusBarModuleId, 'Status Bar', 'statusbar', 'StatusBarPopup', 'Configure AdapTable Status Bar', api);
10
+ }
11
+ syncStateWithOptions() {
12
+ const agGridStatusPanels = this.api.statusBarApi.getAgGridStatusPanels();
13
+ const statusPanelsState = this.api.statusBarApi.getStatusPanels();
14
+ /**
15
+ * Grid config determines how many adaptable status panels are rendered.
16
+ * This dictates the state.
17
+ * - if a status panel is removed from ag-grid, it's sub-panels are made available;
18
+ * - if a new status panel is added it is added to state with an empty list
19
+ */
20
+ const newStatusPanelsState = agGridStatusPanels.map((agGridStatusPanel) => {
21
+ let statusPanelState = statusPanelsState.find((statusPanel) => statusPanel.Key === agGridStatusPanel.key);
22
+ // no state found
23
+ if (!statusPanelState) {
24
+ statusPanelState = {
25
+ Key: agGridStatusPanel.key,
26
+ StatusBarPanels: [],
27
+ };
28
+ }
29
+ return statusPanelState;
30
+ });
31
+ this.api.statusBarApi.setStatusPanels(newStatusPanelsState);
32
+ }
33
+ isModuleAvailable() {
34
+ return false;
35
+ // TODO: replace with this like when we release Status Bar properly
36
+ // return super.isModuleAvailable() && this.api.statusBarApi.getAgGridStatusPanels().length > 0;
37
+ }
38
+ }
39
+ exports.StatusBarModule = StatusBarModule;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
3
  import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
3
4
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
@@ -7,4 +8,9 @@ export declare class SystemStatusModule extends AdaptableModuleBase implements I
7
8
  constructor(api: AdaptableApi);
8
9
  addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
9
10
  addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
11
+ getViewProperties(): {
12
+ getStatusBarPanelProps: () => {
13
+ content: import("react").FunctionComponent<{}>;
14
+ };
15
+ };
10
16
  }
@@ -4,6 +4,7 @@ exports.SystemStatusModule = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
7
+ const SystemStatusStatusBarContent_1 = require("../View/SystemStatus/SystemStatusStatusBarContent");
7
8
  class SystemStatusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
8
9
  constructor(api) {
9
10
  super(ModuleConstants.SystemStatusModuleId, 'System Status', 'system-status', 'SystemStatusPopup', 'Provide messages about the Status of your application', api);
@@ -30,5 +31,14 @@ class SystemStatusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
30
31
  ];
31
32
  }
32
33
  }
34
+ getViewProperties() {
35
+ return {
36
+ getStatusBarPanelProps: () => {
37
+ return {
38
+ content: SystemStatusStatusBarContent_1.SystemStatusStatusBarContent,
39
+ };
40
+ },
41
+ };
42
+ }
33
43
  }
34
44
  exports.SystemStatusModule = SystemStatusModule;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
3
  import { IModule } from './Interface/IModule';
3
4
  import { AdaptableApi } from '../Api/AdaptableApi';
@@ -6,4 +7,10 @@ export declare class ThemeModule extends AdaptableModuleBase implements IModule
6
7
  constructor(api: AdaptableApi);
7
8
  getModuleAdaptableObjects(): AdaptableObject[];
8
9
  hasNamedQueryReferences(): boolean;
10
+ getViewProperties(): {
11
+ getStatusBarPanelProps: () => {
12
+ content: string;
13
+ popover: import("react").FunctionComponent<{}>;
14
+ };
15
+ };
9
16
  }
@@ -4,6 +4,7 @@ exports.ThemeModule = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
7
+ const ThemeStatusPanelPopover_1 = require("../View/Theme/ThemeStatusPanelPopover");
7
8
  class ThemeModule extends AdaptableModuleBase_1.AdaptableModuleBase {
8
9
  constructor(api) {
9
10
  super(ModuleConstants.ThemeModuleId, 'Theme', 'theme', 'ThemePopup', 'Theme AdapTable with a colour configuration set of your choosing', api);
@@ -14,5 +15,16 @@ class ThemeModule extends AdaptableModuleBase_1.AdaptableModuleBase {
14
15
  hasNamedQueryReferences() {
15
16
  return false;
16
17
  }
18
+ getViewProperties() {
19
+ return {
20
+ getStatusBarPanelProps: () => {
21
+ const currentTheme = this.api.themeApi.getCurrentTheme();
22
+ return {
23
+ content: currentTheme,
24
+ popover: ThemeStatusPanelPopover_1.ThemeStatusPanelPopover,
25
+ };
26
+ },
27
+ };
28
+ }
17
29
  }
18
30
  exports.ThemeModule = ThemeModule;
@@ -9,7 +9,7 @@ const BehaviourView = (props) => {
9
9
  };
10
10
  exports.getAlertBehaviourViewItems = () => {
11
11
  return {
12
- name: 'Behaviour',
12
+ name: AdaptableContext_1.useAdaptable().api.internalApi.getCorrectEnglishVariant('Behaviour'),
13
13
  view: BehaviourView,
14
14
  };
15
15
  };
@@ -20,6 +20,7 @@ export declare const EMPTY_ARRAY: any[];
20
20
  export declare const AB_SPECIAL_COLUMN = "abSpecialColumn";
21
21
  export declare const HALF_SECOND: number;
22
22
  export declare const AG_GRID_GROUPED_COLUMN: string;
23
+ export declare const AG_GRID_PIVOT_COLUMN: string;
23
24
  export declare const SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE: number;
24
25
  export declare const QUICK_SEARCH_DEFAULT_BACK_COLOR: string;
25
26
  export declare const QUICK_SEARCH_DEFAULT_FORE_COLOR: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_DATA_SOURCE_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = exports.ALERT_DEFAULT_SHOW_POPUP = exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.AG_GRID_GROUPED_COLUMN = exports.HALF_SECOND = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.FILTER_THROTTLE = exports.FILTER_NEVER = exports.FILTER_ALWAYS = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
3
+ exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_DATA_SOURCE_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = exports.ALERT_DEFAULT_SHOW_POPUP = exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.HALF_SECOND = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.FILTER_THROTTLE = exports.FILTER_NEVER = exports.FILTER_ALWAYS = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
4
4
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
5
5
  const UIHelper_1 = require("../../View/UIHelper");
6
6
  exports.AUTOGENERATED_PK_COLUMN = '__ADAPTABLE_PK__';
@@ -22,6 +22,7 @@ exports.EMPTY_ARRAY = [];
22
22
  exports.AB_SPECIAL_COLUMN = 'abSpecialColumn';
23
23
  exports.HALF_SECOND = 500;
24
24
  exports.AG_GRID_GROUPED_COLUMN = 'ag-Grid-AutoColumn';
25
+ exports.AG_GRID_PIVOT_COLUMN = 'pivot_';
25
26
  /*
26
27
  Redux / State Defaults
27
28
  Try to put all our Redux / State defaults here and ONLY reference from here - avoid magic numbers / strings.
@@ -31,3 +31,4 @@ export declare const TeamSharingModuleId: ModuleConstants;
31
31
  export declare const ThemeModuleId: ModuleConstants;
32
32
  export declare const ToolPanelModuleId: ModuleConstants;
33
33
  export declare const SettingsPanelModuleId: ModuleConstants;
34
+ export declare const StatusBarModuleId: ModuleConstants;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SettingsPanelModuleId = exports.ToolPanelModuleId = exports.ThemeModuleId = exports.TeamSharingModuleId = exports.SystemStatusModuleId = exports.StateManagementModuleId = exports.SmartEditModuleId = exports.ShortcutModuleId = exports.ScheduleModuleId = exports.QuickSearchModuleId = exports.QueryModuleId = exports.PlusMinusModuleId = exports.OpenFinModuleId = exports.LayoutModuleId = exports.IPushPullModuleId = exports.GridInfoModuleId = exports.Glue42ModuleId = exports.FreeTextColumnModuleId = exports.FormatColumnModuleId = exports.FilterModuleId = exports.ExportModuleId = exports.DataSourceModuleId = exports.DataChangeHistoryModuleId = exports.DashboardModuleId = exports.CustomSortModuleId = exports.ConditionalStyleModuleId = exports.ChartingModuleId = exports.CellSummaryModuleId = exports.CalculatedColumnModuleId = exports.BulkUpdateModuleId = exports.FlashingCellModuleId = exports.AlertModuleId = void 0;
3
+ exports.StatusBarModuleId = exports.SettingsPanelModuleId = exports.ToolPanelModuleId = exports.ThemeModuleId = exports.TeamSharingModuleId = exports.SystemStatusModuleId = exports.StateManagementModuleId = exports.SmartEditModuleId = exports.ShortcutModuleId = exports.ScheduleModuleId = exports.QuickSearchModuleId = exports.QueryModuleId = exports.PlusMinusModuleId = exports.OpenFinModuleId = exports.LayoutModuleId = exports.IPushPullModuleId = exports.GridInfoModuleId = exports.Glue42ModuleId = exports.FreeTextColumnModuleId = exports.FormatColumnModuleId = exports.FilterModuleId = exports.ExportModuleId = exports.DataSourceModuleId = exports.DataChangeHistoryModuleId = exports.DashboardModuleId = exports.CustomSortModuleId = exports.ConditionalStyleModuleId = exports.ChartingModuleId = exports.CellSummaryModuleId = exports.CalculatedColumnModuleId = exports.BulkUpdateModuleId = exports.FlashingCellModuleId = exports.AlertModuleId = void 0;
4
4
  exports.AlertModuleId = 'Alert';
5
5
  exports.FlashingCellModuleId = 'FlashingCell';
6
6
  exports.BulkUpdateModuleId = 'BulkUpdate';
@@ -33,3 +33,4 @@ exports.TeamSharingModuleId = 'TeamSharing';
33
33
  exports.ThemeModuleId = 'Theme';
34
34
  exports.ToolPanelModuleId = 'ToolPanel';
35
35
  exports.SettingsPanelModuleId = 'SettingsPanel';
36
+ exports.StatusBarModuleId = 'StatusBar';
@@ -23,7 +23,8 @@ exports.DefaultAdaptableOptions = {
23
23
  alertOptions: {
24
24
  alertForms: undefined,
25
25
  maxAlertsInStore: 20,
26
- cellHighlightDuration: 3000,
26
+ cellHighlightDuration: 2000,
27
+ rowHighlightDuration: 4000,
27
28
  dataChangeDetectionPolicy: 'rawValue',
28
29
  actionHandlers: undefined,
29
30
  },
@@ -123,6 +124,7 @@ exports.DefaultAdaptableOptions = {
123
124
  currentCalendar: 'United Kingdom',
124
125
  cellSummaryOperations: undefined,
125
126
  customSortComparers: undefined,
127
+ englishVariant: 'GB',
126
128
  },
127
129
  layoutOptions: {
128
130
  includeExpandedRowGroups: false,
@@ -214,6 +216,7 @@ exports.DefaultAdaptableOptions = {
214
216
  actionColumns: undefined,
215
217
  showDocumentationLinks: true,
216
218
  gridInfoSections: ['GridSummary', 'AdaptableOptions', 'ColumnInfo'],
219
+ showAdapTableVersion: true,
217
220
  },
218
221
  toolPanelOptions: {
219
222
  showAdaptableToolPanel: true,
@@ -13,6 +13,7 @@ exports.DEFAULT_NAVIGATION_ITEMS = [
13
13
  'GridInfo',
14
14
  'Dashboard',
15
15
  'ToolPanel',
16
+ 'StatusBar',
16
17
  'StateManagement',
17
18
  '-',
18
19
  'Alert',
@@ -10,13 +10,13 @@ class ModuleService {
10
10
  this.adaptableApi = adaptableApi;
11
11
  }
12
12
  createModuleMenus() {
13
- const dropdownMenuItems = [];
13
+ const settingsPanelMenuItems = [];
14
14
  const buttonMenuItems = [];
15
15
  this.getModuleCollection().forEach((module) => {
16
- const dropdownMenuItem = module.addModuleMenuItem('ModuleMenu');
17
- if (Helper_1.default.objectExists(dropdownMenuItem)) {
18
- if (dropdownMenuItems.findIndex((m) => m.module == dropdownMenuItem.module) == -1) {
19
- dropdownMenuItems.push(dropdownMenuItem);
16
+ const settingsPanelMenuItem = module.addModuleMenuItem('ModuleMenu');
17
+ if (Helper_1.default.objectExists(settingsPanelMenuItem)) {
18
+ if (settingsPanelMenuItems.findIndex((m) => m.module == settingsPanelMenuItem.module) == -1) {
19
+ settingsPanelMenuItems.push(settingsPanelMenuItem);
20
20
  }
21
21
  }
22
22
  const buttonMenuItem = module.addModuleMenuItem('ModuleButton');
@@ -27,7 +27,7 @@ class ModuleService {
27
27
  }
28
28
  });
29
29
  // store the main menu as we will re-use (and it never changes)
30
- this.adaptableApi.internalApi.setModuleDropdownMenuItems(dropdownMenuItems);
30
+ this.adaptableApi.internalApi.setSettingPanelModuleMenuItems(settingsPanelMenuItems);
31
31
  this.adaptableApi.internalApi.setModuleButtonMenuItems(buttonMenuItems);
32
32
  }
33
33
  isModuleAvailable(adaptableModule) {
@@ -6,6 +6,7 @@ export interface AdaptablePopoverProps extends React.ClassAttributes<AdaptablePo
6
6
  hideEvent?: string;
7
7
  className?: string;
8
8
  bodyText: any[];
9
+ showIcon?: boolean;
9
10
  MessageType?: AdaptableMessageType;
10
11
  triggerAction?: string;
11
12
  useButton?: boolean;
@@ -11,7 +11,9 @@ const OverlayTrigger_1 = tslib_1.__importDefault(require("../../components/Overl
11
11
  const rebass_1 = require("rebass");
12
12
  class AdaptablePopover extends React.Component {
13
13
  render() {
14
+ var _a;
14
15
  let messageType = this.props.MessageType != null ? this.props.MessageType : 'Info';
16
+ const showIcon = (_a = this.props.showIcon) !== null && _a !== void 0 ? _a : true;
15
17
  let useButton = this.props.useButton != null ? this.props.useButton : false;
16
18
  let popoverMinWidth = this.props.popoverMinWidth != null ? this.props.popoverMinWidth.toString() + 'px' : 'auto';
17
19
  const title = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.headerText)
@@ -35,8 +37,9 @@ class AdaptablePopover extends React.Component {
35
37
  return (React.createElement(rebass_1.Flex, { alignItems: "center", className: this.props.className },
36
38
  React.createElement(OverlayTrigger_1.default, { showTriangle: true, render: () => popoverClickRootClose, showEvent: (this.props.showEvent || 'mouseenter'), hideEvent: (this.props.hideEvent || 'mouseleave'), style: {
37
39
  overflow: 'visible',
38
- }, defaultZIndex: 100000 }, useButton ? (React.createElement(ButtonInfo_1.ButtonInfo, { style: iconStyle, onClick: () => null, icon: icon, tooltip: this.props.tooltipText })) : (React.createElement("div", { tabIndex: 0, style: { cursor: 'pointer', display: 'inline-block' } },
39
- React.createElement(icons_1.Icon, { name: icon }))))));
40
+ }, defaultZIndex: 100000 }, useButton ? (React.createElement(ButtonInfo_1.ButtonInfo, { style: iconStyle, onClick: () => null, icon: showIcon && icon, tooltip: this.props.tooltipText }, this.props.children)) : (React.createElement("div", { tabIndex: 0, style: { cursor: 'pointer', display: 'inline-block' } },
41
+ this.props.children,
42
+ showIcon && React.createElement(icons_1.Icon, { name: icon }))))));
40
43
  }
41
44
  }
42
45
  exports.AdaptablePopover = AdaptablePopover;
@@ -30,13 +30,13 @@ const DataSourceViewPanel_1 = require("./DataSource/DataSourceViewPanel");
30
30
  const DataChangeHistoryPopup_1 = require("./DataChangeHistory/DataChangeHistoryPopup");
31
31
  const DataChangeHistoryViewPanel_1 = require("./DataChangeHistory/DataChangeHistoryViewPanel");
32
32
  const StateManagementViewPanel_1 = require("./StateManagement/StateManagementViewPanel");
33
+ const StatusBarPopup_1 = require("./StatusBar/StatusBarPopup");
33
34
  exports.AdaptableViewFactory = {
34
- // ExpandedQueryPopup,
35
35
  BulkUpdatePopup: BulkUpdatePopup_1.BulkUpdatePopup,
36
36
  DashboardPopup: DashboardPopup_1.DashboardPopup,
37
37
  StateManagementPopup: StateManagementPopup_1.StateManagementPopup,
38
38
  GridInfoPopup: GridInfoPopup_1.GridInfoPopup,
39
- // LayoutPopup,
39
+ StatusBarPopup: StatusBarPopup_1.StatusBarPopup,
40
40
  QuickSearchPopup: QuickSearchPopup_1.QuickSearchPopup,
41
41
  CellSummaryPopup: CellSummaryPopup_1.CellSummaryPopup,
42
42
  SmartEditPopup: SmartEditPopup_1.SmartEditPopup,
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const AlertStatusPanel: () => JSX.Element;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlertStatusPanel = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const react_redux_1 = require("react-redux");
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ const AlertsPanel_1 = require("./AlertsPanel");
9
+ const getAlertButtonStyle_1 = require("./Utilities/getAlertButtonStyle");
10
+ const StatusBarPanel_1 = require("../StatusBar/StatusBarPanel");
11
+ const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
12
+ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
13
+ const initialStyle = { color: '', background: '' };
14
+ exports.AlertStatusPanel = () => {
15
+ const adaptable = AdaptableContext_1.useAdaptable();
16
+ const [style, setStyle] = React.useState(initialStyle);
17
+ const dispatch = react_redux_1.useDispatch();
18
+ const module = adaptable.ModuleService.getModuleById(ModuleConstants.AlertModuleId);
19
+ /**
20
+ * Using a selector to so the component updates each time an alert is triggered.
21
+ */
22
+ const alerts = react_redux_1.useSelector((state) => state.System.AdaptableAlerts);
23
+ const text = alerts.length == 0 ? '0 Alerts' : alerts.length == 1 ? '1 Alert' : alerts.length + ' Alerts';
24
+ const handleAction = React.useCallback(() => adaptable.api.alertApi.showAlertPopup(), []);
25
+ // blinking logic
26
+ const previousAlerts = React.useRef(alerts);
27
+ const timeoutId = React.useRef();
28
+ React.useEffect(() => {
29
+ const noNewAlerts = previousAlerts.current.length === alerts.length;
30
+ previousAlerts.current = alerts;
31
+ if (!alerts.length) {
32
+ return;
33
+ }
34
+ if (noNewAlerts) {
35
+ return;
36
+ }
37
+ const { color, background } = getAlertButtonStyle_1.getAlertButtonStyle(alerts);
38
+ setStyle({ color, background });
39
+ if (timeoutId.current) {
40
+ clearTimeout(timeoutId.current);
41
+ timeoutId.current = null;
42
+ }
43
+ /**
44
+ * Cannot clear timeout in the useEffect cleanup function, because this logic is not
45
+ * called for each case. e.g. it is skipped for when alerts are not added.
46
+ */
47
+ timeoutId.current = setTimeout(() => {
48
+ setStyle(initialStyle);
49
+ }, 2000);
50
+ }, [alerts]);
51
+ // Dropdown content
52
+ const handleDeleteAlert = React.useCallback((alert) => dispatch(SystemRedux.SystemAlertDelete(alert)), []);
53
+ const handleDeleteAllAlerts = React.useCallback((alerts) => dispatch(SystemRedux.SystemAlertDeleteAll(alerts)), []);
54
+ let alertsPanel = (React.createElement(AlertsPanel_1.AlertsPanel, { Alerts: alerts, ShowPanel: true, ShowHeader: false, onClearAlert: handleDeleteAlert, onClearAllAlerts: handleDeleteAllAlerts }));
55
+ return (React.createElement(StatusBarPanel_1.StatusBarPanel, { "data-name": module.moduleInfo.ModuleName, color: style.color, backgroundColor: style.background, onAction: handleAction, icon: module.moduleInfo.Glyph, popover: alerts.length ? alertsPanel : null, content: text }));
56
+ };
@@ -9,6 +9,7 @@ const AdaptablePopover_1 = require("../AdaptablePopover");
9
9
  const AlertsPanel_1 = require("./AlertsPanel");
10
10
  const rebass_1 = require("rebass");
11
11
  const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
12
+ const getAlertButtonStyle_1 = require("./Utilities/getAlertButtonStyle");
12
13
  class AlertViewPanelComponent extends React.Component {
13
14
  constructor(props) {
14
15
  super(props);
@@ -23,19 +24,17 @@ class AlertViewPanelComponent extends React.Component {
23
24
  }
24
25
  }
25
26
  render() {
26
- let messageType = UIHelper_1.default.getMessageTypeFromAdaptableAlerts(this.props.AdaptableAlerts);
27
- let messageTypeColor = UIHelper_1.default.getColorByMessageType(messageType);
28
- let alertsPanel = (React.createElement(AlertsPanel_1.AlertsPanel, { Alerts: this.props.AdaptableAlerts, ShowPanel: true, ShowHeader: false, onClearAlert: this.props.onDeleteAlert, onRender: () => this.setState({ ShowMessage: false }), onClearAllAlerts: this.props.onDeleteAllAlert }));
29
- let collapsedText = this.props.AdaptableAlerts.length == 0
27
+ const messageType = UIHelper_1.default.getMessageTypeFromAdaptableAlerts(this.props.AdaptableAlerts);
28
+ const { color: buttonTextColor, background: buttonBackground } = getAlertButtonStyle_1.getAlertButtonStyle(this.props.AdaptableAlerts);
29
+ const collapsedText = this.props.AdaptableAlerts.length == 0
30
30
  ? '0 Alerts'
31
31
  : this.props.AdaptableAlerts.length == 1
32
32
  ? '1 Alert'
33
33
  : this.props.AdaptableAlerts.length + ' Alerts';
34
- let buttonColor = UIHelper_1.default.getButtonColourForAdaptableAlerts(this.props.AdaptableAlerts, messageTypeColor);
35
- let buttonTextColor = UIHelper_1.default.getButtonTextColourForArrayandMessageType(this.props.AdaptableAlerts, messageType);
34
+ const alertsPanel = (React.createElement(AlertsPanel_1.AlertsPanel, { Alerts: this.props.AdaptableAlerts, ShowPanel: true, ShowHeader: false, onClearAlert: this.props.onDeleteAlert, onRender: () => this.setState({ ShowMessage: false }), onClearAllAlerts: this.props.onDeleteAllAlert }));
36
35
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
37
36
  return (React.createElement(rebass_1.Flex, { alignItems: "stretch", className: `ab-${elementType}__Alert__wrap` },
38
- React.createElement(rebass_1.Flex, { style: { borderRadius: 'var(--ab__border-radius)' }, className: `ab-${elementType}__Alert__text`, marginRight: 2, padding: 2, color: buttonTextColor, backgroundColor: buttonColor, fontSize: 'var( --ab-font-size-2)', alignItems: "center" }, collapsedText),
37
+ React.createElement(rebass_1.Flex, { style: { borderRadius: 'var(--ab__border-radius)' }, className: `ab-${elementType}__Alert__text`, marginRight: 2, padding: 2, color: buttonTextColor, backgroundColor: buttonBackground, fontSize: 'var( --ab-font-size-2)', alignItems: "center" }, collapsedText),
39
38
  this.props.AdaptableAlerts.length > 0 && (React.createElement(rebass_1.Flex, { alignItems: "center" },
40
39
  React.createElement(AdaptablePopover_1.AdaptablePopover, { className: `ab-${elementType}__Alert__info`, headerText: "",
41
40
  // tooltipText="Alerts"
@@ -6,7 +6,7 @@ export interface AlertsPanelProps extends React.ClassAttributes<AlertsPanel> {
6
6
  ShowHeader: boolean;
7
7
  onClearAlert: (alert: AdaptableAlert) => void;
8
8
  onClearAllAlerts: (alerts: AdaptableAlert[]) => void;
9
- onRender: () => void;
9
+ onRender?: () => void;
10
10
  }
11
11
  export declare class AlertsPanel extends React.Component<AlertsPanelProps, {}> {
12
12
  componentWillUnmount(): void;
@@ -14,7 +14,8 @@ const ListGroup_1 = tslib_1.__importDefault(require("../../components/List/ListG
14
14
  const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
15
15
  class AlertsPanel extends React.Component {
16
16
  componentWillUnmount() {
17
- this.props.onRender();
17
+ var _a, _b;
18
+ (_b = (_a = this.props).onRender) === null || _b === void 0 ? void 0 : _b.call(_a);
18
19
  }
19
20
  render() {
20
21
  let alerts = this.props.Alerts.map((alert, index) => {
@@ -0,0 +1,5 @@
1
+ import { AdaptableAlert } from '../../../../types';
2
+ export declare const getAlertButtonStyle: (alerts: AdaptableAlert[]) => {
3
+ color: string;
4
+ background: string;
5
+ };