@adaptabletools/adaptable 11.1.8 → 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.
- package/base.css +16 -0
- package/bundle.cjs.js +106 -106
- package/index.css +20 -0
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +1 -1
- package/src/AdaptableOptions/AlertOptions.d.ts +9 -2
- package/src/AdaptableOptions/FinancePluginOptions.d.ts +57 -16
- package/src/AdaptableOptions/GeneralOptions.d.ts +7 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +7 -0
- package/src/Api/AdaptableApi.d.ts +5 -0
- package/src/Api/CellSummaryApi.d.ts +8 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
- package/src/Api/Implementation/AlertApiImpl.js +32 -15
- package/src/Api/Implementation/CellSummaryApiImpl.d.ts +2 -0
- package/src/Api/Implementation/CellSummaryApiImpl.js +34 -0
- package/src/Api/Implementation/ConfigApiImpl.js +3 -0
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -1
- package/src/Api/Implementation/InternalApiImpl.js +29 -7
- package/src/Api/Implementation/QueryApiImpl.d.ts +1 -0
- package/src/Api/Implementation/QueryApiImpl.js +12 -0
- package/src/Api/Implementation/StatusBarApiImpl.d.ts +8 -0
- package/src/Api/Implementation/StatusBarApiImpl.js +17 -0
- package/src/Api/InternalApi.d.ts +2 -1
- package/src/Api/QueryApi.d.ts +6 -0
- package/src/Api/StatusBarApi.d.ts +10 -0
- package/src/Api/StatusBarApi.js +2 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
- package/src/PredefinedConfig/Common/FDC3Context.d.ts +61 -29
- package/src/PredefinedConfig/Common/Types.d.ts +4 -2
- package/src/PredefinedConfig/Common/Types.js +32 -1
- package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
- package/src/PredefinedConfig/GridState.d.ts +1 -1
- package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
- package/src/PredefinedConfig/StatusBarState.d.ts +27 -0
- package/src/PredefinedConfig/StatusBarState.js +7 -0
- package/src/PredefinedConfig/ToolPanelState.d.ts +1 -1
- package/src/Redux/ActionsReducers/GridRedux.d.ts +2 -2
- package/src/Redux/ActionsReducers/GridRedux.js +4 -4
- package/src/Redux/ActionsReducers/StatusBarRedux.d.ts +22 -0
- package/src/Redux/ActionsReducers/StatusBarRedux.js +31 -0
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +8 -3
- package/src/Redux/ActionsReducers/SystemRedux.js +22 -5
- package/src/Redux/Store/AdaptableReduxMerger.js +2 -2
- package/src/Redux/Store/AdaptableStore.js +24 -10
- package/src/Strategy/AlertModule.d.ts +3 -0
- package/src/Strategy/AlertModule.js +6 -0
- package/src/Strategy/CellSummaryModule.d.ts +6 -0
- package/src/Strategy/CellSummaryModule.js +14 -0
- package/src/Strategy/DataChangeHistoryModule.d.ts +7 -0
- package/src/Strategy/DataChangeHistoryModule.js +11 -0
- package/src/Strategy/ExportModule.d.ts +1 -0
- package/src/Strategy/ExportModule.js +1 -0
- package/src/Strategy/FilterModule.d.ts +6 -0
- package/src/Strategy/FilterModule.js +21 -0
- package/src/Strategy/Interface/IModule.d.ts +21 -10
- package/src/Strategy/LayoutModule.d.ts +7 -0
- package/src/Strategy/LayoutModule.js +13 -0
- package/src/Strategy/QueryModule.d.ts +8 -0
- package/src/Strategy/QueryModule.js +18 -0
- package/src/Strategy/QuickSearchModule.d.ts +6 -0
- package/src/Strategy/QuickSearchModule.js +10 -0
- package/src/Strategy/StatusBarModule.d.ts +8 -0
- package/src/Strategy/StatusBarModule.js +39 -0
- package/src/Strategy/SystemStatusModule.d.ts +6 -0
- package/src/Strategy/SystemStatusModule.js +10 -0
- package/src/Strategy/ThemeModule.d.ts +7 -0
- package/src/Strategy/ThemeModule.js +12 -0
- package/src/Strategy/Utilities/getAlertBehaviourViewItems.js +1 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +1 -0
- package/src/Utilities/Constants/ModuleConstants.js +2 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +4 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
- package/src/Utilities/Services/ModuleService.js +6 -6
- package/src/View/AdaptablePopover/index.d.ts +1 -0
- package/src/View/AdaptablePopover/index.js +5 -2
- package/src/View/AdaptableViewFactory.js +2 -2
- package/src/View/Alert/AlertStatusSubPanel.d.ts +2 -0
- package/src/View/Alert/AlertStatusSubPanel.js +56 -0
- package/src/View/Alert/AlertViewPanel.js +6 -7
- package/src/View/Alert/AlertsPanel.d.ts +1 -1
- package/src/View/Alert/AlertsPanel.js +2 -1
- package/src/View/Alert/Utilities/getAlertButtonStyle.d.ts +5 -0
- package/src/View/Alert/Utilities/getAlertButtonStyle.js +15 -0
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +18 -7
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +1 -8
- package/src/View/Alert/Wizard/AlertWizard.js +3 -2
- package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.d.ts +2 -0
- package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +15 -0
- package/src/View/CellSummary/CellSummaryStatusPanel.d.ts +2 -0
- package/src/View/CellSummary/CellSummaryStatusPanel.js +36 -0
- package/src/View/CellSummary/CellSummaryViewPanel.js +2 -20
- package/src/View/ColorPicker.d.ts +1 -1
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/AdaptableInput/index.d.ts +1 -1
- package/src/View/Components/Buttons/ButtonDelete.d.ts +1 -1
- package/src/View/Components/Forms/AdaptableFormControlTextClear.d.ts +1 -1
- package/src/View/Components/Forms/AdaptableFormControlTextClear.js +1 -1
- package/src/View/Components/Panels/PanelWithImage.d.ts +2 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +5 -4
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +1 -1
- package/src/View/Components/RangesComponent.js +6 -2
- package/src/View/Components/StyleComponent.js +18 -6
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +3 -3
- package/src/View/Dashboard/DashboardPopup.js +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +5 -13
- package/src/View/DataChangeHistory/DataChangeHistoryStatusBarContent.d.ts +2 -0
- package/src/View/DataChangeHistory/DataChangeHistoryStatusBarContent.js +9 -0
- package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.d.ts +4 -16
- package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +32 -40
- package/src/View/Filter/ActiveFiltersPanel.d.ts +0 -2
- package/src/View/Filter/FilterStatusBarSubPanelPopover.d.ts +2 -0
- package/src/View/Filter/FilterStatusBarSubPanelPopover.js +18 -0
- package/src/View/Filter/FilterViewPanel.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- package/src/View/Layout/EditCurrentLayoutButton.d.ts +2 -0
- package/src/View/Layout/EditCurrentLayoutButton.js +14 -0
- package/src/View/Layout/LayoutPopup.d.ts +1 -1
- package/src/View/Layout/LayoutPopup.js +3 -3
- package/src/View/Layout/LayoutRadioSelector.d.ts +1 -0
- package/src/View/Layout/LayoutRadioSelector.js +2 -2
- package/src/View/Layout/LayoutStatusBarSubPanelPopover.d.ts +2 -0
- package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +29 -0
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +2 -1
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +2 -1
- package/src/View/Query/EditCurrentQueryButton.d.ts +2 -0
- package/src/View/Query/EditCurrentQueryButton.js +15 -0
- package/src/View/Query/QueryViewPanel.d.ts +0 -1
- package/src/View/Query/QueryViewPanel.js +2 -11
- package/src/View/QuickSearch/QuickSearchPopup.js +1 -1
- package/src/View/QuickSearch/QuickSearchStatusBarContent.d.ts +2 -0
- package/src/View/QuickSearch/QuickSearchStatusBarContent.js +16 -0
- package/src/View/StatusBar/AdaptableStatusBar.d.ts +3 -0
- package/src/View/StatusBar/AdaptableStatusBar.js +44 -0
- package/src/View/StatusBar/StatusBarPanel.d.ts +42 -0
- package/src/View/StatusBar/StatusBarPanel.js +45 -0
- package/src/View/StatusBar/StatusBarPopup.d.ts +3 -0
- package/src/View/StatusBar/StatusBarPopup.js +43 -0
- package/src/View/SystemStatus/SystemStatusStatusBarContent.d.ts +2 -0
- package/src/View/SystemStatus/SystemStatusStatusBarContent.js +15 -0
- package/src/View/SystemStatus/SystemStatusViewPanel.js +3 -7
- package/src/View/SystemStatus/Utilities/getStatusItemStyle.d.ts +5 -0
- package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +16 -0
- package/src/View/Theme/ThemeStatusPanelPopover.d.ts +2 -0
- package/src/View/Theme/ThemeStatusPanelPopover.js +36 -0
- package/src/agGrid/Adaptable.d.ts +2 -0
- package/src/agGrid/Adaptable.js +27 -0
- package/src/agGrid/agGridHelper.js +2 -0
- package/src/agGrid/createAgStatusPanelComponent.d.ts +21 -0
- package/src/agGrid/createAgStatusPanelComponent.js +31 -0
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +1 -1
- package/src/components/Dashboard/DashboardManager.js +9 -162
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/DragAndDropContext/DragAndDropContext.d.ts +7 -0
- package/src/components/DragAndDropContext/DragAndDropContext.js +14 -0
- package/src/components/DragAndDropContext/ModuleManager.d.ts +17 -0
- package/src/components/DragAndDropContext/ModuleManager.js +81 -0
- package/src/components/DragAndDropContext/TabList.d.ts +29 -0
- package/src/components/DragAndDropContext/TabList.js +72 -0
- package/src/components/DragAndDropContext/UnusedPanel.d.ts +6 -0
- package/src/components/DragAndDropContext/UnusedPanel.js +46 -0
- package/src/components/DragAndDropContext/types.d.ts +8 -0
- package/src/components/DragAndDropContext/types.js +2 -0
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +1 -1
- package/src/components/PopupWithFooter.d.ts +1 -1
- package/src/components/SimpleButton/index.js +3 -0
- package/src/components/Textarea/index.d.ts +1 -1
- package/src/components/icons/DefaultIcon.d.ts +2 -1
- package/src/components/icons/DefaultIcon.js +2 -2
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/statusbar.d.ts +3 -0
- package/src/components/icons/statusbar.js +8 -0
- package/src/metamodel/adaptable.metamodel.d.ts +231 -0
- package/src/metamodel/adaptable.metamodel.js +433 -37
- package/src/types.d.ts +4 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -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, {
|
|
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:
|
|
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
|
-
|
|
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,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
|
|
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
|
|
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
|
|
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
|
|
138
|
+
function mapDispatchToProps(dispatch) {
|
|
139
139
|
return {
|
|
140
140
|
onSaveLayout: (layout) => {
|
|
141
141
|
// SAVE it when user clicks FINISH, even if autoSave: false
|
|
@@ -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,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 },
|
|
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:
|
|
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,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.
|
|
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.
|
|
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,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,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,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,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
|
|
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:
|
|
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,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,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemeStatusPanelPopover = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const Radio_1 = tslib_1.__importDefault(require("../../components/Radio"));
|
|
8
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
9
|
+
const AdaptableObjectRow_1 = require("../Components/AdaptableObjectRow");
|
|
10
|
+
const PanelWithRow_1 = require("../Components/Panels/PanelWithRow");
|
|
11
|
+
const colItems = [
|
|
12
|
+
{ Content: 'Current', Size: 2 },
|
|
13
|
+
{ Content: 'Theme Name', Size: 4 },
|
|
14
|
+
];
|
|
15
|
+
exports.ThemeStatusPanelPopover = () => {
|
|
16
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
17
|
+
const themes = adaptable.api.themeApi.getAllTheme();
|
|
18
|
+
const currentTheme = adaptable.api.themeApi.getCurrentTheme();
|
|
19
|
+
const handleThemeChange = React.useCallback((theme) => {
|
|
20
|
+
adaptable.api.themeApi.loadTheme(theme.Name);
|
|
21
|
+
}, []);
|
|
22
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "column" },
|
|
23
|
+
React.createElement(PanelWithRow_1.PanelWithRow, { colItems: colItems }),
|
|
24
|
+
themes.map((theme) => {
|
|
25
|
+
return (React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: theme.Name, colItems: [
|
|
26
|
+
{
|
|
27
|
+
Content: (React.createElement(Radio_1.default, { onClick: () => handleThemeChange(theme), id: theme.Name, checked: currentTheme === theme.Name })),
|
|
28
|
+
Size: 1,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
Content: (React.createElement("label", { style: { cursor: 'pointer' }, htmlFor: theme.Name }, theme.Name)),
|
|
32
|
+
Size: 4,
|
|
33
|
+
},
|
|
34
|
+
] }));
|
|
35
|
+
})));
|
|
36
|
+
};
|