@adaptabletools/adaptable 11.0.8 → 11.1.1-canary.0
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 +19 -11
- package/bundle.cjs.js +125 -125
- package/index.css +23 -11
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
- package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
- package/src/Api/AlertApi.d.ts +2 -1
- package/src/Api/BulkUpdateApi.d.ts +5 -0
- package/src/Api/ConfigApi.d.ts +1 -1
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/GridDataChanged.d.ts +5 -1
- package/src/Api/GridApi.d.ts +23 -2
- package/src/Api/Implementation/AlertApiImpl.d.ts +4 -1
- package/src/Api/Implementation/AlertApiImpl.js +79 -52
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +1 -0
- package/src/Api/Implementation/BulkUpdateApiImpl.js +4 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +7 -2
- package/src/Api/Implementation/EventApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -1
- package/src/Api/Implementation/GridApiImpl.js +24 -3
- package/src/Api/Implementation/InternalApiImpl.d.ts +9 -2
- package/src/Api/Implementation/InternalApiImpl.js +37 -1
- package/src/Api/Implementation/LayoutApiImpl.d.ts +6 -1
- package/src/Api/Implementation/LayoutApiImpl.js +45 -4
- package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
- package/src/Api/Implementation/SettingsPanelApiImpl.js +7 -1
- package/src/Api/InternalApi.d.ts +9 -2
- package/src/Api/LayoutApi.d.ts +33 -3
- package/src/PredefinedConfig/AlertState.d.ts +7 -3
- package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +35 -6
- package/src/PredefinedConfig/Common/AdaptableAlert.js +7 -0
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +20 -0
- package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/Entitlement.d.ts +2 -2
- package/src/PredefinedConfig/Common/Menu.d.ts +3 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.d.ts +15 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.js +2 -0
- package/src/PredefinedConfig/ConfigState.d.ts +4 -1
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/PredefinedConfig/PopupState.d.ts +2 -1
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +4 -8
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +18 -0
- package/src/Redux/ActionsReducers/PopupRedux.js +36 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +11 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +32 -1
- package/src/Redux/Store/AdaptableReduxMerger.d.ts +1 -0
- package/src/Redux/Store/AdaptableReduxMerger.js +40 -4
- package/src/Redux/Store/AdaptableStore.js +69 -27
- package/src/Strategy/AlertModule.d.ts +5 -3
- package/src/Strategy/AlertModule.js +60 -16
- package/src/Strategy/BulkUpdateModule.js +5 -0
- package/src/Strategy/ExportModule.js +1 -0
- package/src/Strategy/SmartEditModule.js +6 -0
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +1 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +6 -2
- package/src/Utilities/Emitter.d.ts +1 -1
- package/src/Utilities/Emitter.js +6 -3
- package/src/Utilities/Interface/MessagePopups.d.ts +13 -0
- package/src/Utilities/ObjectFactory.d.ts +8 -6
- package/src/Utilities/ObjectFactory.js +26 -12
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/ModuleService.js +1 -1
- package/src/Utilities/Services/ValidationService.js +1 -0
- package/src/View/AdaptableView.js +2 -0
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +16 -9
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +13 -3
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -0
- package/src/View/Alert/Wizard/AlertWizard.js +83 -1
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Components/FilterForm/FilterForm.js +2 -2
- package/src/View/Components/Panels/PanelFooter.d.ts +10 -0
- package/src/View/Components/Panels/PanelFooter.js +14 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +12 -7
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -1
- package/src/View/Components/Popups/{AdaptablePopup/Utilities.d.ts → Utilities.d.ts} +4 -0
- package/src/View/Components/Popups/{AdaptablePopup/Utilities.js → Utilities.js} +5 -2
- package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +6 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +32 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +4 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +8 -0
- package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +3 -0
- package/src/View/Layout/LayoutEditorStandalonePopup.js +76 -0
- package/src/View/Layout/LayoutPopup.js +3 -24
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -4
- package/src/View/Layout/LayoutViewPanel.js +5 -18
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.d.ts +9 -0
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +55 -0
- package/src/View/Layout/Wizard/LayoutEditor/index.js +3 -68
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +35 -7
- package/src/View/SystemStatus/SystemStatusEntityRow.js +1 -2
- package/src/agGrid/Adaptable.d.ts +4 -2
- package/src/agGrid/Adaptable.js +65 -69
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/agGrid/agGridHelper.js +23 -8
- package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -1
- package/src/components/Dialog/index.js +1 -1
- package/src/components/Modal/index.js +1 -1
- package/src/components/WindowModal/WindowModal.d.ts +10 -8
- package/src/components/WindowModal/WindowModal.js +4 -2
- package/src/components/WindowModal/useStacking.d.ts +9 -0
- package/src/components/WindowModal/useStacking.js +45 -0
- package/src/env.js +3 -3
- package/src/metamodel/adaptable.metamodel.d.ts +51 -11
- package/src/metamodel/adaptable.metamodel.js +146 -21
- package/src/types.d.ts +3 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -18,6 +18,7 @@ const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
|
|
|
18
18
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
|
|
19
19
|
const react_redux_1 = require("react-redux");
|
|
20
20
|
const AlertRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/AlertRedux"));
|
|
21
|
+
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
21
22
|
exports.AlertWizard = (props) => {
|
|
22
23
|
const [alertDefinition, setAlertDefinition] = react_1.useState(() => {
|
|
23
24
|
var _a;
|
|
@@ -33,6 +34,87 @@ exports.AlertWizard = (props) => {
|
|
|
33
34
|
alertDefinition.MessageType = (_a = alertDefinition.MessageType) !== null && _a !== void 0 ? _a : GeneralConstants_1.ALERT_DEFAULT_MESSAGE_TYPE;
|
|
34
35
|
return alertDefinition;
|
|
35
36
|
});
|
|
37
|
+
const { api } = AdaptableContext_1.useAdaptable();
|
|
38
|
+
const updateAlertDefinition = (alertDefinition) => {
|
|
39
|
+
var _a;
|
|
40
|
+
// we need to adjust the alert actions&behaviours based on the predicate type(row/cell based)
|
|
41
|
+
const isAddedRowChangeAlert = api.internalApi.isAlertDefinitionForAddedRowChangeEvent(alertDefinition);
|
|
42
|
+
const isRemovedRowChangeAlert = api.internalApi.isAlertDefinitionForRemovedRowChangeEvent(alertDefinition);
|
|
43
|
+
const isCellChangeAlert = !isAddedRowChangeAlert && !isRemovedRowChangeAlert;
|
|
44
|
+
// map FormButton Actions
|
|
45
|
+
const mapValidButtonActions = (alertAction) => {
|
|
46
|
+
if (isCellChangeAlert) {
|
|
47
|
+
if (alertAction === 'highlight-row') {
|
|
48
|
+
return 'highlight-cell';
|
|
49
|
+
}
|
|
50
|
+
if (alertAction === 'jump-to-row') {
|
|
51
|
+
return 'jump-to-cell';
|
|
52
|
+
}
|
|
53
|
+
return alertAction;
|
|
54
|
+
}
|
|
55
|
+
if (isAddedRowChangeAlert) {
|
|
56
|
+
if (alertAction === 'highlight-cell') {
|
|
57
|
+
return 'highlight-row';
|
|
58
|
+
}
|
|
59
|
+
if (alertAction === 'jump-to-cell') {
|
|
60
|
+
return 'jump-to-row';
|
|
61
|
+
}
|
|
62
|
+
if (alertAction === 'jump-to-column' || alertAction === 'undo') {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return alertAction;
|
|
66
|
+
}
|
|
67
|
+
if (isRemovedRowChangeAlert) {
|
|
68
|
+
if (alertAction === 'highlight-cell' ||
|
|
69
|
+
alertAction === 'jump-to-cell' ||
|
|
70
|
+
alertAction === 'highlight-row' ||
|
|
71
|
+
alertAction === 'jump-to-row' ||
|
|
72
|
+
alertAction === 'jump-to-column' ||
|
|
73
|
+
alertAction === 'undo') {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return alertAction;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
if (alertDefinition.AlertForm && typeof alertDefinition.AlertForm !== 'string') {
|
|
80
|
+
const alertButtons = (_a = alertDefinition.AlertForm) === null || _a === void 0 ? void 0 : _a.Buttons;
|
|
81
|
+
alertButtons.forEach((alertButton) => {
|
|
82
|
+
const alertAction = alertButton.Action;
|
|
83
|
+
if (Array.isArray(alertAction)) {
|
|
84
|
+
alertButton.Action = alertAction
|
|
85
|
+
.map(mapValidButtonActions)
|
|
86
|
+
.filter(Boolean);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
alertButton.Action = mapValidButtonActions(alertAction);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
// map Alert Properties(Behaviour)
|
|
93
|
+
if (isCellChangeAlert) {
|
|
94
|
+
alertDefinition.AlertProperties.HighlightCell =
|
|
95
|
+
alertDefinition.AlertProperties.HighlightRow;
|
|
96
|
+
delete alertDefinition.AlertProperties.HighlightRow;
|
|
97
|
+
alertDefinition.AlertProperties.JumpToCell = alertDefinition.AlertProperties.JumpToRow;
|
|
98
|
+
delete alertDefinition.AlertProperties.JumpToRow;
|
|
99
|
+
}
|
|
100
|
+
if (isAddedRowChangeAlert) {
|
|
101
|
+
alertDefinition.AlertProperties.HighlightRow =
|
|
102
|
+
alertDefinition.AlertProperties.HighlightCell;
|
|
103
|
+
delete alertDefinition.AlertProperties.HighlightCell;
|
|
104
|
+
alertDefinition.AlertProperties.JumpToRow = alertDefinition.AlertProperties.JumpToCell;
|
|
105
|
+
delete alertDefinition.AlertProperties.JumpToCell;
|
|
106
|
+
delete alertDefinition.AlertProperties.PreventEdit;
|
|
107
|
+
}
|
|
108
|
+
if (isRemovedRowChangeAlert) {
|
|
109
|
+
delete alertDefinition.AlertProperties.PreventEdit;
|
|
110
|
+
delete alertDefinition.AlertProperties.HighlightRow;
|
|
111
|
+
delete alertDefinition.AlertProperties.JumpToRow;
|
|
112
|
+
delete alertDefinition.AlertProperties.HighlightCell;
|
|
113
|
+
delete alertDefinition.AlertProperties.JumpToCell;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
setAlertDefinition(alertDefinition);
|
|
117
|
+
};
|
|
36
118
|
const dispatch = react_redux_1.useDispatch();
|
|
37
119
|
const handleFinish = () => {
|
|
38
120
|
if (props.data) {
|
|
@@ -60,7 +142,7 @@ exports.AlertWizard = (props) => {
|
|
|
60
142
|
React.createElement("b", null, "when"),
|
|
61
143
|
" the Alert should trigger")),
|
|
62
144
|
isValid: isValidAlertRules_1.isValidAlertRules,
|
|
63
|
-
render: () => React.createElement(AlertRulesWizardSection_1.AlertRulesWizardSection, { onChange:
|
|
145
|
+
render: () => React.createElement(AlertRulesWizardSection_1.AlertRulesWizardSection, { onChange: updateAlertDefinition, module: "alert" }),
|
|
64
146
|
renderSummary: AlertRulesWizardSection_1.renderAlertRulesSummary,
|
|
65
147
|
title: 'Rule',
|
|
66
148
|
},
|
|
@@ -59,7 +59,7 @@ class CellSummaryViewPanelComponent extends React.Component {
|
|
|
59
59
|
if (operationValue == undefined) {
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
return this.props.viewType === 'ToolPanel' ? (React.createElement(rebass_1.Flex, { className: `ab-${elementType}__CellSummary__value`, style: { borderRadius: 'var(--ab__border-radius)' }, marginRight: 2, padding: 2, color: 'var( --ab-color-text-on-info)', backgroundColor: 'var(--ab-color-info)', fontSize: 'var( --ab-font-size-2)' }, operationValue)) : (React.createElement(rebass_1.Flex, { flex: 1, marginRight: 2, justifyContent: "center", className: `ab-${elementType}__CellSummary__value`, color: 'var(--ab-color-text-on-primary)' }, operationValue));
|
|
62
|
+
return this.props.viewType === 'ToolPanel' ? (React.createElement(rebass_1.Flex, { className: `ab-${elementType}__CellSummary__value`, style: { borderRadius: 'var(--ab__border-radius)' }, marginRight: 2, padding: 2, color: 'var( --ab-color-text-on-info)', backgroundColor: 'var(--ab-color-info)', fontSize: 'var( --ab-font-size-2)' }, operationValue)) : (React.createElement(rebass_1.Flex, { flex: 1, marginRight: 2, marginLeft: 1, justifyContent: "center", className: `ab-${elementType}__CellSummary__value`, color: 'var(--ab-color-text-on-primary)' }, operationValue));
|
|
63
63
|
};
|
|
64
64
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
65
65
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: shouldDisable ? GeneralConstants.READ_ONLY_STYLE : `ab-${elementType}__CellSummary__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
@@ -177,8 +177,8 @@ class FilterFormComponent extends React.Component {
|
|
|
177
177
|
this.changeColumnPredicateInput(newCheckedValue, 0);
|
|
178
178
|
} })));
|
|
179
179
|
}
|
|
180
|
-
return (_a = predicateDef.inputs) === null || _a === void 0 ? void 0 : _a.map((predicateInput, index) => (React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
181
|
-
React.createElement(AdaptableInput_1.default, {
|
|
180
|
+
return (_a = predicateDef.inputs) === null || _a === void 0 ? void 0 : _a.map((predicateInput, index) => (React.createElement(rebass_1.Flex, { key: index, flexDirection: "row" },
|
|
181
|
+
React.createElement(AdaptableInput_1.default, { type: predicateInput.type, autoFocus: index === 0, value: filter.Predicate.Inputs[index], onChange: (e) => this.changeColumnPredicateInput(e.target.value, index), style: {
|
|
182
182
|
marginBottom: 5,
|
|
183
183
|
flex: 1,
|
|
184
184
|
fontSize: 'var( --ab-font-size-2)',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface PanelFooterProps {
|
|
3
|
+
onCancel: () => void;
|
|
4
|
+
onAccept: () => void;
|
|
5
|
+
cancelDisabled?: boolean;
|
|
6
|
+
acceptDisabled?: boolean;
|
|
7
|
+
acceptText?: React.ReactElement;
|
|
8
|
+
cancelText?: React.ReactElement;
|
|
9
|
+
}
|
|
10
|
+
export declare const PanelFooter: React.FunctionComponent<PanelFooterProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PanelFooter = 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
|
+
exports.PanelFooter = (props) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
return (React.createElement(rebass_1.Flex, { className: "ab-Panel__Footer", flexDirection: "row", padding: 1, backgroundColor: "primary", alignItems: "center" },
|
|
11
|
+
React.createElement(SimpleButton_1.default, { margin: 1, variant: "text", "data-name": "action-cancel", onClick: props.onCancel, disabled: props.cancelDisabled }, (_a = props.cancelText) !== null && _a !== void 0 ? _a : 'CANCEL'),
|
|
12
|
+
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
13
|
+
React.createElement(SimpleButton_1.default, { variant: "raised", tone: "accent", "data-name": "action-finish", margin: 1, onClick: props.onAccept, disabled: props.acceptDisabled }, (_b = props.cancelText) !== null && _b !== void 0 ? _b : 'Finish')));
|
|
14
|
+
};
|
|
@@ -24,7 +24,12 @@ exports.AdaptablePopup = (props) => {
|
|
|
24
24
|
const isWindowModal = settingsPanelOptions.popupType === 'window';
|
|
25
25
|
const modalContainer = (_b = (_a = adaptable.adaptableOptions) === null || _a === void 0 ? void 0 : _a.containerOptions) === null || _b === void 0 ? void 0 : _b.modalContainer;
|
|
26
26
|
let friendlyName = null;
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* This means that it is not rendered in the context of Settings Panel
|
|
29
|
+
* - no topbar
|
|
30
|
+
* - no navigation
|
|
31
|
+
*/
|
|
32
|
+
let isStandalone = false;
|
|
28
33
|
let moduleViewContent = null;
|
|
29
34
|
let activeItem = null;
|
|
30
35
|
let accessLevel = 'Full';
|
|
@@ -50,15 +55,15 @@ exports.AdaptablePopup = (props) => {
|
|
|
50
55
|
.getEntitlementService()
|
|
51
56
|
.getEntitlementAccessLevelForModule(componentModule);
|
|
52
57
|
friendlyName = moduleInfo.FriendlyName;
|
|
53
|
-
|
|
58
|
+
isStandalone =
|
|
54
59
|
moduleInfo &&
|
|
55
|
-
(DefaultSettingsPanel_1.
|
|
60
|
+
(DefaultSettingsPanel_1.STANDALONE_MODULE_POPUPS.includes(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.ModuleName) ||
|
|
56
61
|
(props.componentName && props.componentName !== (moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.Popup)));
|
|
57
62
|
activeItem = moduleInfo.ModuleName;
|
|
58
63
|
moduleViewContent = (React.createElement(AdaptablePopupBody_1.AdaptablePopupBody, { api: props.api, module: module, componentName: props.componentName, moduleParams: props.moduleParams, onClearParams: props.onClearParams, onHide: props.onHide }));
|
|
59
64
|
}
|
|
60
65
|
const baseClassName = 'ab-Adaptable-Popup';
|
|
61
|
-
const className = join_1.default(baseClassName, `${baseClassName}--${isWindowModal ? 'window' : 'modal'}`,
|
|
66
|
+
const className = join_1.default(baseClassName, `${baseClassName}--${isWindowModal ? 'window' : 'modal'}`, isStandalone ? `${baseClassName}--action-popup` : `${baseClassName}--settings-popup`);
|
|
62
67
|
return (React.createElement(PopupContext_1.default.Provider, { value: {
|
|
63
68
|
hidePopup: () => {
|
|
64
69
|
if (props.onHide) {
|
|
@@ -66,9 +71,9 @@ exports.AdaptablePopup = (props) => {
|
|
|
66
71
|
}
|
|
67
72
|
},
|
|
68
73
|
} },
|
|
69
|
-
React.createElement(AdaptablePopupDialog_1.AdaptablePopupDialog, { baseClassName: baseClassName, className: className, friendlyName: friendlyName, isActionModule:
|
|
70
|
-
!
|
|
74
|
+
React.createElement(AdaptablePopupDialog_1.AdaptablePopupDialog, { baseClassName: baseClassName, className: className, friendlyName: friendlyName, isActionModule: isStandalone, isWindowModal: isWindowModal, onHide: props.onHide, modalContainer: modalContainer },
|
|
75
|
+
!isStandalone && React.createElement(TopBar_1.default, { icon: settingsPanelOptions.icon }, settingsPanelTitle),
|
|
71
76
|
React.createElement(rebass_1.Flex, { "data-name": props.componentName, flexDirection: "row", flex: "1 1 0", style: { minHeight: 0 }, className: accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '' },
|
|
72
|
-
!
|
|
77
|
+
!isStandalone && (React.createElement(Navigation_1.Navigation, { menuItems: menuItems, api: props.api, activeItem: activeItem, customSettingsPanels: settingsPanelOptions.customSettingsPanels })),
|
|
73
78
|
React.createElement(rebass_1.Flex, { flex: 1, className: "ab-Adaptable-Popup__Body" }, moduleViewContent)))));
|
|
74
79
|
};
|
|
@@ -8,7 +8,7 @@ const react_redux_1 = require("react-redux");
|
|
|
8
8
|
const Dialog_1 = tslib_1.__importDefault(require("../../../../components/Dialog"));
|
|
9
9
|
const SystemRedux_1 = require("../../../../Redux/ActionsReducers/SystemRedux");
|
|
10
10
|
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
11
|
-
const Utilities_1 = require("
|
|
11
|
+
const Utilities_1 = require("../Utilities");
|
|
12
12
|
const WindowDialog = (props) => {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
const { onChange, style, baseClassName, className, isActionModule, settingsPanelOptionsKey, onHide } = props, dialogProps = tslib_1.__rest(props, ["onChange", "style", "baseClassName", "className", "isActionModule", "settingsPanelOptionsKey", "onHide"]);
|
|
@@ -20,7 +20,9 @@ exports.useMenuItems = () => {
|
|
|
20
20
|
navigationItems.push(...settingsPanelOptions.customSettingsPanels.map((panel) => panel.name));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const visibleItems = allMenuItems.filter((item) => item.module !== 'General' &&
|
|
23
|
+
const visibleItems = allMenuItems.filter((item) => item.module !== 'General' &&
|
|
24
|
+
!DefaultSettingsPanel_1.STANDALONE_MODULE_POPUPS.includes(item.module) &&
|
|
25
|
+
item.isVisible);
|
|
24
26
|
return navigationItems
|
|
25
27
|
.map((moduleName) => {
|
|
26
28
|
var _a, _b;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSettingsPanelSize = exports.getActionPanelSize = exports.getMiddlePosition = void 0;
|
|
4
|
-
const Helper_1 = require("
|
|
3
|
+
exports.getWindowPopupSize = exports.getSettingsPanelSize = exports.getActionPanelSize = exports.getMiddlePosition = void 0;
|
|
4
|
+
const Helper_1 = require("../../../Utilities/Helpers/Helper");
|
|
5
5
|
exports.getMiddlePosition = (size) => {
|
|
6
6
|
const height = window.innerHeight;
|
|
7
7
|
const width = window.innerWidth;
|
|
@@ -26,3 +26,6 @@ exports.getSettingsPanelSize = () => {
|
|
|
26
26
|
width: Helper_1.clamp(width * 0.9, 0, 800),
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
+
exports.getWindowPopupSize = () => {
|
|
30
|
+
return exports.getSettingsPanelSize();
|
|
31
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WindowPopups = 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 Dialog_1 = tslib_1.__importDefault(require("../../../../components/Dialog"));
|
|
8
|
+
const PopupRedux_1 = require("../../../../Redux/ActionsReducers/PopupRedux");
|
|
9
|
+
const Utilities_1 = require("../Utilities");
|
|
10
|
+
const windowFactory_1 = require("./windowFactory");
|
|
11
|
+
const NoopComponent = () => {
|
|
12
|
+
return React.createElement(React.Fragment, null);
|
|
13
|
+
};
|
|
14
|
+
exports.WindowPopups = () => {
|
|
15
|
+
const [windowModalSettings, setWindowModalSettings] = React.useState({});
|
|
16
|
+
const dispatch = react_redux_1.useDispatch();
|
|
17
|
+
const windowItems = react_redux_1.useSelector((state) => state.Popup.WindowPopup.PopupList);
|
|
18
|
+
return (React.createElement(React.Fragment, null, windowItems === null || windowItems === void 0 ? void 0 : windowItems.map((windowItem, index) => {
|
|
19
|
+
var _a, _b, _c, _d, _e;
|
|
20
|
+
const Component = (_a = windowFactory_1.windowFactory[windowItem.Id]) !== null && _a !== void 0 ? _a : NoopComponent;
|
|
21
|
+
const _f = windowItem.PopupProps, { windowModalProps } = _f, restPopupProps = tslib_1.__rest(_f, ["windowModalProps"]);
|
|
22
|
+
const handleDismiss = () => {
|
|
23
|
+
dispatch(PopupRedux_1.PopupWindowHide(windowItem.Id));
|
|
24
|
+
};
|
|
25
|
+
const size = (_c = (_b = windowModalSettings === null || windowModalSettings === void 0 ? void 0 : windowModalSettings[windowItem.Id]) === null || _b === void 0 ? void 0 : _b.size) !== null && _c !== void 0 ? _c : Utilities_1.getWindowPopupSize();
|
|
26
|
+
const position = (_e = (_d = windowModalSettings === null || windowModalSettings === void 0 ? void 0 : windowModalSettings[windowItem.Id]) === null || _d === void 0 ? void 0 : _d.position) !== null && _e !== void 0 ? _e : Utilities_1.getMiddlePosition(size);
|
|
27
|
+
return (React.createElement(Dialog_1.default, { "data-name": windowItem.Id, style: { height: '100%' }, className: "ab-Window-Modal", key: windowItem.Id, windowModal: true, windowModalProps: Object.assign(Object.assign({}, windowModalProps), { onChange: (settings) => {
|
|
28
|
+
setWindowModalSettings((settingsMap) => (Object.assign(Object.assign({}, settingsMap), { [windowItem.Id]: settings })));
|
|
29
|
+
}, handleSelector: '.ab-Window-Modal .ab-Panel__header', size: size, position: position }), fixed: false, padding: 0, onDismiss: handleDismiss, isOpen: true, showCloseButton: true },
|
|
30
|
+
React.createElement(Component, { onDismiss: handleDismiss, popupProps: restPopupProps })));
|
|
31
|
+
})));
|
|
32
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.windowFactory = exports.WINDOW_LAYOUT_EDITOR = void 0;
|
|
4
|
+
const LayoutEditorStandalonePopup_1 = require("../../../Layout/LayoutEditorStandalonePopup");
|
|
5
|
+
exports.WINDOW_LAYOUT_EDITOR = 'WINDOW_LAYOUT_EDITOR';
|
|
6
|
+
exports.windowFactory = {
|
|
7
|
+
[exports.WINDOW_LAYOUT_EDITOR]: LayoutEditorStandalonePopup_1.LayoutEditorStandalonePopup,
|
|
8
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LayoutEditorStandalonePopup = 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 uuid_1 = require("../../components/utils/uuid");
|
|
8
|
+
const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
|
|
9
|
+
const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
|
|
10
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
11
|
+
const PanelFooter_1 = require("../Components/Panels/PanelFooter");
|
|
12
|
+
const PanelWithImage_1 = require("../Components/Panels/PanelWithImage");
|
|
13
|
+
const LayoutEditorWizard_1 = require("./Wizard/LayoutEditorWizard");
|
|
14
|
+
const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
|
|
15
|
+
exports.LayoutEditorStandalonePopup = (props) => {
|
|
16
|
+
/**
|
|
17
|
+
* This is here because the old code mutates the object.
|
|
18
|
+
* And we need a way to trigger an update/render.
|
|
19
|
+
*
|
|
20
|
+
* I've left the mutation because we might want to use the old PopupWizard.
|
|
21
|
+
* And it currently, the refactoring of the editor out of the scope of this feature.
|
|
22
|
+
*/
|
|
23
|
+
const [stateLayout, setStateLayout] = React.useState(null);
|
|
24
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
25
|
+
const dispatch = react_redux_1.useDispatch();
|
|
26
|
+
const layoutModule = adaptable.ModuleService.getModuleById('Layout');
|
|
27
|
+
const layouts = react_redux_1.useSelector((state) => state.Layout.Layouts);
|
|
28
|
+
const layoutData = React.useMemo(() => {
|
|
29
|
+
var _a;
|
|
30
|
+
let layoutData = null;
|
|
31
|
+
const layoutToCloneOrEdit = (_a = props === null || props === void 0 ? void 0 : props.popupProps) === null || _a === void 0 ? void 0 : _a.layout;
|
|
32
|
+
switch (props.popupProps.action) {
|
|
33
|
+
case 'Clone':
|
|
34
|
+
layoutData = Helper_1.default.cloneObject(layoutToCloneOrEdit);
|
|
35
|
+
layoutData.Name = '';
|
|
36
|
+
layoutData.IsReadOnly = false;
|
|
37
|
+
layoutData.Uuid = uuid_1.createUuid();
|
|
38
|
+
break;
|
|
39
|
+
case 'New':
|
|
40
|
+
layoutData = ObjectFactory_1.default.CreateEmptyLayout({ Name: '' });
|
|
41
|
+
break;
|
|
42
|
+
case 'Edit':
|
|
43
|
+
layoutData = Helper_1.default.cloneObject(layoutToCloneOrEdit);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
return layoutData;
|
|
47
|
+
}, []);
|
|
48
|
+
const handleCancel = React.useCallback(() => {
|
|
49
|
+
props.onDismiss();
|
|
50
|
+
}, []);
|
|
51
|
+
const handleAccept = React.useCallback(() => {
|
|
52
|
+
var _a;
|
|
53
|
+
switch ((_a = props === null || props === void 0 ? void 0 : props.popupProps) === null || _a === void 0 ? void 0 : _a.action) {
|
|
54
|
+
case 'Edit':
|
|
55
|
+
const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
|
|
56
|
+
dispatch(LayoutRedux.LayoutSave(layoutData));
|
|
57
|
+
if (currentLayout.Uuid === layoutData.Uuid) {
|
|
58
|
+
dispatch(LayoutRedux.LayoutSelect(layoutData.Name));
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
case 'Clone':
|
|
62
|
+
dispatch(LayoutRedux.LayoutAdd(layoutData));
|
|
63
|
+
dispatch(LayoutRedux.LayoutSelect(layoutData.Name));
|
|
64
|
+
break;
|
|
65
|
+
case 'New':
|
|
66
|
+
dispatch(LayoutRedux.LayoutAdd(layoutData));
|
|
67
|
+
dispatch(LayoutRedux.LayoutSelect(layoutData.Name));
|
|
68
|
+
}
|
|
69
|
+
props.onDismiss();
|
|
70
|
+
}, []);
|
|
71
|
+
const finishDisabled = !layoutData.Name;
|
|
72
|
+
return (React.createElement(React.Fragment, null,
|
|
73
|
+
React.createElement(PanelWithImage_1.PanelWithImage, { bodyProps: { padding: 2 }, flex: 1, glyphicon: layoutModule.moduleInfo.Glyph, header: layoutModule.moduleInfo.FriendlyName, infoLink: layoutModule.moduleInfo.HelpPage, infoLinkDisabled: false, variant: "primary" },
|
|
74
|
+
React.createElement(LayoutEditorWizard_1.LayoutEditorWizard, { data: layoutData, api: adaptable.api, Layouts: layouts, moduleInfo: layoutModule.moduleInfo, onLayoutChange: setStateLayout, updateGoBackState: () => null })),
|
|
75
|
+
React.createElement(PanelFooter_1.PanelFooter, { acceptDisabled: finishDisabled, onAccept: handleAccept, onCancel: handleCancel })));
|
|
76
|
+
};
|
|
@@ -10,7 +10,6 @@ const TeamSharingRedux = tslib_1.__importStar(require("../../Redux/ActionsReduce
|
|
|
10
10
|
const LayoutWizard_1 = require("./Wizard/LayoutWizard");
|
|
11
11
|
const LayoutEntityRow_1 = require("./LayoutEntityRow");
|
|
12
12
|
const Helper_1 = require("../../Utilities/Helpers/Helper");
|
|
13
|
-
const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
|
|
14
13
|
const ButtonNew_1 = require("../Components/Buttons/ButtonNew");
|
|
15
14
|
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
16
15
|
const AdaptableObjectCollection_1 = require("../Components/AdaptableObjectCollection");
|
|
@@ -18,7 +17,6 @@ const EditableConfigEntityState_1 = require("../Components/SharedProps/EditableC
|
|
|
18
17
|
const UIHelper_1 = require("../UIHelper");
|
|
19
18
|
const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
|
|
20
19
|
const EmptyContent_1 = tslib_1.__importDefault(require("../../components/EmptyContent"));
|
|
21
|
-
const uuid_1 = require("../../components/utils/uuid");
|
|
22
20
|
const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
|
|
23
21
|
class LayoutPopupComponent extends React.Component {
|
|
24
22
|
constructor(props) {
|
|
@@ -82,32 +80,13 @@ class LayoutPopupComponent extends React.Component {
|
|
|
82
80
|
this.state.editedAdaptableObject != null && (React.createElement(LayoutWizard_1.LayoutWizard, { moduleInfo: this.props.moduleInfo, editedAdaptableObject: this.state.editedAdaptableObject, configEntities: this.props.Layouts, modalContainer: this.props.modalContainer, ColumnSorts: this.props.api.gridApi.getColumnSorts(), api: this.props.api, wizardStartIndex: this.state.wizardStartIndex, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: () => this.onFinishWizard(), canFinishWizard: () => this.canFinishWizard() }))));
|
|
83
81
|
}
|
|
84
82
|
onNew() {
|
|
85
|
-
this.
|
|
86
|
-
editedAdaptableObject: ObjectFactory_1.ObjectFactory.CreateEmptyLayout({
|
|
87
|
-
Name: '',
|
|
88
|
-
}),
|
|
89
|
-
wizardStartIndex: 0,
|
|
90
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.New,
|
|
91
|
-
});
|
|
83
|
+
this.props.api.layoutApi.showLayoutEditor(null, 'New');
|
|
92
84
|
}
|
|
93
85
|
onEdit(layout) {
|
|
94
|
-
|
|
95
|
-
this.setState({
|
|
96
|
-
editedAdaptableObject: clonedObject,
|
|
97
|
-
wizardStartIndex: 0,
|
|
98
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.Edit,
|
|
99
|
-
});
|
|
86
|
+
this.props.api.layoutApi.showLayoutEditor(layout.Name, 'Edit');
|
|
100
87
|
}
|
|
101
88
|
onClone(layout) {
|
|
102
|
-
|
|
103
|
-
clonedObject.Name = '';
|
|
104
|
-
clonedObject.IsReadOnly = false;
|
|
105
|
-
clonedObject.Uuid = uuid_1.createUuid();
|
|
106
|
-
this.setState({
|
|
107
|
-
editedAdaptableObject: clonedObject,
|
|
108
|
-
wizardStartIndex: 0,
|
|
109
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.New,
|
|
110
|
-
});
|
|
89
|
+
this.props.api.layoutApi.showLayoutEditor(layout.Name, 'Clone');
|
|
111
90
|
}
|
|
112
91
|
onCloseWizard() {
|
|
113
92
|
this.props.onClearPopupParams();
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
|
|
2
2
|
import * as LayoutRedux from '../../Redux/ActionsReducers/LayoutRedux';
|
|
3
3
|
import { Layout } from '../../PredefinedConfig/LayoutState';
|
|
4
|
-
import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
|
|
5
4
|
import * as React from 'react';
|
|
5
|
+
export declare const COMPONENT_LAYOUT_POPUP_NAME = "LayoutEditorStandalonePopup";
|
|
6
6
|
export interface LayoutViewPanelComponentProps extends ViewPanelProps {
|
|
7
7
|
onSelectLayout: (layoutName: string) => LayoutRedux.LayoutSelectAction;
|
|
8
8
|
onSaveLayout: (layout: Layout) => void;
|
|
9
|
-
onNewLayout: (popup: string) => PopupRedux.PopupShowScreenAction;
|
|
10
|
-
onCloneLayout: (popup: string) => PopupRedux.PopupShowScreenAction;
|
|
11
|
-
onEditLayout: (popup: string) => PopupRedux.PopupShowScreenAction;
|
|
12
9
|
Layouts: Layout[];
|
|
13
10
|
CurrentDraftLayout: Layout;
|
|
14
11
|
CanSave: boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LayoutViewPanelControl = void 0;
|
|
3
|
+
exports.LayoutViewPanelControl = exports.COMPONENT_LAYOUT_POPUP_NAME = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
|
|
6
|
-
const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
|
|
7
6
|
const React = tslib_1.__importStar(require("react"));
|
|
8
7
|
const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
|
|
9
8
|
const rebass_1 = require("rebass");
|
|
@@ -14,9 +13,9 @@ const ButtonSave_1 = require("../Components/Buttons/ButtonSave");
|
|
|
14
13
|
const ButtonEdit_1 = require("../Components/Buttons/ButtonEdit");
|
|
15
14
|
const ButtonNew_1 = require("../Components/Buttons/ButtonNew");
|
|
16
15
|
const ButtonDelete_1 = require("../Components/Buttons/ButtonDelete");
|
|
17
|
-
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
18
16
|
const react_redux_1 = require("react-redux");
|
|
19
17
|
const ButtonClone_1 = require("../Components/Buttons/ButtonClone");
|
|
18
|
+
exports.COMPONENT_LAYOUT_POPUP_NAME = 'LayoutEditorStandalonePopup';
|
|
20
19
|
class LayoutViewPanelComponent extends React.Component {
|
|
21
20
|
render() {
|
|
22
21
|
let layoutEntity = this.props.Layouts.find((x) => x.Name == this.props.CurrentLayoutName || x.Uuid == this.props.CurrentLayoutName);
|
|
@@ -34,9 +33,9 @@ class LayoutViewPanelComponent extends React.Component {
|
|
|
34
33
|
React.createElement(DropdownButton_1.default, { marginRight: 2, columns: ['label'], style: { width: '100%', fontSize: 'small' }, className: `ab-${elementType}__Layout__select`, items: availableLayoutOptions, disabled: availableLayoutOptions.length == 0 }, layoutEntity ? layoutEntity.Name : null)),
|
|
35
34
|
React.createElement(rebass_1.Flex, { flexDirection: "row", className: join_1.default(this.props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Layout__wrap`) },
|
|
36
35
|
isManualSaveLayout && (React.createElement(ButtonSave_1.ButtonSave, { className: `ab-${elementType}__Layout__save`, onClick: () => this.onSaveLayout(), tooltip: "Save Changes to Current Layout", disabled: !this.props.CanSave, accessLevel: accessLevel })),
|
|
37
|
-
React.createElement(ButtonEdit_1.ButtonEdit, { onClick: () => this.props.
|
|
38
|
-
React.createElement(ButtonClone_1.ButtonClone, { onClick: () => this.props.
|
|
39
|
-
React.createElement(ButtonNew_1.ButtonNew, { children: null, tone: "neutral", variant: "text", className: `ab-${elementType}__Layout__new`, onClick: () => this.props.
|
|
36
|
+
React.createElement(ButtonEdit_1.ButtonEdit, { onClick: () => this.props.api.layoutApi.showLayoutEditor(layoutEntity.Name), tooltip: "Edit Layout", className: `ab-${elementType}__Layout__edit`, accessLevel: accessLevel }),
|
|
37
|
+
React.createElement(ButtonClone_1.ButtonClone, { onClick: () => this.props.api.layoutApi.showLayoutEditor(layoutEntity.Name, 'Clone'), tooltip: "Clone Layout", className: `ab-${elementType}__Layout__clone`, tone: "neutral", variant: "text", children: null, accessLevel: cloneAccessLevel }),
|
|
38
|
+
React.createElement(ButtonNew_1.ButtonNew, { children: null, tone: "neutral", variant: "text", className: `ab-${elementType}__Layout__new`, onClick: () => this.props.api.layoutApi.showLayoutEditor(null, 'New'), tooltip: "Create a new Layout", accessLevel: newAccessLevel }),
|
|
40
39
|
React.createElement(ButtonDelete_1.ButtonDelete, { tooltip: "Delete Layout", disabled: this.props.Layouts.length <= 1, className: `ab-${elementType}__Layout__delete`, ConfirmAction: LayoutRedux.LayoutDelete(layoutEntity), ConfirmationMsg: "Are you sure you want to delete '" + this.props.CurrentLayoutName + "'?", ConfirmationTitle: 'Delete Layout', accessLevel: accessLevel }))));
|
|
41
40
|
}
|
|
42
41
|
onSaveLayout() {
|
|
@@ -66,18 +65,6 @@ function mapDispatchToProps(dispatch) {
|
|
|
66
65
|
dispatch(LayoutRedux.LayoutSave(layout));
|
|
67
66
|
dispatch(LayoutRedux.LayoutUpdateCurrentDraft(null));
|
|
68
67
|
},
|
|
69
|
-
onNewLayout: (popup) => dispatch(PopupRedux.PopupShowScreen(ModuleConstants.LayoutModuleId, popup, {
|
|
70
|
-
action: 'New',
|
|
71
|
-
source: 'Toolbar',
|
|
72
|
-
})),
|
|
73
|
-
onCloneLayout: (popup) => dispatch(PopupRedux.PopupShowScreen(ModuleConstants.LayoutModuleId, popup, {
|
|
74
|
-
action: 'Clone',
|
|
75
|
-
source: 'Toolbar',
|
|
76
|
-
})),
|
|
77
|
-
onEditLayout: (popup) => dispatch(PopupRedux.PopupShowScreen(ModuleConstants.LayoutModuleId, popup, {
|
|
78
|
-
action: 'Edit',
|
|
79
|
-
source: 'Toolbar',
|
|
80
|
-
})),
|
|
81
68
|
};
|
|
82
69
|
}
|
|
83
70
|
exports.LayoutViewPanelControl = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(LayoutViewPanelComponent);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AdaptableColumnProperties } from '../../../../PredefinedConfig/Common/AdaptableColumn';
|
|
3
|
+
export declare const ColumnLabels: (props: AdaptableColumnProperties & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
labels?: Record<string, React.ReactNode>;
|
|
6
|
+
flexDirection?: 'row' | 'column';
|
|
7
|
+
showBoth?: boolean;
|
|
8
|
+
showTitle?: boolean;
|
|
9
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColumnLabels = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
exports.ColumnLabels = (props) => {
|
|
8
|
+
const { children, showBoth, showTitle, flexDirection = 'row', labels: labelsProp } = props, columnProperties = tslib_1.__rest(props, ["children", "showBoth", "showTitle", "flexDirection", "labels"]);
|
|
9
|
+
const labelNames = [
|
|
10
|
+
'Aggregatable',
|
|
11
|
+
'Filterable',
|
|
12
|
+
'Groupable',
|
|
13
|
+
'Moveable',
|
|
14
|
+
'Pivotable',
|
|
15
|
+
'Sortable',
|
|
16
|
+
];
|
|
17
|
+
const labels = labelNames.map((name) => columnProperties[name.toLocaleLowerCase()] ? name.charAt(0) : '');
|
|
18
|
+
const flexProps = {
|
|
19
|
+
[flexDirection === 'row' ? 'alignItems' : 'justifyContent']: 'center',
|
|
20
|
+
};
|
|
21
|
+
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
|
+
labels.map((l, index) => {
|
|
24
|
+
const enabled = !!l;
|
|
25
|
+
const labelName = labelNames[index];
|
|
26
|
+
const letter = labelName.charAt(0);
|
|
27
|
+
const renderBox = (enabled, key) => {
|
|
28
|
+
return (React.createElement(rebass_1.Flex, { className: "ab-LayoutEditor__LegendLetter", width: '20px', height: '20px', alignItems: "center", justifyContent: "center", fontSize: 2, ml: 2, backgroundColor: "defaultbackground", title: enabled ? labelName : `Not ${labelName}`, style: {
|
|
29
|
+
overflow: 'hidden',
|
|
30
|
+
cursor: 'auto',
|
|
31
|
+
position: 'relative',
|
|
32
|
+
fontWeight: 600,
|
|
33
|
+
lineHeight: 0,
|
|
34
|
+
border: `1px solid var(--ab-color-${enabled ? 'accent' : 'inputborder'})`,
|
|
35
|
+
borderRadius: 'var(--ab__border-radius)',
|
|
36
|
+
opacity: enabled ? 1 : 0.5,
|
|
37
|
+
}, key: `${letter}${key ? key : ''}` },
|
|
38
|
+
!enabled ? (React.createElement("div", { style: {
|
|
39
|
+
background: 'currentColor',
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
bottom: '-100%',
|
|
42
|
+
right: 0,
|
|
43
|
+
width: 2,
|
|
44
|
+
height: '200%',
|
|
45
|
+
transform: 'skewX(45deg)',
|
|
46
|
+
} })) : null,
|
|
47
|
+
letter));
|
|
48
|
+
};
|
|
49
|
+
return (React.createElement(rebass_1.Flex, { key: letter, mt: flexDirection === 'row' ? 0 : 2, flexDirection: "row", alignItems: "center" },
|
|
50
|
+
renderBox(enabled),
|
|
51
|
+
showBoth ? renderBox(!enabled, 'label') : null,
|
|
52
|
+
labelsProp ? (React.createElement(rebass_1.Flex, { key: "labelProps", flex: 1, ml: 2, className: "ab-LayoutEditor__LegendLetterDescription" }, labelsProp[labelName])) : null));
|
|
53
|
+
}),
|
|
54
|
+
children));
|
|
55
|
+
};
|