@adaptabletools/adaptable 11.1.6 → 11.1.9

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 (184) 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 +58 -17
  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/Implementation/AdaptableApiImpl.d.ts +2 -0
  16. package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
  17. package/src/Api/Implementation/AlertApiImpl.js +32 -15
  18. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +2 -0
  19. package/src/Api/Implementation/CellSummaryApiImpl.js +34 -0
  20. package/src/Api/Implementation/ConfigApiImpl.js +3 -0
  21. package/src/Api/Implementation/GridApiImpl.js +0 -4
  22. package/src/Api/Implementation/InternalApiImpl.d.ts +2 -1
  23. package/src/Api/Implementation/InternalApiImpl.js +29 -7
  24. package/src/Api/Implementation/QueryApiImpl.d.ts +1 -0
  25. package/src/Api/Implementation/QueryApiImpl.js +12 -0
  26. package/src/Api/Implementation/StatusBarApiImpl.d.ts +8 -0
  27. package/src/Api/Implementation/StatusBarApiImpl.js +17 -0
  28. package/src/Api/InternalApi.d.ts +2 -1
  29. package/src/Api/QueryApi.d.ts +6 -0
  30. package/src/Api/StatusBarApi.d.ts +10 -0
  31. package/src/Api/StatusBarApi.js +2 -0
  32. package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
  33. package/src/PredefinedConfig/Common/FDC3Context.d.ts +61 -29
  34. package/src/PredefinedConfig/Common/Types.d.ts +4 -2
  35. package/src/PredefinedConfig/Common/Types.js +32 -1
  36. package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
  37. package/src/PredefinedConfig/GridState.d.ts +1 -1
  38. package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
  39. package/src/PredefinedConfig/StatusBarState.d.ts +27 -0
  40. package/src/PredefinedConfig/StatusBarState.js +7 -0
  41. package/src/PredefinedConfig/ToolPanelState.d.ts +1 -1
  42. package/src/Redux/ActionsReducers/GridRedux.d.ts +2 -2
  43. package/src/Redux/ActionsReducers/GridRedux.js +4 -4
  44. package/src/Redux/ActionsReducers/StatusBarRedux.d.ts +22 -0
  45. package/src/Redux/ActionsReducers/StatusBarRedux.js +31 -0
  46. package/src/Redux/ActionsReducers/SystemRedux.d.ts +8 -3
  47. package/src/Redux/ActionsReducers/SystemRedux.js +22 -5
  48. package/src/Redux/Store/AdaptableReduxMerger.js +2 -2
  49. package/src/Redux/Store/AdaptableStore.js +24 -10
  50. package/src/Strategy/AlertModule.d.ts +3 -0
  51. package/src/Strategy/AlertModule.js +6 -0
  52. package/src/Strategy/CellSummaryModule.d.ts +6 -0
  53. package/src/Strategy/CellSummaryModule.js +14 -0
  54. package/src/Strategy/DataChangeHistoryModule.d.ts +7 -0
  55. package/src/Strategy/DataChangeHistoryModule.js +11 -0
  56. package/src/Strategy/ExportModule.d.ts +1 -0
  57. package/src/Strategy/ExportModule.js +1 -0
  58. package/src/Strategy/FilterModule.d.ts +6 -0
  59. package/src/Strategy/FilterModule.js +21 -0
  60. package/src/Strategy/Interface/IModule.d.ts +21 -10
  61. package/src/Strategy/LayoutModule.d.ts +7 -0
  62. package/src/Strategy/LayoutModule.js +13 -0
  63. package/src/Strategy/QueryModule.d.ts +8 -0
  64. package/src/Strategy/QueryModule.js +18 -0
  65. package/src/Strategy/QuickSearchModule.d.ts +6 -0
  66. package/src/Strategy/QuickSearchModule.js +10 -0
  67. package/src/Strategy/StatusBarModule.d.ts +8 -0
  68. package/src/Strategy/StatusBarModule.js +39 -0
  69. package/src/Strategy/SystemStatusModule.d.ts +6 -0
  70. package/src/Strategy/SystemStatusModule.js +10 -0
  71. package/src/Strategy/ThemeModule.d.ts +7 -0
  72. package/src/Strategy/ThemeModule.js +12 -0
  73. package/src/Strategy/Utilities/getAlertBehaviourViewItems.js +1 -1
  74. package/src/Utilities/Constants/ModuleConstants.d.ts +1 -0
  75. package/src/Utilities/Constants/ModuleConstants.js +2 -1
  76. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +4 -1
  77. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
  78. package/src/Utilities/Services/ModuleService.js +6 -6
  79. package/src/View/AdaptablePopover/index.d.ts +1 -0
  80. package/src/View/AdaptablePopover/index.js +5 -2
  81. package/src/View/AdaptableViewFactory.js +2 -2
  82. package/src/View/Alert/AlertStatusSubPanel.d.ts +2 -0
  83. package/src/View/Alert/AlertStatusSubPanel.js +56 -0
  84. package/src/View/Alert/AlertViewPanel.js +6 -7
  85. package/src/View/Alert/AlertsPanel.d.ts +1 -1
  86. package/src/View/Alert/AlertsPanel.js +2 -1
  87. package/src/View/Alert/Utilities/getAlertButtonStyle.d.ts +5 -0
  88. package/src/View/Alert/Utilities/getAlertButtonStyle.js +15 -0
  89. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +18 -7
  90. package/src/View/Alert/Wizard/AlertButtonsEditor.js +1 -8
  91. package/src/View/Alert/Wizard/AlertWizard.js +3 -2
  92. package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.d.ts +2 -0
  93. package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +15 -0
  94. package/src/View/CellSummary/CellSummaryStatusPanel.d.ts +2 -0
  95. package/src/View/CellSummary/CellSummaryStatusPanel.js +36 -0
  96. package/src/View/CellSummary/CellSummaryViewPanel.js +2 -20
  97. package/src/View/ColorPicker.d.ts +1 -1
  98. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  99. package/src/View/Components/AdaptableInput/index.d.ts +1 -1
  100. package/src/View/Components/Buttons/ButtonDelete.d.ts +1 -1
  101. package/src/View/Components/Forms/AdaptableFormControlTextClear.d.ts +1 -1
  102. package/src/View/Components/Forms/AdaptableFormControlTextClear.js +1 -1
  103. package/src/View/Components/Panels/PanelWithImage.d.ts +2 -2
  104. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +6 -5
  105. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +1 -1
  106. package/src/View/Components/RangesComponent.js +6 -2
  107. package/src/View/Components/StyleComponent.js +18 -6
  108. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
  109. package/src/View/Components/ToolPanel/ToolPanelPopup.js +3 -3
  110. package/src/View/Dashboard/DashboardPopup.js +2 -2
  111. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +5 -13
  112. package/src/View/DataChangeHistory/DataChangeHistoryStatusBarContent.d.ts +2 -0
  113. package/src/View/DataChangeHistory/DataChangeHistoryStatusBarContent.js +9 -0
  114. package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.d.ts +4 -16
  115. package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +32 -40
  116. package/src/View/Filter/ActiveFiltersPanel.d.ts +0 -2
  117. package/src/View/Filter/FilterStatusBarSubPanelPopover.d.ts +2 -0
  118. package/src/View/Filter/FilterStatusBarSubPanelPopover.js +18 -0
  119. package/src/View/Filter/FilterViewPanel.js +1 -1
  120. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +1 -1
  121. package/src/View/GridInfo/GridInfoPopup.js +4 -1
  122. package/src/View/Layout/EditCurrentLayoutButton.d.ts +2 -0
  123. package/src/View/Layout/EditCurrentLayoutButton.js +14 -0
  124. package/src/View/Layout/LayoutPopup.d.ts +1 -1
  125. package/src/View/Layout/LayoutPopup.js +3 -3
  126. package/src/View/Layout/LayoutRadioSelector.d.ts +1 -0
  127. package/src/View/Layout/LayoutRadioSelector.js +2 -2
  128. package/src/View/Layout/LayoutStatusBarSubPanelPopover.d.ts +2 -0
  129. package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +29 -0
  130. package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +2 -1
  131. package/src/View/Layout/Wizard/LayoutEditorWizard.js +2 -1
  132. package/src/View/Query/EditCurrentQueryButton.d.ts +2 -0
  133. package/src/View/Query/EditCurrentQueryButton.js +15 -0
  134. package/src/View/Query/QueryViewPanel.d.ts +0 -1
  135. package/src/View/Query/QueryViewPanel.js +2 -11
  136. package/src/View/QuickSearch/QuickSearchPopup.js +1 -1
  137. package/src/View/QuickSearch/QuickSearchStatusBarContent.d.ts +2 -0
  138. package/src/View/QuickSearch/QuickSearchStatusBarContent.js +16 -0
  139. package/src/View/StatusBar/AdaptableStatusBar.d.ts +3 -0
  140. package/src/View/StatusBar/AdaptableStatusBar.js +44 -0
  141. package/src/View/StatusBar/StatusBarPanel.d.ts +42 -0
  142. package/src/View/StatusBar/StatusBarPanel.js +45 -0
  143. package/src/View/StatusBar/StatusBarPopup.d.ts +3 -0
  144. package/src/View/StatusBar/StatusBarPopup.js +43 -0
  145. package/src/View/SystemStatus/SystemStatusStatusBarContent.d.ts +2 -0
  146. package/src/View/SystemStatus/SystemStatusStatusBarContent.js +15 -0
  147. package/src/View/SystemStatus/SystemStatusViewPanel.js +3 -7
  148. package/src/View/SystemStatus/Utilities/getStatusItemStyle.d.ts +5 -0
  149. package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +16 -0
  150. package/src/View/Theme/ThemeStatusPanelPopover.d.ts +2 -0
  151. package/src/View/Theme/ThemeStatusPanelPopover.js +36 -0
  152. package/src/agGrid/Adaptable.d.ts +2 -0
  153. package/src/agGrid/Adaptable.js +27 -0
  154. package/src/agGrid/agGridHelper.js +2 -0
  155. package/src/agGrid/createAgStatusPanelComponent.d.ts +21 -0
  156. package/src/agGrid/createAgStatusPanelComponent.js +31 -0
  157. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +1 -1
  158. package/src/components/Dashboard/DashboardManager.js +9 -162
  159. package/src/components/Datepicker/index.d.ts +1 -1
  160. package/src/components/DragAndDropContext/DragAndDropContext.d.ts +7 -0
  161. package/src/components/DragAndDropContext/DragAndDropContext.js +14 -0
  162. package/src/components/DragAndDropContext/ModuleManager.d.ts +17 -0
  163. package/src/components/DragAndDropContext/ModuleManager.js +81 -0
  164. package/src/components/DragAndDropContext/TabList.d.ts +29 -0
  165. package/src/components/DragAndDropContext/TabList.js +72 -0
  166. package/src/components/DragAndDropContext/UnusedPanel.d.ts +6 -0
  167. package/src/components/DragAndDropContext/UnusedPanel.js +46 -0
  168. package/src/components/DragAndDropContext/types.d.ts +8 -0
  169. package/src/components/DragAndDropContext/types.js +2 -0
  170. package/src/components/Input/index.d.ts +1 -1
  171. package/src/components/List/ListGroupItem/index.d.ts +1 -1
  172. package/src/components/PopupWithFooter.d.ts +1 -1
  173. package/src/components/SimpleButton/index.js +3 -0
  174. package/src/components/Textarea/index.d.ts +1 -1
  175. package/src/components/icons/DefaultIcon.d.ts +2 -1
  176. package/src/components/icons/DefaultIcon.js +2 -2
  177. package/src/components/icons/index.js +2 -0
  178. package/src/components/icons/statusbar.d.ts +3 -0
  179. package/src/components/icons/statusbar.js +8 -0
  180. package/src/metamodel/adaptable.metamodel.d.ts +231 -0
  181. package/src/metamodel/adaptable.metamodel.js +433 -37
  182. package/src/types.d.ts +4 -3
  183. package/version.d.ts +1 -1
  184. package/version.js +1 -1
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const FilterStatusBarSubPanelPopover: React.FunctionComponent;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FilterStatusBarSubPanelPopover = 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 ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
8
+ const AdaptableContext_1 = require("../AdaptableContext");
9
+ const ActiveFiltersPanel_1 = require("./ActiveFiltersPanel");
10
+ exports.FilterStatusBarSubPanelPopover = () => {
11
+ const adaptable = AdaptableContext_1.useAdaptable();
12
+ const columnFilters = react_redux_1.useSelector((state) => state.Filter.ColumnFilters);
13
+ const accessLevel = adaptable.api.internalApi
14
+ .getEntitlementService()
15
+ .getEntitlementAccessLevelForModule(ModuleConstants.FilterModuleId);
16
+ const handleClear = React.useCallback((columnFilter) => adaptable.api.filterApi.clearColumnFilterByColumn(columnFilter.ColumnId), []);
17
+ return (React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, { columnFilters: columnFilters, api: adaptable.api, accessLevel: accessLevel, onClear: handleClear }));
18
+ };
@@ -16,7 +16,7 @@ class FilterViewPanelComponent extends React.Component {
16
16
  super(props);
17
17
  }
18
18
  render() {
19
- const activeFiltersPanel = (React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, { columns: this.props.Columns, columnFilters: this.props.ColumnFilters, api: this.props.api, accessLevel: this.props.accessLevel, onClear: (columnFilter) => this.onClearColumnFilter(columnFilter) }));
19
+ const activeFiltersPanel = (React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, { columnFilters: this.props.ColumnFilters, api: this.props.api, accessLevel: this.props.accessLevel, onClear: (columnFilter) => this.onClearColumnFilter(columnFilter) }));
20
20
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
21
21
  return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Filter__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
22
22
  React.createElement(rebass_1.Flex, null, ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(this.props.ColumnFilters) && (React.createElement(React.Fragment, null,
@@ -317,7 +317,7 @@ function FormatColumnStyleWizardSection(props) {
317
317
  "Percent Value",
318
318
  ' '),
319
319
  ' '),
320
- React.createElement(FormLayout_1.FormRow, { label: "Back Colour:" },
320
+ React.createElement(FormLayout_1.FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}` },
321
321
  React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
322
322
  React.createElement(CheckBox_1.CheckBox, { checked: !!((_2 = (_1 = data.ColumnStyle) === null || _1 === void 0 ? void 0 : _1.PercentBarStyle) === null || _2 === void 0 ? void 0 : _2.BackColor), onChange: (checked) => onUsePercentStyleColorCheckChanged(checked), mr: 2 }),
323
323
  ((_4 = (_3 = data.ColumnStyle) === null || _3 === void 0 ? void 0 : _3.PercentBarStyle) === null || _4 === void 0 ? void 0 : _4.BackColor) !== undefined && (React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_6 = (_5 = data.ColumnStyle) === null || _5 === void 0 ? void 0 : _5.PercentBarStyle) === null || _6 === void 0 ? void 0 : _6.BackColor, onChange: (x) => onForeColorSelectChange(x) }))))),
@@ -46,6 +46,7 @@ exports.GridInfoPopup = (props) => {
46
46
  });
47
47
  };
48
48
  const CreateGridSummaries = (colItems) => {
49
+ var _a;
49
50
  const returnRows = [];
50
51
  const calcColumns = props.api.calculatedColumnApi
51
52
  .getAllCalculatedColumn()
@@ -63,7 +64,9 @@ exports.GridInfoPopup = (props) => {
63
64
  })
64
65
  : null;
65
66
  const selectedRowInfo = props.api.gridApi.getSelectedRowInfo();
66
- returnRows.push(createReadOnlyColItem(colItems, 'AdapTable Version', version_1.default));
67
+ if ((_a = props.api.internalApi.getAdaptableOptions().userInterfaceOptions) === null || _a === void 0 ? void 0 : _a.showAdapTableVersion) {
68
+ returnRows.push(createReadOnlyColItem(colItems, 'AdapTable Version', version_1.default));
69
+ }
67
70
  returnRows.push(createReadOnlyColItem(colItems, 'Sorted Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(sorts) ? sorts.join('; ') : 'None'));
68
71
  returnRows.push(createReadOnlyColItem(colItems, 'Column Filters', columnFilterDescription));
69
72
  returnRows.push(createReadOnlyColItem(colItems, 'All Rows', props.api.gridApi.getRowCount()));
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const EditCurrentLayoutButton: React.FunctionComponent;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EditCurrentLayoutButton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ exports.EditCurrentLayoutButton = () => {
9
+ const adaptable = AdaptableContext_1.useAdaptable();
10
+ const handleClick = React.useCallback(() => {
11
+ adaptable.api.layoutApi.showLayoutEditor();
12
+ }, []);
13
+ return React.createElement(SimpleButton_1.default, { ml: 1, variant: "text", iconSize: 15, icon: "edit", onClick: handleClick });
14
+ };
@@ -28,5 +28,5 @@ declare class LayoutPopupComponent extends React.Component<LayoutPopupProps, Edi
28
28
  canFinishWizard(): boolean;
29
29
  private getCurrentLayout;
30
30
  }
31
- export declare let LayoutPopup: import("react-redux").ConnectedComponent<typeof LayoutPopupComponent, Pick<React.ClassAttributes<LayoutPopupComponent> & LayoutPopupProps, never> & LayoutPopupProps>;
31
+ export declare let LayoutPopup: import("react-redux").ConnectedComponent<typeof LayoutPopupComponent, Pick<React.ClassAttributes<LayoutPopupComponent> & LayoutPopupProps, never>>;
32
32
  export {};
@@ -66,7 +66,7 @@ class LayoutPopupComponent extends React.Component {
66
66
  { Content: 'Details', Size: 7 },
67
67
  { Content: '', Size: 2 },
68
68
  ];
69
- let layoutRows = this.props.Layouts.map((layout, index) => {
69
+ let layoutRows = this.props.Layouts.map((layout) => {
70
70
  let accessLevel = AdaptableHelper_1.default.getAppropriateAccessLevel(layout, this.props.accessLevel);
71
71
  return (React.createElement(LayoutEntityRow_1.LayoutEntityRow, { key: layout.Uuid, colItems: colItems, api: this.props.api, IsCurrentLayout: layout.Name == this.props.CurrentLayoutName, moduleInfo: this.props.moduleInfo, adaptableObject: layout, onEdit: () => this.onEdit(layout), onClone: () => this.onClone(layout), onShare: (config) => this.props.onShare(layout, config), teamSharingActivated: this.props.teamSharingActivated, onDeleteConfirm: LayoutRedux.LayoutDelete(layout), canDelete: this.props.Layouts.length > 1, onSelect: () => this.props.onSelectLayout(layout.Name), accessLevel: accessLevel, cloneAccessLevel: this.props.accessLevel }));
72
72
  });
@@ -128,14 +128,14 @@ class LayoutPopupComponent extends React.Component {
128
128
  return this.props.Layouts.find((layout) => layout.Name == this.props.CurrentLayoutName);
129
129
  }
130
130
  }
131
- function mapStateToProps(state, ownProps) {
131
+ function mapStateToProps(state) {
132
132
  return {
133
133
  Layouts: state.Layout.Layouts,
134
134
  CurrentLayoutName: state.Layout.CurrentLayout,
135
135
  CurrentLayoutDraft: state.Grid.CurrentLayout,
136
136
  };
137
137
  }
138
- function mapDispatchToProps(dispatch, ownProps) {
138
+ function mapDispatchToProps(dispatch) {
139
139
  return {
140
140
  onSaveLayout: (layout) => {
141
141
  // SAVE it when user clicks FINISH, even if autoSave: false
@@ -2,4 +2,5 @@ import * as React from 'react';
2
2
  import { Layout } from '../../../types';
3
3
  export declare const LayoutRadioSelector: React.FunctionComponent<{
4
4
  data: Layout;
5
+ id?: string;
5
6
  }>;
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const Radio_1 = tslib_1.__importDefault(require("../../components/Radio"));
7
7
  const AdaptableContext_1 = require("../AdaptableContext");
8
- exports.LayoutRadioSelector = ({ data }) => {
8
+ exports.LayoutRadioSelector = ({ data, }) => {
9
9
  const adaptable = AdaptableContext_1.useAdaptable();
10
10
  const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
11
11
  const layouts = adaptable.api.layoutApi.getAllLayout();
@@ -14,5 +14,5 @@ exports.LayoutRadioSelector = ({ data }) => {
14
14
  const handleToggle = React.useCallback(() => {
15
15
  adaptable.api.layoutApi.setLayout(data.Name);
16
16
  }, [isSelected]);
17
- return React.createElement(Radio_1.default, { disabled: isDisabled, checked: isSelected, onClick: handleToggle });
17
+ return React.createElement(Radio_1.default, { id: data.Name, disabled: isDisabled, checked: isSelected, onClick: handleToggle });
18
18
  };
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const LayoutStatusBarSubPanelPopover: React.FunctionComponent;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LayoutStatusBarSubPanelPopover = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const rebass_1 = require("rebass");
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ const AdaptableObjectRow_1 = require("../Components/AdaptableObjectRow");
9
+ const PanelWithRow_1 = require("../Components/Panels/PanelWithRow");
10
+ const LayoutRadioSelector_1 = require("./LayoutRadioSelector");
11
+ const colItems = [
12
+ { Content: 'Current', Size: 2 },
13
+ { Content: 'Layout Name', Size: 4 },
14
+ ];
15
+ exports.LayoutStatusBarSubPanelPopover = () => {
16
+ const adaptable = AdaptableContext_1.useAdaptable();
17
+ const layouts = adaptable.api.layoutApi.getAllLayout();
18
+ return (React.createElement(rebass_1.Flex, { flexDirection: "column" },
19
+ React.createElement(PanelWithRow_1.PanelWithRow, { colItems: colItems }),
20
+ layouts.map((layout) => {
21
+ return (React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: layout.Name, colItems: [
22
+ { Content: React.createElement(LayoutRadioSelector_1.LayoutRadioSelector, { id: layout.Name, data: layout }), Size: 1 },
23
+ {
24
+ Content: (React.createElement("label", { style: { cursor: 'pointer' }, htmlFor: layout.Name }, layout.Name)),
25
+ Size: 4,
26
+ },
27
+ ] }));
28
+ })));
29
+ };
@@ -4,6 +4,7 @@ exports.ColumnLabels = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const rebass_1 = require("rebass");
7
+ const AdaptableContext_1 = require("../../../AdaptableContext");
7
8
  exports.ColumnLabels = (props) => {
8
9
  const { children, showBoth, showTitle, flexDirection = 'row', labels: labelsProp } = props, columnProperties = tslib_1.__rest(props, ["children", "showBoth", "showTitle", "flexDirection", "labels"]);
9
10
  const labelNames = [
@@ -19,7 +20,7 @@ exports.ColumnLabels = (props) => {
19
20
  [flexDirection === 'row' ? 'alignItems' : 'justifyContent']: 'center',
20
21
  };
21
22
  return (React.createElement(rebass_1.Flex, Object.assign({ flexDirection: flexDirection }, flexProps, { width: "100%" }),
22
- showTitle ? React.createElement(rebass_1.Text, { mr: 2 }, "Behaviours:") : null,
23
+ showTitle ? (React.createElement(rebass_1.Text, { mr: 2 }, AdaptableContext_1.useAdaptable().api.internalApi.getCorrectEnglishVariant('Behaviours:'))) : null,
23
24
  labels.map((l, index) => {
24
25
  const enabled = !!l;
25
26
  const labelName = labelNames[index];
@@ -71,6 +71,7 @@ class LayoutEditorWizard extends React.Component {
71
71
  };
72
72
  }
73
73
  render() {
74
+ const behaviourHeader = 'Column ' + this.props.api.internalApi.getCorrectEnglishVariant('Behaviours');
74
75
  return (React.createElement("div", { "data-name": 'layout-editor', style: { height: '100%' } },
75
76
  React.createElement(WizardPanel_1.default, { bodyProps: { padding: 0 } },
76
77
  React.createElement(rebass_1.Flex, null,
@@ -88,7 +89,7 @@ class LayoutEditorWizard extends React.Component {
88
89
  React.createElement(rebass_1.Flex, { width: 120, pr: 2, alignItems: "center", justifyContent: "end" },
89
90
  React.createElement(rebass_1.Text, { mr: 2 }, "Legend"),
90
91
  React.createElement(AdaptablePopover_1.AdaptablePopover, { popoverMinWidth: 200, bodyText: [
91
- React.createElement(Panel_1.default, { variant: "modern", header: "Legend: Column Behaviour", className: "ab-LayoutEditor__LegendPanel", style: {
92
+ React.createElement(Panel_1.default, { variant: "modern", header: behaviourHeader, className: "ab-LayoutEditor__LegendPanel", style: {
92
93
  gridRow: '1 /1',
93
94
  gridColumn: '3/3',
94
95
  }, bodyProps: {
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EditCurrentQueryButton: () => JSX.Element;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EditCurrentQueryButton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ exports.EditCurrentQueryButton = () => {
9
+ const adaptable = AdaptableContext_1.useAdaptable();
10
+ const handleClick = React.useCallback((event) => {
11
+ event.stopPropagation();
12
+ adaptable.api.queryApi.expandCurrentQuery();
13
+ }, []);
14
+ return React.createElement(SimpleButton_1.default, { variant: "text", iconSize: 15, onClick: handleClick, icon: "edit" });
15
+ };
@@ -11,7 +11,6 @@ export interface QueryViewPanelComponentProps extends ViewPanelProps {
11
11
  onAddCachedQuery: (cachedQuery: CachedQuery) => SystemRedux.SystemCachedQueryAddAction;
12
12
  onRunQuery: (expression: string) => QueryRedux.QueryRunAction;
13
13
  onShowNamedQueries: (value: string, popup: string) => PopupRedux.PopupShowScreenAction;
14
- onExpand: (value: string) => void;
15
14
  }
16
15
  interface QueryViewPanelComponentState {
17
16
  isAdaptableReady: boolean;
@@ -22,7 +22,6 @@ const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Exte
22
22
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
23
23
  const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
24
24
  const react_redux_1 = require("react-redux");
25
- const windowFactory_1 = require("../Components/Popups/WindowPopups/windowFactory");
26
25
  class QueryViewPanelComponent extends React.Component {
27
26
  constructor(props) {
28
27
  super(props);
@@ -88,7 +87,7 @@ class QueryViewPanelComponent extends React.Component {
88
87
  };
89
88
  const renderTextInput = () => {
90
89
  return this.props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 600 },
91
- React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.onExpand(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
90
+ React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.api.queryApi.expandCurrentQuery(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
92
91
  React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { fontFamily: 'monospace', fontSize: 12 } }),
93
92
  isExpressionValid ? (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => this.runQuery(), tooltip: '', accessLevel: 'Full', variant: "text", tone: "neutral", disabled: this.state.expression == '' || this.state.expression == this.props.CurrentQuery, marginRight: 1 })) : (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Query", marginRight: 1 })),
94
93
  ' ',
@@ -106,7 +105,7 @@ class QueryViewPanelComponent extends React.Component {
106
105
  React.createElement(DropdownButton_1.default, { disabled: ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(availableSearches), variant: "text", items: availableSearches, marginRight: 1, tooltip: "Load Query", icon: "folder-open" }),
107
106
  ' ')) : (React.createElement(React.Fragment, null,
108
107
  saveButton,
109
- React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.onExpand(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
108
+ React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.api.queryApi.expandCurrentQuery(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
110
109
  React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.clearQuery(), tooltip: "Clear Query", accessLevel: 'Full', disabled: this.state.expression == '' }),
111
110
  React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => this.runQuery(), tooltip: "Run Query", accessLevel: 'Full', variant: "text", tone: "neutral", disabled: !isExpressionValid ||
112
111
  this.state.expression == '' ||
@@ -166,14 +165,6 @@ function mapDispatchToProps(dispatch) {
166
165
  source: 'Toolbar',
167
166
  value,
168
167
  })),
169
- onExpand: (value) => dispatch(PopupRedux.PopupShowWindow({
170
- Id: windowFactory_1.WINDOW_QUERY_EDITOR,
171
- Title: 'Current Query',
172
- Icon: 'query',
173
- PopupProps: {
174
- value: value,
175
- },
176
- })),
177
168
  };
178
169
  }
179
170
  exports.QueryViewPanelControl = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(QueryViewPanelComponent);
@@ -35,7 +35,7 @@ const QuickSearchPopupComponent = (props) => {
35
35
  ' ',
36
36
  React.createElement(FormLayout_1.default, null,
37
37
  React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { type: "text", marginLeft: 2, marginRight: 5, padding: 20, style: { height: '100%' }, placeholder: props.api.internalApi.getAdaptableOptions().searchOptions.quickSearchPlaceholder, value: searchText, OnTextChange: search }))),
38
- React.createElement(Panel_1.default, { header: 'Behaviour', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginLeft: 2, marginRight: 2 },
38
+ React.createElement(Panel_1.default, { header: props.api.internalApi.getCorrectEnglishVariant('Behaviour'), style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginLeft: 2, marginRight: 2 },
39
39
  ' ',
40
40
  React.createElement(rebass_1.Flex, { flexDirection: "column" },
41
41
  React.createElement(FormLayout_1.default, { columns: [1, 2] },
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const QuickSearchStatusBarContent: React.FunctionComponent;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QuickSearchStatusBarContent = 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 AdaptableFormControlTextClear_1 = require("../Components/Forms/AdaptableFormControlTextClear");
9
+ const QuickSearchRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/QuickSearchRedux"));
10
+ exports.QuickSearchStatusBarContent = () => {
11
+ const text = react_redux_1.useSelector((state) => state.QuickSearch.QuickSearchText);
12
+ const dispatch = react_redux_1.useDispatch();
13
+ const adaptable = AdaptableContext_1.useAdaptable();
14
+ const handleTextChange = React.useCallback((text) => dispatch(QuickSearchRedux.QuickSearchRun(text)), []);
15
+ return (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { onClick: (event) => event.stopPropagation(), type: "text", inputStyle: { padding: '2px 3px', width: 90 }, placeholder: adaptable.api.internalApi.getAdaptableOptions().searchOptions.quickSearchPlaceholder, value: text, OnTextChange: handleTextChange }));
16
+ };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { StatusPanelProps } from '../../agGrid/createAgStatusPanelComponent';
3
+ export declare const AdaptableStatusBar: React.FunctionComponent<StatusPanelProps>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdaptableStatusBar = 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 rebass_1 = require("rebass");
8
+ const StatusBarRedux_1 = require("../../Redux/ActionsReducers/StatusBarRedux");
9
+ const AdaptableContext_1 = require("../AdaptableContext");
10
+ const StatusBarPanel_1 = require("./StatusBarPanel");
11
+ exports.AdaptableStatusBar = (props) => {
12
+ var _a;
13
+ /**
14
+ * All state is selected so the Status Bar is re-rendered for all adaptable state changes
15
+ */
16
+ const state = react_redux_1.useSelector((state) => state);
17
+ const statusPanels = StatusBarRedux_1.getStatusPanelsSelector(state);
18
+ const adaptable = AdaptableContext_1.useAdaptable();
19
+ const dispatch = react_redux_1.useDispatch();
20
+ const statusSubPanels = statusPanels.find((statusPanel) => statusPanel.Key === props.context.Key);
21
+ const allMenuItems = react_redux_1.useSelector((state) => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.Grid) === null || _a === void 0 ? void 0 : _a.SettingPanelModuleMenuItems; });
22
+ return (React.createElement(rebass_1.Flex, { className: "ab-StatusBar-Panel", "data-id": props.context.Key }, (_a = statusSubPanels === null || statusSubPanels === void 0 ? void 0 : statusSubPanels.StatusBarPanels) === null || _a === void 0 ? void 0 : _a.map((subPanel) => {
23
+ var _a, _b, _c, _d, _e, _f;
24
+ const module = adaptable.ModuleService.getModuleById(subPanel);
25
+ if (!module) {
26
+ return React.createElement(React.Fragment, { key: subPanel });
27
+ }
28
+ if (!module.isModuleAvailable()) {
29
+ return React.createElement(React.Fragment, { key: subPanel });
30
+ }
31
+ /**
32
+ * Both view properties and status panel are optional.
33
+ */
34
+ const statusBarPanelProps = (_d = (_c = (_b = (_a = module.getViewProperties) === null || _a === void 0 ? void 0 : _a.call(module)) === null || _b === void 0 ? void 0 : _b.getStatusBarPanelProps) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : {};
35
+ const moduleInfo = module.moduleInfo;
36
+ const onAction = (_e = statusBarPanelProps.onAction) !== null && _e !== void 0 ? _e : (() => {
37
+ const menuItem = allMenuItems.find((menuItem) => menuItem.module === subPanel);
38
+ if (menuItem === null || menuItem === void 0 ? void 0 : menuItem.reduxAction) {
39
+ dispatch(menuItem.reduxAction);
40
+ }
41
+ });
42
+ return (React.createElement(StatusBarPanel_1.StatusBarPanel, Object.assign({ "data-name": subPanel }, statusBarPanelProps, { onAction: onAction, icon: (_f = statusBarPanelProps.icon) !== null && _f !== void 0 ? _f : moduleInfo.Glyph, key: subPanel })));
43
+ })));
44
+ };
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import { FlexProps } from 'rebass';
3
+ /**
4
+ * A panel can be:
5
+ * - icon
6
+ * - icon & text
7
+ * - icon & text
8
+ * - icon & text+popover
9
+ * - icon & text+popover & extra actions
10
+ *
11
+ * <icon> <text-with-dropdown> <extra-action>
12
+ * <dropdown-component>
13
+ *
14
+ * Extra actions are components so the components can call inside hooks.
15
+ */
16
+ export interface StatusBarPanelProps extends Omit<FlexProps, 'content'> {
17
+ icon?: string;
18
+ content?: React.ReactNode | React.FunctionComponent;
19
+ /**
20
+ * weather to trigger onAction when the wrapper is clicked
21
+ */
22
+ triggerActionOnWrapperClick?: boolean;
23
+ /**
24
+ * When specified this content will be rendered when the text
25
+ * is clicked.
26
+ */
27
+ popover?: React.ReactNode | React.FunctionComponent;
28
+ popoverMinWidth?: number;
29
+ /**
30
+ * Allow to render custom content
31
+ */
32
+ view?: React.FunctionComponent;
33
+ onAction?: () => void;
34
+ extraActions?: React.FunctionComponent[];
35
+ }
36
+ /**
37
+ * Statusbar sub panel are similar to vs code:
38
+ * - text
39
+ * - action
40
+ * - icon
41
+ */
42
+ export declare const StatusBarPanel: React.FunctionComponent<StatusBarPanelProps>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatusBarPanel = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const rebass_1 = require("rebass");
7
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
8
+ const AdaptablePopover_1 = require("../AdaptablePopover");
9
+ /**
10
+ * Statusbar sub panel are similar to vs code:
11
+ * - text
12
+ * - action
13
+ * - icon
14
+ */
15
+ exports.StatusBarPanel = (props) => {
16
+ var _a;
17
+ const { icon, content, popover, popoverMinWidth, view, onAction, extraActions, triggerActionOnWrapperClick = true } = props, flexProps = tslib_1.__rest(props, ["icon", "content", "popover", "popoverMinWidth", "view", "onAction", "extraActions", "triggerActionOnWrapperClick"]);
18
+ const handleAction = () => onAction();
19
+ if (view) {
20
+ const View = view;
21
+ return React.createElement(View, null);
22
+ }
23
+ const baseClassName = 'ab-StatusBar__SubPanel';
24
+ const handleIconClick = React.useCallback(() => {
25
+ handleAction();
26
+ }, []);
27
+ const shouldTriggerActionOnWrapperClick = triggerActionOnWrapperClick && !popover;
28
+ const handleWrapperClick = React.useCallback(() => {
29
+ // handle action only if there is no popover
30
+ if (shouldTriggerActionOnWrapperClick) {
31
+ handleAction();
32
+ }
33
+ }, [popover, triggerActionOnWrapperClick]);
34
+ // popover
35
+ const popoverContent = typeof popover === 'function'
36
+ ? React.createElement(popover)
37
+ : popover;
38
+ const preparedContent = typeof content === 'function'
39
+ ? React.createElement(content)
40
+ : content;
41
+ return (React.createElement(rebass_1.Flex, Object.assign({}, flexProps, { alignItems: "center", justifyContent: "center", as: shouldTriggerActionOnWrapperClick ? 'button' : 'div', className: baseClassName, onClick: handleWrapperClick }),
42
+ props.icon && (React.createElement(SimpleButton_1.default, { color: props.color, icon: props.icon, iconSize: 15, variant: "text", onClick: handleIconClick, mr: preparedContent ? 1 : 0 })),
43
+ popover ? (React.createElement(AdaptablePopover_1.AdaptablePopover, { showIcon: false, bodyText: [popoverContent], MessageType: 'Info', showEvent: 'focus', hideEvent: "blur", popoverMinWidth: popoverMinWidth }, preparedContent)) : (preparedContent), (_a = extraActions === null || extraActions === void 0 ? void 0 : extraActions.map) === null || _a === void 0 ? void 0 :
44
+ _a.call(extraActions, (action, index) => React.createElement(action, { key: index }))));
45
+ };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { AdaptablePopupModuleViewProps } from '../Components/Popups/AdaptablePopup/AdaptablePopupModuleView';
3
+ export declare const StatusBarPopup: React.FunctionComponent<AdaptablePopupModuleViewProps>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatusBarPopup = 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 ModuleManager_1 = require("../../components/DragAndDropContext/ModuleManager");
8
+ const EmptyContent_1 = tslib_1.__importDefault(require("../../components/EmptyContent"));
9
+ const Types_1 = require("../../PredefinedConfig/Common/Types");
10
+ const StatusBarRedux_1 = require("../../Redux/ActionsReducers/StatusBarRedux");
11
+ const AdaptableContext_1 = require("../AdaptableContext");
12
+ const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
13
+ exports.StatusBarPopup = (props) => {
14
+ const statusPanels = react_redux_1.useSelector(StatusBarRedux_1.getStatusPanelsSelector);
15
+ const adaptable = AdaptableContext_1.useAdaptable();
16
+ const tabs = React.useMemo(() => statusPanels.map((statusPanel) => {
17
+ return {
18
+ Name: statusPanel.Key,
19
+ Items: statusPanel.StatusBarPanels,
20
+ };
21
+ }), [statusPanels]);
22
+ const handleTabChange = React.useCallback((tabs) => {
23
+ const newStatusPanels = tabs.map((tab) => {
24
+ const statusPanel = statusPanels.find((sp) => sp.Key === tab.Name);
25
+ return Object.assign(Object.assign({}, statusPanel), { SubPanels: tab.Items });
26
+ });
27
+ adaptable.api.statusBarApi.setStatusPanels(newStatusPanels);
28
+ }, [statusPanels]);
29
+ const availableItems = Types_1.ALL_STATUS_SUB_PANELS.filter((panel) => {
30
+ const module = adaptable.ModuleService.getModuleById(panel);
31
+ return module.isModuleAvailable();
32
+ }).map((panel) => {
33
+ const module = adaptable.ModuleService.getModuleById(panel);
34
+ return { Id: panel, Title: module.moduleInfo.FriendlyName };
35
+ });
36
+ const disabled = props.accessLevel === 'ReadOnly';
37
+ return (React.createElement(PopupPanel_1.PopupPanel, { headerText: props.moduleInfo.FriendlyName, glyphicon: props.moduleInfo.Glyph }, statusPanels.length ? (React.createElement(ModuleManager_1.ModuleManager, { permittedActions: {
38
+ createTab: false,
39
+ dragAndDropTab: false,
40
+ deleteTab: false,
41
+ editTabName: false,
42
+ }, onTabsChange: handleTabChange, disabled: disabled, tabs: tabs, availableItems: availableItems, tabsTitle: 'Status Bar Panels', unusedPanelTitle: "Available Status Panels" })) : (React.createElement(EmptyContent_1.default, null, "To enable this feature add to Grid Options statusPanels the Adaptable Status Panel."))));
43
+ };
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const SystemStatusStatusBarContent: React.FunctionComponent;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SystemStatusStatusBarContent = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const rebass_1 = require("rebass");
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ const getStatusItemStyle_1 = require("./Utilities/getStatusItemStyle");
9
+ exports.SystemStatusStatusBarContent = () => {
10
+ const adaptable = AdaptableContext_1.useAdaptable();
11
+ const currentSystemStatusMessageInfo = adaptable.api.systemStatusApi.getCurrentSystemStatusMessageInfo();
12
+ const { color, background } = getStatusItemStyle_1.getStatusItemStyle(currentSystemStatusMessageInfo);
13
+ const message = currentSystemStatusMessageInfo === null || currentSystemStatusMessageInfo === void 0 ? void 0 : currentSystemStatusMessageInfo.statusMessage;
14
+ return (React.createElement(rebass_1.Box, { style: { borderRadius: 'var(--ab__border-radius)' }, padding: 1, color: message && color, backgroundColor: message && background }, message || '0 Messages'));
15
+ };
@@ -3,24 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SystemStatusViewPanel = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
7
6
  const rebass_1 = require("rebass");
8
7
  const react_redux_1 = require("react-redux");
8
+ const getStatusItemStyle_1 = require("./Utilities/getStatusItemStyle");
9
9
  class SystemStatusViewPanelComponent extends React.Component {
10
10
  constructor(props) {
11
11
  super(props);
12
12
  }
13
13
  render() {
14
- var _a;
15
14
  const currentSystemStatusMessageInfo = this.props.api.systemStatusApi.getCurrentSystemStatusMessageInfo();
16
- const messageTypeColor = UIHelper_1.default.getColorByMessageType((_a = currentSystemStatusMessageInfo === null || currentSystemStatusMessageInfo === void 0 ? void 0 : currentSystemStatusMessageInfo.statusType) !== null && _a !== void 0 ? _a : 'Success');
17
- const buttonTextColor = currentSystemStatusMessageInfo
18
- ? UIHelper_1.default.getButtonTextColourForMessageType(currentSystemStatusMessageInfo.statusType)
19
- : '';
15
+ const { color, background } = getStatusItemStyle_1.getStatusItemStyle(currentSystemStatusMessageInfo);
20
16
  const message = currentSystemStatusMessageInfo === null || currentSystemStatusMessageInfo === void 0 ? void 0 : currentSystemStatusMessageInfo.statusMessage;
21
17
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
22
18
  return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__SystemStatus__wrap` },
23
- React.createElement(rebass_1.Flex, { style: { borderRadius: 'var(--ab__border-radius)' }, className: `ab-${elementType}__SystemStatus__text`, marginRight: 2, padding: 2, color: buttonTextColor, backgroundColor: message ? messageTypeColor : '', fontSize: 'var( --ab-font-size-2)', alignItems: "center", "data-name": "system-status-message" }, message || '0 Messages')));
19
+ React.createElement(rebass_1.Flex, { style: { borderRadius: 'var(--ab__border-radius)' }, className: `ab-${elementType}__SystemStatus__text`, marginRight: 2, padding: 2, color: color, backgroundColor: message ? background : '', fontSize: 'var( --ab-font-size-2)', alignItems: "center", "data-name": "system-status-message" }, message || '0 Messages')));
24
20
  }
25
21
  }
26
22
  function mapStateToProps(state) {
@@ -0,0 +1,5 @@
1
+ import { SystemStatusMessageInfo } from '../../../types';
2
+ export declare const getStatusItemStyle: (systemStatusMessageInfo?: SystemStatusMessageInfo) => {
3
+ background: string;
4
+ color: string;
5
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getStatusItemStyle = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const UIHelper_1 = tslib_1.__importDefault(require("../../UIHelper"));
6
+ exports.getStatusItemStyle = (systemStatusMessageInfo) => {
7
+ var _a;
8
+ const background = UIHelper_1.default.getColorByMessageType((_a = systemStatusMessageInfo === null || systemStatusMessageInfo === void 0 ? void 0 : systemStatusMessageInfo.statusType) !== null && _a !== void 0 ? _a : 'Success');
9
+ const color = systemStatusMessageInfo
10
+ ? UIHelper_1.default.getButtonTextColourForMessageType(systemStatusMessageInfo.statusType)
11
+ : '';
12
+ return {
13
+ background,
14
+ color,
15
+ };
16
+ };
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const ThemeStatusPanelPopover: React.FunctionComponent;