@adaptabletools/adaptable 11.0.0-canary.0 → 11.0.0-canary.4
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 +21 -10
- package/bundle.cjs.js +98 -94
- package/index.css +23 -10
- package/package.json +32 -32
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -1
- package/src/AdaptableOptions/DashboardOptions.d.ts +3 -2
- package/src/AdaptableOptions/EntitlementOptions.d.ts +1 -1
- package/src/AdaptableOptions/GeneralOptions.d.ts +1 -1
- package/src/AdaptableOptions/TeamSharingOptions.d.ts +1 -1
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +0 -1
- package/src/Api/Events/SearchChanged.d.ts +1 -1
- package/src/Api/GridApi.d.ts +5 -4
- package/src/Api/Implementation/DashboardApiImpl.js +1 -1
- package/src/Api/Implementation/FlashingCellApiImpl.js +2 -4
- package/src/Api/Implementation/GridApiImpl.d.ts +5 -4
- package/src/Api/Implementation/GridApiImpl.js +4 -0
- package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
- package/src/Api/Implementation/InternalApiImpl.js +1 -9
- package/src/Api/Implementation/LayoutApiImpl.js +1 -1
- package/src/Api/InternalApi.d.ts +0 -1
- package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -12
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/RowHighlightInfo.d.ts +15 -0
- package/src/PredefinedConfig/Common/RowHighlightInfo.js +2 -0
- package/src/PredefinedConfig/Common/Types.d.ts +1 -1
- package/src/PredefinedConfig/DashboardState.d.ts +4 -4
- package/src/PredefinedConfig/FlashingCellState.d.ts +2 -1
- package/src/PredefinedConfig/SystemState.d.ts +2 -1
- package/src/Redux/ActionsReducers/DashboardRedux.d.ts +0 -7
- package/src/Redux/ActionsReducers/DashboardRedux.js +1 -11
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +6 -5
- package/src/Redux/ActionsReducers/SystemRedux.js +13 -13
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +5 -5
- package/src/Redux/Store/AdaptableStore.js +13 -3
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.js +1 -1
- package/src/Strategy/FlashingCellModule.d.ts +1 -1
- package/src/Strategy/FlashingCellModule.js +32 -16
- package/src/Strategy/TeamSharingModule.js +1 -1
- package/src/Strategy/Utilities/getFlashingTargetViewItems.d.ts +1 -1
- package/src/Strategy/Utilities/getFlashingTargetViewItems.js +3 -1
- package/src/Utilities/ExpressionFunctions/aggregationExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +2 -3
- package/src/Utilities/Extensions/StringExtensions.js +1 -1
- package/src/Utilities/Helpers/AdaptableHelper.js +2 -2
- package/src/Utilities/ObjectFactory.js +4 -2
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/ReportService.js +1 -1
- package/src/View/AdaptableView.js +1 -1
- package/src/View/Alert/Wizard/AlertRulesWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.d.ts +2 -3
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +1 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +10 -23
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +15 -4
- package/src/View/Components/FilterForm/QuickFilterForm.js +4 -6
- package/src/View/Components/ModuleValueSelector/index.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.d.ts +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +43 -87
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +10 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +54 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.d.ts +3 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +19 -6
- package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +1 -3
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +6 -14
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.d.ts +2 -0
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +44 -0
- package/src/View/Components/SharedProps/ModuleViewPopupProps.d.ts +1 -1
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +4 -4
- package/src/View/Components/ValueSelector/index.d.ts +2 -1
- package/src/View/Components/ValueSelector/index.js +5 -5
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +10 -5
- package/src/View/CustomSort/Wizard/CustomSortWizard.js +16 -4
- package/src/View/Dashboard/Dashboard.js +4 -4
- package/src/View/Dashboard/DashboardPopup.js +5 -5
- package/src/View/Export/Wizard/NewReportWizard.js +13 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +17 -26
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +19 -2
- package/src/View/FlashingCell/Wizard/{FlashingCellDurationWizardSection.d.ts → FlashingCellSettingsWizardSection.d.ts} +3 -3
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +81 -0
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +5 -5
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +10 -5
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +8 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +13 -5
- package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +8 -2
- package/src/View/Query/QueryViewPanel.js +12 -9
- package/src/View/Query/Wizard/NamedQueryWizard.js +3 -1
- package/src/View/QuickSearch/useQuickSearchDebounced.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleWizard.js +14 -14
- package/src/View/SpecialColumnSettingsWizardStep.d.ts +9 -0
- package/src/View/SpecialColumnSettingsWizardStep.js +62 -0
- package/src/View/Wizard/AdaptableWizard.js +1 -1
- package/src/View/Wizard/Interface/IAdaptableWizard.d.ts +2 -0
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
- package/src/agGrid/Adaptable.d.ts +0 -2
- package/src/agGrid/Adaptable.js +32 -22
- package/src/agGrid/agGridHelper.js +2 -3
- package/src/agGrid/agGridMenuHelper.js +5 -9
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/Dashboard/DashboardManager.d.ts +5 -3
- package/src/components/Dashboard/DashboardManager.js +33 -27
- package/src/components/DropdownButton/renderItem.js +1 -1
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/OverlayTrigger/Overlay.js +1 -1
- package/src/components/WindowModal/WindowModal.js +17 -2
- package/src/components/utils/useDraggable.js +2 -1
- package/src/metamodel/adaptable.metamodel.d.ts +9 -0
- package/src/metamodel/adaptable.metamodel.js +18 -11
- package/src/types.d.ts +2 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellDurationWizardSection.js +0 -60
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.QuickFilterFormReact = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const debounce_1 = tslib_1.__importDefault(require("lodash
|
|
6
|
+
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
7
7
|
const FilterRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/FilterRedux"));
|
|
8
8
|
const react_redux_1 = require("react-redux");
|
|
9
9
|
const ObjectFactory_1 = require("../../../Utilities/ObjectFactory");
|
|
@@ -16,7 +16,7 @@ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Ex
|
|
|
16
16
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../AdaptableInput"));
|
|
17
17
|
const renderWithAdaptableContext_1 = require("../../renderWithAdaptableContext");
|
|
18
18
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
19
|
-
const isEqual_1 = tslib_1.__importDefault(require("lodash
|
|
19
|
+
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
20
20
|
const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
|
|
21
21
|
const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredicate");
|
|
22
22
|
class QuickFilterFormComponent extends React.Component {
|
|
@@ -106,14 +106,12 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
106
106
|
hideEvent = 'blur';
|
|
107
107
|
}
|
|
108
108
|
let showQuickFilterDropdown = true;
|
|
109
|
-
let hideQuickFilterDropdownFunction = this.props.api.internalApi.getAdaptableOptions()
|
|
110
|
-
.filterOptions.hideQuickFilterDropdown;
|
|
109
|
+
let hideQuickFilterDropdownFunction = this.props.api.internalApi.getAdaptableOptions().filterOptions.hideQuickFilterDropdown;
|
|
111
110
|
if (hideQuickFilterDropdownFunction) {
|
|
112
111
|
showQuickFilterDropdown = !hideQuickFilterDropdownFunction(this.props.currentColumn);
|
|
113
112
|
}
|
|
114
113
|
let showQuickFilterInput = true;
|
|
115
|
-
let hideQuickFilterInputFunction = this.props.api.internalApi.getAdaptableOptions()
|
|
116
|
-
.filterOptions.hideQuickFilterInput;
|
|
114
|
+
let hideQuickFilterInputFunction = this.props.api.internalApi.getAdaptableOptions().filterOptions.hideQuickFilterInput;
|
|
117
115
|
if (hideQuickFilterInputFunction) {
|
|
118
116
|
showQuickFilterInput = !hideQuickFilterInputFunction(this.props.currentColumn);
|
|
119
117
|
}
|
|
@@ -30,5 +30,5 @@ exports.ModuleValueSelector = (props) => {
|
|
|
30
30
|
const sortedOptions = react_1.useMemo(() => {
|
|
31
31
|
return sortWithOrder_1.sortWithOrderArray(options, value, { sortUnorderedItems: true });
|
|
32
32
|
}, [allowReorder, options, value]);
|
|
33
|
-
return (React.createElement(ValueSelector_1.ValueSelector, Object.assign({}, valueSelectorProps, { options: sortedOptions, value: value, onChange: onChange, allowReorder: allowReorder, toIdentifier: (module) => module, toLabel: (module) => moduleLabelMap.get(module), selectionBoxPosition: selectionBoxPosition,
|
|
33
|
+
return (React.createElement(ValueSelector_1.ValueSelector, Object.assign({}, valueSelectorProps, { options: sortedOptions, value: value, onChange: onChange, allowReorder: allowReorder, toIdentifier: (module) => module, toLabel: (module) => moduleLabelMap.get(module), selectionBoxPosition: selectionBoxPosition, isOptionDisabled: props.isOptionDisabled, disabled: props.disabled })));
|
|
34
34
|
};
|
|
@@ -3,9 +3,6 @@ import * as PopupRedux from '../../../../Redux/ActionsReducers/PopupRedux';
|
|
|
3
3
|
import { ModuleParams } from '../../SharedProps/ModuleViewPopupProps';
|
|
4
4
|
import { AdaptableModule } from '../../../../PredefinedConfig/Common/Types';
|
|
5
5
|
import { AdaptableApi } from '../../../../Api/AdaptableApi';
|
|
6
|
-
/**
|
|
7
|
-
* This is the main popup that we use - so all Module popups will appear here.
|
|
8
|
-
*/
|
|
9
6
|
export interface AdaptablePopupProps {
|
|
10
7
|
componentName?: string;
|
|
11
8
|
componentModule: AdaptableModule;
|
|
@@ -4,100 +4,63 @@ exports.AdaptablePopup = 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 react_redux_1 = require("react-redux");
|
|
8
|
-
const PopupRedux = tslib_1.__importStar(require("../../../../Redux/ActionsReducers/PopupRedux"));
|
|
9
7
|
const GeneralConstants = tslib_1.__importStar(require("../../../../Utilities/Constants/GeneralConstants"));
|
|
10
8
|
const TopBar_1 = tslib_1.__importDefault(require("./TopBar"));
|
|
11
9
|
const join_1 = tslib_1.__importDefault(require("../../../../components/utils/join"));
|
|
12
10
|
const Navigation_1 = require("./Navigation");
|
|
13
11
|
const PopupContext_1 = tslib_1.__importDefault(require("./PopupContext"));
|
|
14
12
|
const AdaptablePopupBody_1 = require("./AdaptablePopupBody");
|
|
15
|
-
const Dialog_1 = tslib_1.__importDefault(require("../../../../components/Dialog"));
|
|
16
|
-
const SystemRedux_1 = require("../../../../Redux/ActionsReducers/SystemRedux");
|
|
17
|
-
const Utilities_1 = require("./Utilities");
|
|
18
13
|
const DefaultSettingsPanel_1 = require("../../../../Utilities/Defaults/DefaultSettingsPanel");
|
|
19
14
|
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
20
15
|
const CustomSettingsPanelView_1 = require("./CustomSettingsPanelView");
|
|
16
|
+
const useMenuItems_1 = require("./useMenuItems");
|
|
17
|
+
const AdaptablePopupDialog_1 = require("./AdaptablePopupDialog");
|
|
21
18
|
exports.AdaptablePopup = (props) => {
|
|
22
|
-
var _a, _b, _c, _d, _e;
|
|
23
19
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
24
|
-
const dispatch = react_redux_1.useDispatch();
|
|
25
20
|
const settingsPanelOptions = adaptable.adaptableOptions.settingsPanelOptions;
|
|
26
21
|
const settingsPanelTitle = adaptable.api.internalApi.getModuleFriendlyName('SettingsPanel');
|
|
27
|
-
|
|
28
|
-
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.ModuleDropdownMenuItems; });
|
|
29
|
-
const menuItems = React.useMemo(() => {
|
|
30
|
-
var _a;
|
|
31
|
-
let navigationItems = (_a = settingsPanelOptions === null || settingsPanelOptions === void 0 ? void 0 : settingsPanelOptions.navigation) === null || _a === void 0 ? void 0 : _a.items;
|
|
32
|
-
if (!navigationItems) {
|
|
33
|
-
navigationItems = [...DefaultSettingsPanel_1.DEFAULT_NAVIGATION_ITEMS];
|
|
34
|
-
if (settingsPanelOptions.customSettingsPanels) {
|
|
35
|
-
navigationItems.push(...settingsPanelOptions.customSettingsPanels.map((panel) => panel.name));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const visibleItems = allMenuItems.filter((item) => item.module !== 'General' && !DefaultSettingsPanel_1.ACTION_POPUPS.includes(item.module) && item.isVisible);
|
|
39
|
-
return navigationItems
|
|
40
|
-
.map((moduleName) => {
|
|
41
|
-
var _a, _b;
|
|
42
|
-
if (moduleName === '-') {
|
|
43
|
-
return moduleName;
|
|
44
|
-
}
|
|
45
|
-
const customSettingsPanel = (_b = (_a = settingsPanelOptions === null || settingsPanelOptions === void 0 ? void 0 : settingsPanelOptions.customSettingsPanels) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (panel) => panel.name === moduleName);
|
|
46
|
-
let customPanelMenuItem = null;
|
|
47
|
-
if (customSettingsPanel) {
|
|
48
|
-
customPanelMenuItem = {
|
|
49
|
-
label: customSettingsPanel.name,
|
|
50
|
-
isVisible: true,
|
|
51
|
-
reduxAction: PopupRedux.PopupShowScreen(null, customSettingsPanel.name, null, {
|
|
52
|
-
isCustomSettingsPanel: true,
|
|
53
|
-
}),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
return customPanelMenuItem || visibleItems.find((item) => item.module === moduleName);
|
|
57
|
-
})
|
|
58
|
-
.filter(Boolean);
|
|
59
|
-
}, [allMenuItems]);
|
|
60
|
-
const isCustomSettingsPanel = (_a = props.moduleProps) === null || _a === void 0 ? void 0 : _a.isCustomSettingsPanel;
|
|
61
|
-
const customSettingsPanel = isCustomSettingsPanel &&
|
|
62
|
-
settingsPanelOptions.customSettingsPanels.find((settingsPanel) => settingsPanel.name === props.componentName);
|
|
63
|
-
let componentModule = props.componentModule;
|
|
64
|
-
// When it is opened without specifying a module
|
|
65
|
-
const firstMenuItem = (_b = menuItems.find((menuItem) => menuItem !== '-')) === null || _b === void 0 ? void 0 : _b.module;
|
|
66
|
-
if (!customSettingsPanel && !props.componentModule && firstMenuItem !== 'General') {
|
|
67
|
-
componentModule = firstMenuItem;
|
|
68
|
-
}
|
|
69
|
-
const accessLevel = props.api.internalApi
|
|
70
|
-
.getEntitlementService()
|
|
71
|
-
.getEntitlementAccessLevelForModule(componentModule);
|
|
72
|
-
const module = props.api.internalApi.getModuleService().getModuleById(componentModule);
|
|
73
|
-
const moduleInfo = module === null || module === void 0 ? void 0 : module.moduleInfo;
|
|
74
|
-
// action popups + non-primary module popups
|
|
75
|
-
const isActionModule = DefaultSettingsPanel_1.ACTION_POPUPS.includes(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.ModuleName) ||
|
|
76
|
-
(props.componentName && props.componentName !== moduleInfo.Popup);
|
|
77
|
-
const baseClassName = 'ab-Adaptable-Popup';
|
|
78
|
-
const className = join_1.default(baseClassName, `${baseClassName}--${(_c = settingsPanelOptions.popupType) !== null && _c !== void 0 ? _c : 'window'}`, isActionModule ? `${baseClassName}--action-popup` : `${baseClassName}--settings-popup`);
|
|
22
|
+
const menuItems = useMenuItems_1.useMenuItems();
|
|
79
23
|
const isWindowModal = settingsPanelOptions.popupType === 'window';
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
|
|
24
|
+
let friendlyName = null;
|
|
25
|
+
let isActionModule = false;
|
|
26
|
+
let moduleViewContent = null;
|
|
27
|
+
let activeItem = null;
|
|
28
|
+
let accessLevel = 'Full';
|
|
29
|
+
const firstMenuItem = menuItems.find((menuItem) => menuItem !== '-');
|
|
30
|
+
const firstMenuModule = firstMenuItem === null || firstMenuItem === void 0 ? void 0 : firstMenuItem.module;
|
|
31
|
+
let componentModule = props.componentModule;
|
|
32
|
+
let componentName = props.componentName;
|
|
33
|
+
// ts forces to check for General, there is no menu item General
|
|
34
|
+
const useFirstItem = !props.componentModule;
|
|
35
|
+
if (useFirstItem && firstMenuModule !== 'General') {
|
|
36
|
+
componentModule = firstMenuModule;
|
|
83
37
|
}
|
|
84
|
-
|
|
85
|
-
|
|
38
|
+
const isCustomSettingsPanel = componentModule === 'CustomSettingsPanelModule';
|
|
39
|
+
if (isCustomSettingsPanel) {
|
|
40
|
+
if (useFirstItem) {
|
|
41
|
+
componentName = firstMenuItem.label;
|
|
42
|
+
}
|
|
43
|
+
const customSettingsPanel = settingsPanelOptions.customSettingsPanels.find((settingsPanel) => settingsPanel.name === componentName);
|
|
44
|
+
friendlyName = customSettingsPanel.name;
|
|
45
|
+
activeItem = customSettingsPanel.name;
|
|
46
|
+
moduleViewContent = React.createElement(CustomSettingsPanelView_1.CustomSettingsPanelView, { settingsPanel: customSettingsPanel });
|
|
86
47
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
48
|
+
else {
|
|
49
|
+
const module = props.api.internalApi.getModuleService().getModuleById(componentModule);
|
|
50
|
+
const moduleInfo = module === null || module === void 0 ? void 0 : module.moduleInfo;
|
|
51
|
+
accessLevel = props.api.internalApi
|
|
52
|
+
.getEntitlementService()
|
|
53
|
+
.getEntitlementAccessLevelForModule(componentModule);
|
|
54
|
+
friendlyName = moduleInfo.FriendlyName;
|
|
55
|
+
isActionModule =
|
|
56
|
+
moduleInfo &&
|
|
57
|
+
(DefaultSettingsPanel_1.ACTION_POPUPS.includes(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.ModuleName) ||
|
|
58
|
+
(props.componentName && props.componentName !== (moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.Popup)));
|
|
59
|
+
activeItem = moduleInfo.ModuleName;
|
|
60
|
+
moduleViewContent = (React.createElement(AdaptablePopupBody_1.AdaptablePopupBody, { api: props.api, module: module, componentName: props.componentName, moduleParams: props.moduleParams, onClearParams: props.onClearParams, onHide: props.onHide }));
|
|
97
61
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
};
|
|
62
|
+
const baseClassName = 'ab-Adaptable-Popup';
|
|
63
|
+
const className = join_1.default(baseClassName, `${baseClassName}--${isWindowModal ? 'window' : 'modal'}`, isActionModule ? `${baseClassName}--action-popup` : `${baseClassName}--settings-popup`);
|
|
101
64
|
return (React.createElement(PopupContext_1.default.Provider, { value: {
|
|
102
65
|
hidePopup: () => {
|
|
103
66
|
if (props.onHide) {
|
|
@@ -105,16 +68,9 @@ exports.AdaptablePopup = (props) => {
|
|
|
105
68
|
}
|
|
106
69
|
},
|
|
107
70
|
} },
|
|
108
|
-
React.createElement(
|
|
109
|
-
handleSelector: isActionModule
|
|
110
|
-
? `.${baseClassName} .ab-Panel__header`
|
|
111
|
-
: '.ab-Adaptable-Popup__TopBar',
|
|
112
|
-
size: popupSettings.size,
|
|
113
|
-
position: popupSettings.position,
|
|
114
|
-
onChange: handleWindowSettings,
|
|
115
|
-
}, style: style, padding: 0, height: isWindowModal ? null : '90vh', width: isWindowModal ? null : '90vw', className: className, onDismiss: props.onHide, isOpen: true, showCloseButton: true }, props.moduleProps),
|
|
71
|
+
React.createElement(AdaptablePopupDialog_1.AdaptablePopupDialog, { baseClassName: baseClassName, className: className, friendlyName: friendlyName, isActionModule: isActionModule, isWindowModal: isWindowModal, onHide: props.onHide },
|
|
116
72
|
!isActionModule && React.createElement(TopBar_1.default, { icon: settingsPanelOptions.icon }, settingsPanelTitle),
|
|
117
73
|
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 : '' },
|
|
118
|
-
!isActionModule && (React.createElement(Navigation_1.Navigation, { menuItems: menuItems, api: props.api,
|
|
119
|
-
React.createElement(rebass_1.Flex, { flex: 1, className: "ab-Adaptable-Popup__Body" },
|
|
74
|
+
!isActionModule && (React.createElement(Navigation_1.Navigation, { menuItems: menuItems, api: props.api, activeItem: activeItem, customSettingsPanels: settingsPanelOptions.customSettingsPanels })),
|
|
75
|
+
React.createElement(rebass_1.Flex, { flex: 1, className: "ab-Adaptable-Popup__Body" }, moduleViewContent)))));
|
|
120
76
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const AdaptablePopupDialog: React.FunctionComponent<{
|
|
3
|
+
baseClassName: string;
|
|
4
|
+
className: string;
|
|
5
|
+
friendlyName: string;
|
|
6
|
+
isActionModule: boolean;
|
|
7
|
+
isWindowModal: boolean;
|
|
8
|
+
onHide: () => void;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdaptablePopupDialog = 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 SystemRedux_1 = require("../../../../Redux/ActionsReducers/SystemRedux");
|
|
9
|
+
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
10
|
+
const Utilities_1 = require("./Utilities");
|
|
11
|
+
const WindowDialog = (props) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const { onChange, style, baseClassName, className, isActionModule, settingsPanelOptionsKey, onHide } = props, dialogProps = tslib_1.__rest(props, ["onChange", "style", "baseClassName", "className", "isActionModule", "settingsPanelOptionsKey", "onHide"]);
|
|
14
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
15
|
+
const dispatch = react_redux_1.useDispatch();
|
|
16
|
+
const settingsPanelOptions = adaptable.adaptableOptions.settingsPanelOptions;
|
|
17
|
+
let popupSettings = react_redux_1.useSelector((state) => { var _a, _b; return (_b = (_a = state === null || state === void 0 ? void 0 : state.System) === null || _a === void 0 ? void 0 : _a.SettingsPanel) === null || _b === void 0 ? void 0 : _b[settingsPanelOptionsKey]; });
|
|
18
|
+
const handleWindowSettings = (settings) => {
|
|
19
|
+
dispatch(SystemRedux_1.SystemSettingsPanelSet(settingsPanelOptionsKey, settings));
|
|
20
|
+
};
|
|
21
|
+
if (!popupSettings) {
|
|
22
|
+
const size = isActionModule
|
|
23
|
+
? Utilities_1.getActionPanelSize()
|
|
24
|
+
: (_a = settingsPanelOptions.size) !== null && _a !== void 0 ? _a : Utilities_1.getSettingsPanelSize();
|
|
25
|
+
popupSettings = {
|
|
26
|
+
size: size,
|
|
27
|
+
position: (_b = settingsPanelOptions.position) !== null && _b !== void 0 ? _b : Utilities_1.getMiddlePosition(size),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const windowModalProps = {
|
|
31
|
+
handleSelector: isActionModule
|
|
32
|
+
? `.${baseClassName} .ab-Panel__header`
|
|
33
|
+
: '.ab-Adaptable-Popup__TopBar',
|
|
34
|
+
size: popupSettings.size,
|
|
35
|
+
position: popupSettings.position,
|
|
36
|
+
onChange: handleWindowSettings,
|
|
37
|
+
};
|
|
38
|
+
return (React.createElement(Dialog_1.default, Object.assign({ windowModal: true, fixed: false, windowModalProps: windowModalProps, style: Object.assign(Object.assign({}, props.style), { height: '100%' }), padding: 0, className: className, onDismiss: onHide, isOpen: true, showCloseButton: true }, dialogProps)));
|
|
39
|
+
};
|
|
40
|
+
const PopupDialog = (props) => {
|
|
41
|
+
const { style, className, onHide, children } = props, dialogProps = tslib_1.__rest(props, ["style", "className", "onHide", "children"]);
|
|
42
|
+
return (React.createElement(Dialog_1.default, Object.assign({ fixed: false, style: props.style, padding: 0, height: '90vh', width: '90vw', className: className, onDismiss: onHide, isOpen: true, showCloseButton: true }, dialogProps), children));
|
|
43
|
+
};
|
|
44
|
+
exports.AdaptablePopupDialog = (props) => {
|
|
45
|
+
const { isActionModule, style, friendlyName, baseClassName, className, children, onHide, isWindowModal, } = props;
|
|
46
|
+
if (isWindowModal) {
|
|
47
|
+
const settingsPanelOptionsKey = isActionModule ? `action-${friendlyName}` : 'settings';
|
|
48
|
+
return (React.createElement(WindowDialog, { settingsPanelOptionsKey: settingsPanelOptionsKey, isActionModule: isActionModule, onHide: onHide, style: style, baseClassName: baseClassName, className: className }, children));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const modalStyle = Object.assign(Object.assign({}, style), (isActionModule ? { maxWidth: 800, maxHeight: 600 } : { maxWidth: 1200, maxHeight: 1000 }));
|
|
52
|
+
return (React.createElement(PopupDialog, { onHide: onHide, style: modalStyle, className: className }, children));
|
|
53
|
+
}
|
|
54
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AccessLevel, AdaptableApi } from '../../../../../types';
|
|
3
3
|
import { IModule } from '../../../../Strategy/Interface/IModule';
|
|
4
|
-
|
|
4
|
+
import { ModuleParams, ModuleViewPopupProps } from '../../SharedProps/ModuleViewPopupProps';
|
|
5
|
+
export interface AdaptablePopupModuleViewProps extends ModuleViewPopupProps<typeof AdaptablePopupModuleView> {
|
|
5
6
|
module: IModule;
|
|
6
7
|
api: AdaptableApi;
|
|
7
8
|
accessLevel: AccessLevel;
|
|
9
|
+
popupParams?: ModuleParams;
|
|
8
10
|
}
|
|
9
11
|
export declare const AdaptablePopupModuleView: React.FunctionComponent<AdaptablePopupModuleViewProps>;
|
|
@@ -11,18 +11,27 @@ const AdaptableObjectList_1 = require("../../AdaptableObjectList");
|
|
|
11
11
|
const ButtonNew_1 = require("../../Buttons/ButtonNew");
|
|
12
12
|
const PopupPanel_1 = require("./PopupPanel");
|
|
13
13
|
exports.AdaptablePopupModuleView = (props) => {
|
|
14
|
-
var _a, _b, _c;
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
15
|
/**
|
|
16
16
|
* This triggers an render for each redux change.
|
|
17
17
|
* Not sure yet how to trigger this component to render when an item is edited.
|
|
18
18
|
*/
|
|
19
19
|
react_redux_1.useSelector((state) => state);
|
|
20
|
-
const [isWizardOpen, setIsWizardOpen] = React.useState(
|
|
20
|
+
const [isWizardOpen, setIsWizardOpen] = React.useState(() => {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
return ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'New' || ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) === 'Edit';
|
|
23
|
+
});
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'New' || ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) === 'Edit') {
|
|
27
|
+
setIsWizardOpen(true);
|
|
28
|
+
}
|
|
29
|
+
}, [(_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action]);
|
|
21
30
|
const [abObjectType, setAbObjectType] = React.useState(null);
|
|
22
31
|
const moduleInfo = props.module.moduleInfo;
|
|
23
|
-
const items = (
|
|
32
|
+
const items = (_b = props.module) === null || _b === void 0 ? void 0 : _b.toViewAll();
|
|
24
33
|
const moduleViewProperties = props.module.getViewProperties();
|
|
25
|
-
const EditWizard = (
|
|
34
|
+
const EditWizard = (_c = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.getEditWizard) === null || _c === void 0 ? void 0 : _c.call(moduleViewProperties);
|
|
26
35
|
const emptyView = moduleViewProperties.emptyView;
|
|
27
36
|
let emptyContent = null;
|
|
28
37
|
if (typeof emptyView === 'function') {
|
|
@@ -34,7 +43,7 @@ exports.AdaptablePopupModuleView = (props) => {
|
|
|
34
43
|
// Some modules do not have new button
|
|
35
44
|
// e.g. filter
|
|
36
45
|
let newButton = null;
|
|
37
|
-
if ((
|
|
46
|
+
if ((_d = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.abObjectTypes) === null || _d === void 0 ? void 0 : _d.length) {
|
|
38
47
|
const items = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.abObjectTypes.map((abObjctType) => {
|
|
39
48
|
var _a;
|
|
40
49
|
return {
|
|
@@ -58,10 +67,14 @@ exports.AdaptablePopupModuleView = (props) => {
|
|
|
58
67
|
} }));
|
|
59
68
|
}
|
|
60
69
|
const handleWizardClose = () => {
|
|
70
|
+
var _a;
|
|
61
71
|
setAbObjectType(null);
|
|
62
72
|
setIsWizardOpen(false);
|
|
73
|
+
if (['Toolbar', 'ContextMenu', 'ColumnMenu'].includes((_a = props === null || props === void 0 ? void 0 : props.popupParams) === null || _a === void 0 ? void 0 : _a.source)) {
|
|
74
|
+
props.onClosePopup();
|
|
75
|
+
}
|
|
63
76
|
};
|
|
64
77
|
return (React.createElement(PopupPanel_1.PopupPanel, { glyphicon: moduleInfo.Glyph, infoLink: moduleInfo.HelpPage, headerText: moduleInfo.FriendlyName, button: newButton },
|
|
65
78
|
(items === null || items === void 0 ? void 0 : items.length) ? (React.createElement(AdaptableObjectList_1.AdaptableObjectList, { module: props.module, items: items })) : (React.createElement(EmptyContent_1.default, null, emptyContent !== null && emptyContent !== void 0 ? emptyContent : `Click 'New' to create a new ${moduleInfo.FriendlyName}`)),
|
|
66
|
-
isWizardOpen && (React.createElement(EditWizard, { abObjectType: abObjectType, moduleInfo: moduleInfo, data: null, configEntities: null, onCloseWizard: handleWizardClose, onFinishWizard: handleWizardClose }))));
|
|
79
|
+
isWizardOpen && (React.createElement(EditWizard, { abObjectType: abObjectType, moduleInfo: moduleInfo, data: null, popupParams: props.popupParams, configEntities: null, onCloseWizard: handleWizardClose, onFinishWizard: handleWizardClose }))));
|
|
67
80
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AdaptableApi, AdaptableMenuItem } from '../../../../../types';
|
|
3
3
|
import { CustomSettingsPanel } from '../../../../AdaptableOptions/SettingsPanelOptions';
|
|
4
|
-
import { ModuleInfo } from '../../../../Strategy/Interface/IModule';
|
|
5
4
|
interface NavigationProps {
|
|
6
5
|
api: AdaptableApi;
|
|
7
6
|
menuItems: (AdaptableMenuItem | '-')[];
|
|
8
|
-
|
|
9
|
-
activeCustomSettingPanel?: CustomSettingsPanel;
|
|
7
|
+
activeItem: string;
|
|
10
8
|
customSettingsPanels?: CustomSettingsPanel[];
|
|
11
9
|
}
|
|
12
10
|
export declare const Navigation: React.FunctionComponent<NavigationProps>;
|
|
@@ -9,19 +9,12 @@ const icons_1 = require("../../../../components/icons");
|
|
|
9
9
|
const join_1 = tslib_1.__importDefault(require("../../../../components/utils/join"));
|
|
10
10
|
const useGlobalEvent_1 = require("../../../../components/utils/useGlobalEvent");
|
|
11
11
|
exports.Navigation = (props) => {
|
|
12
|
-
var _a;
|
|
13
12
|
const dispatch = react_redux_1.useDispatch();
|
|
14
13
|
const handleKeyPress = React.useCallback((event) => {
|
|
15
14
|
if ((event.ctrlKey || event.metaKey) &&
|
|
16
15
|
(event.code === 'ArrowUp' || event.code === 'ArrowDown')) {
|
|
17
16
|
const isKeyUp = event.code === 'ArrowUp';
|
|
18
|
-
const currentIndex = props.menuItems.findIndex((item) =>
|
|
19
|
-
var _a, _b;
|
|
20
|
-
return item !== '-' &&
|
|
21
|
-
(item.module === ((_a = props === null || props === void 0 ? void 0 : props.moduleInfo) === null || _a === void 0 ? void 0 : _a.ModuleName) ||
|
|
22
|
-
// in case of custom panel
|
|
23
|
-
item.label === ((_b = props === null || props === void 0 ? void 0 : props.activeCustomSettingPanel) === null || _b === void 0 ? void 0 : _b.name));
|
|
24
|
-
});
|
|
17
|
+
const currentIndex = props.menuItems.findIndex((item) => item !== '-' && (item.module === props.activeItem || item.label === props.activeItem));
|
|
25
18
|
let nextMenuItem = null;
|
|
26
19
|
if (isKeyUp) {
|
|
27
20
|
let candidate = props.menuItems[currentIndex - 1] !== '-'
|
|
@@ -39,21 +32,20 @@ exports.Navigation = (props) => {
|
|
|
39
32
|
dispatch(nextMenuItem.reduxAction);
|
|
40
33
|
}
|
|
41
34
|
}
|
|
42
|
-
}, [
|
|
35
|
+
}, [props.activeItem, props.menuItems]);
|
|
43
36
|
useGlobalEvent_1.useGlobalEvent('keydown', handleKeyPress);
|
|
44
37
|
return (React.createElement("nav", { className: "ab-Adaptable-Popup__Navigation" },
|
|
45
38
|
React.createElement("ul", { className: "ab-Adaptable-Popup__Navigation__List" }, props.menuItems.map((menuItem, index) => {
|
|
46
|
-
var _a, _b, _c, _d
|
|
39
|
+
var _a, _b, _c, _d;
|
|
47
40
|
const baseClassName = 'ab-Adaptable-Popup__Navigation__List__Item';
|
|
48
41
|
if (menuItem === '-') {
|
|
49
42
|
return React.createElement("li", { key: `separator-${index}`, className: `${baseClassName}__Separator` });
|
|
50
43
|
}
|
|
51
|
-
const isActive =
|
|
52
|
-
menuItem.label === ((_b = props === null || props === void 0 ? void 0 : props.activeCustomSettingPanel) === null || _b === void 0 ? void 0 : _b.name);
|
|
44
|
+
const isActive = props.activeItem === menuItem.module || menuItem.label === props.activeItem;
|
|
53
45
|
const className = join_1.default(baseClassName, isActive && `${baseClassName}--active`);
|
|
54
|
-
let customIcon = (
|
|
46
|
+
let customIcon = (_d = (_c = (_b = (_a = props.customSettingsPanels) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (customSettingPanel) => customSettingPanel.name === menuItem.label)) === null || _c === void 0 ? void 0 : _c.icon) !== null && _d !== void 0 ? _d : null;
|
|
55
47
|
return (React.createElement("li", { className: className, key: menuItem.label },
|
|
56
|
-
React.createElement("button", { className: `${baseClassName}__Button`, onClick: () => {
|
|
48
|
+
React.createElement("button", { type: "button", className: `${baseClassName}__Button`, onClick: () => {
|
|
57
49
|
dispatch(menuItem.reduxAction);
|
|
58
50
|
} },
|
|
59
51
|
menuItem.icon && (React.createElement(icons_1.Icon, { className: `${baseClassName}__Icon`, name: menuItem.icon })),
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMenuItems = 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 DefaultSettingsPanel_1 = require("../../../../Utilities/Defaults/DefaultSettingsPanel");
|
|
8
|
+
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
9
|
+
const PopupRedux = tslib_1.__importStar(require("../../../../Redux/ActionsReducers/PopupRedux"));
|
|
10
|
+
exports.useMenuItems = () => {
|
|
11
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
12
|
+
const settingsPanelOptions = adaptable.adaptableOptions.settingsPanelOptions;
|
|
13
|
+
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.ModuleDropdownMenuItems; });
|
|
14
|
+
return React.useMemo(() => {
|
|
15
|
+
var _a;
|
|
16
|
+
let navigationItems = (_a = settingsPanelOptions === null || settingsPanelOptions === void 0 ? void 0 : settingsPanelOptions.navigation) === null || _a === void 0 ? void 0 : _a.items;
|
|
17
|
+
if (!navigationItems) {
|
|
18
|
+
navigationItems = [...DefaultSettingsPanel_1.DEFAULT_NAVIGATION_ITEMS];
|
|
19
|
+
if (settingsPanelOptions.customSettingsPanels) {
|
|
20
|
+
navigationItems.push(...settingsPanelOptions.customSettingsPanels.map((panel) => panel.name));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const visibleItems = allMenuItems.filter((item) => item.module !== 'General' && !DefaultSettingsPanel_1.ACTION_POPUPS.includes(item.module) && item.isVisible);
|
|
24
|
+
return navigationItems
|
|
25
|
+
.map((moduleName) => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
if (moduleName === '-') {
|
|
28
|
+
return moduleName;
|
|
29
|
+
}
|
|
30
|
+
const customSettingsPanel = (_b = (_a = settingsPanelOptions === null || settingsPanelOptions === void 0 ? void 0 : settingsPanelOptions.customSettingsPanels) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (panel) => panel.name === moduleName);
|
|
31
|
+
let customPanelMenuItem = null;
|
|
32
|
+
if (customSettingsPanel) {
|
|
33
|
+
customPanelMenuItem = {
|
|
34
|
+
label: customSettingsPanel.name,
|
|
35
|
+
module: 'CustomSettingsPanelModule',
|
|
36
|
+
isVisible: true,
|
|
37
|
+
reduxAction: PopupRedux.PopupShowScreen('CustomSettingsPanelModule', customSettingsPanel.name),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return customPanelMenuItem || visibleItems.find((item) => item.module === moduleName);
|
|
41
|
+
})
|
|
42
|
+
.filter(Boolean);
|
|
43
|
+
}, [allMenuItems]);
|
|
44
|
+
};
|
|
@@ -4,7 +4,7 @@ import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColum
|
|
|
4
4
|
import { ModuleInfo } from '../../../Strategy/Interface/IModule';
|
|
5
5
|
import { AdaptableObject } from '../../../types';
|
|
6
6
|
export interface ModuleViewPopupProps<View> extends BaseProps<View> {
|
|
7
|
-
popupParams
|
|
7
|
+
popupParams?: ModuleParams;
|
|
8
8
|
onClearPopupParams: () => PopupRedux.PopupClearParamAction;
|
|
9
9
|
teamSharingActivated: boolean;
|
|
10
10
|
onClosePopup: () => void;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AdaptableToolPanelAgGridComponent = exports.getAdaptableToolPanelAgGridComponent = exports.ConnectedAdaptableToolPanel = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const kebabCase_1 = tslib_1.__importDefault(require("lodash
|
|
6
|
+
const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
|
|
7
7
|
const ToolPanelRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/ToolPanelRedux"));
|
|
8
8
|
const SystemRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/SystemRedux"));
|
|
9
9
|
const react_redux_1 = require("react-redux");
|
|
@@ -7,7 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
8
8
|
const uuid_1 = require("../../../components/utils/uuid");
|
|
9
9
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
|
|
10
|
-
const kebabCase_1 = tslib_1.__importDefault(require("lodash
|
|
10
|
+
const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
|
|
11
11
|
exports.CustomToolPanelContent = (props) => {
|
|
12
12
|
var _a;
|
|
13
13
|
const { customToolPanel } = props;
|
|
@@ -64,6 +64,7 @@ class ToolPanelPopupComponent extends React.Component {
|
|
|
64
64
|
const selectedToolPanels = this.props.ToolPanelState.ToolPanels.map((toolPanelDefinition) => toolPanelDefinition.Name)
|
|
65
65
|
// ensure that the visible state has only valid tool panels
|
|
66
66
|
.filter((visibleToolPanel) => availableToolPanels.includes(visibleToolPanel));
|
|
67
|
+
const isToolPanelReadOnly = entitlementService.isModuleReadOnlyEntitlement('ToolPanel');
|
|
67
68
|
const isModuleCheckboxDisabled = (module) => {
|
|
68
69
|
if (module === 'SettingsPanel') {
|
|
69
70
|
return this.props.api.internalApi.getAdaptableOptions().settingsPanelOptions
|
|
@@ -78,9 +79,9 @@ class ToolPanelPopupComponent extends React.Component {
|
|
|
78
79
|
React.createElement(Tabs_1.Tabs.Tab, { value: ToolPanelConfigView.Buttons },
|
|
79
80
|
React.createElement(Radio_1.default, { margin: 0, value: ToolPanelConfigView.Buttons, checked: this.state.ToolPanelConfigView == ToolPanelConfigView.Buttons, tabIndex: -1 }, "Module Buttons")),
|
|
80
81
|
React.createElement(Tabs_1.Tabs.Content, { value: ToolPanelConfigView.ToolPanels, style: { flex: 1, overflow: 'auto' } },
|
|
81
|
-
React.createElement(ModuleValueSelector_1.ModuleValueSelector, { options: availableToolPanels, value: selectedToolPanels, noSelectionLabel: 'No selected Tool Panel', xSelectedLabel: () => `Visible ToolPanels:`, onChange: (selectedValues) => this.onToolPanelToolPanelsChanged(selectedValues) })),
|
|
82
|
+
React.createElement(ModuleValueSelector_1.ModuleValueSelector, { options: availableToolPanels, value: selectedToolPanels, noSelectionLabel: 'No selected Tool Panel', xSelectedLabel: () => `Visible ToolPanels:`, onChange: (selectedValues) => this.onToolPanelToolPanelsChanged(selectedValues), disabled: isToolPanelReadOnly })),
|
|
82
83
|
React.createElement(Tabs_1.Tabs.Content, { value: ToolPanelConfigView.Buttons, style: { flex: 1, overflow: 'auto' } },
|
|
83
|
-
React.createElement(ModuleValueSelector_1.ModuleValueSelector, { options: allModuleButtons, value: selectedModuleButtons, noSelectionLabel: 'No selected Module Button', xSelectedLabel: () => `Visible Module Buttons:`,
|
|
84
|
+
React.createElement(ModuleValueSelector_1.ModuleValueSelector, { options: allModuleButtons, value: selectedModuleButtons, noSelectionLabel: 'No selected Module Button', xSelectedLabel: () => `Visible Module Buttons:`, isOptionDisabled: isModuleCheckboxDisabled, disabled: isToolPanelReadOnly, onChange: (selectedValues) => this.props.onToolPanelSetModuleButtons(selectedValues) })))));
|
|
84
85
|
}
|
|
85
86
|
onShowGridPropertiesChanged(event) {
|
|
86
87
|
let e = event.target;
|
|
@@ -88,8 +89,7 @@ class ToolPanelPopupComponent extends React.Component {
|
|
|
88
89
|
this.setState({ ToolPanelConfigView: ToolPanelConfigView });
|
|
89
90
|
}
|
|
90
91
|
onToolPanelToolPanelsChanged(selectedValues) {
|
|
91
|
-
const currentSelectedToolPanelDefinitions = this.props
|
|
92
|
-
.ToolPanelState.ToolPanels;
|
|
92
|
+
const currentSelectedToolPanelDefinitions = this.props.ToolPanelState.ToolPanels;
|
|
93
93
|
// try to return the pre-existing definition (to maintain the previous collapsed state)
|
|
94
94
|
// otherwise select the new toolPanel with the default 'collapsed' state
|
|
95
95
|
let newSelectedToolPanelDefinitions = selectedValues.map((selectedToolPanel) => {
|
|
@@ -15,7 +15,8 @@ export declare type ValueSelectorProps<OPTION_TYPE, ID_TYPE extends number | str
|
|
|
15
15
|
xSelectedLabel?: (count: number) => ReactNode;
|
|
16
16
|
selectionBoxPosition?: 'top' | 'bottom';
|
|
17
17
|
onShowSelectedOnlyChange?: (selectedOnly: boolean) => void;
|
|
18
|
-
|
|
18
|
+
isOptionDisabled?: (option: OPTION_TYPE) => boolean;
|
|
19
|
+
disabled?: boolean;
|
|
19
20
|
};
|
|
20
21
|
export declare function ValueSelector<OPTION_TYPE, ID_TYPE extends number | string>(props: ValueSelectorProps<OPTION_TYPE, ID_TYPE>): JSX.Element;
|
|
21
22
|
export declare namespace ValueSelector {
|
|
@@ -38,7 +38,7 @@ function useValuesMap({ options, value, toIdentifier, selectedMap, }) {
|
|
|
38
38
|
return { selectedMap: result, optionsMap };
|
|
39
39
|
}
|
|
40
40
|
function ValueSelector(props) {
|
|
41
|
-
const { options, value, filter, onChange, allowReorder, singleSelect, toLabel, toIdentifier, noSelectionLabel, clearSelectionLabel, showSelectedOnlyLabel, xSelectedLabel, selectionBoxPosition = 'bottom', onShowSelectedOnlyChange,
|
|
41
|
+
const { options, value, filter, onChange, allowReorder, singleSelect, toLabel, toIdentifier, noSelectionLabel, clearSelectionLabel, showSelectedOnlyLabel, xSelectedLabel, selectionBoxPosition = 'bottom', onShowSelectedOnlyChange, isOptionDisabled, disabled, } = props;
|
|
42
42
|
const [selectedOnly, doSetSelectedOnly] = react_1.useState(false);
|
|
43
43
|
const setSelectedOnly = react_1.useCallback((selectedOnly) => {
|
|
44
44
|
doSetSelectedOnly(selectedOnly);
|
|
@@ -74,7 +74,7 @@ function ValueSelector(props) {
|
|
|
74
74
|
selectedMap.delete(identifier);
|
|
75
75
|
}
|
|
76
76
|
notifyChange();
|
|
77
|
-
} }, label)) : (React.createElement(CheckBox_1.CheckBox, { "data-name": identifier, disabled:
|
|
77
|
+
} }, label)) : (React.createElement(CheckBox_1.CheckBox, { "data-name": identifier, disabled: disabled || (isOptionDisabled ? isOptionDisabled(option) : false), onChange: (checked) => {
|
|
78
78
|
if (checked) {
|
|
79
79
|
selectedMap.set(identifier, option);
|
|
80
80
|
}
|
|
@@ -91,13 +91,13 @@ function ValueSelector(props) {
|
|
|
91
91
|
};
|
|
92
92
|
const renderSelectionSection = () => {
|
|
93
93
|
const selectionBox = (React.createElement(rebass_1.Box, { fontSize: 2, style: { whiteSpace: 'nowrap', flex: 'none' } }, !value.length ? (React.createElement(React.Fragment, null, noSelectionLabel !== null && noSelectionLabel !== void 0 ? noSelectionLabel : 'No selected options',
|
|
94
|
-
!singleSelect ? (React.createElement(SimpleButton_1.default, { px: 1, variant: "text", style: { textDecoration: 'underline', display: 'inline-block' }, onClick: () => {
|
|
94
|
+
!singleSelect ? (React.createElement(SimpleButton_1.default, { px: 1, disabled: disabled, variant: "text", style: { textDecoration: 'underline', display: 'inline-block' }, onClick: () => {
|
|
95
95
|
options.forEach((option) => {
|
|
96
96
|
selectedMap.set(toIdentifier(option), option);
|
|
97
97
|
});
|
|
98
98
|
notifyChange();
|
|
99
99
|
} }, "Select all")) : null)) : (React.createElement(React.Fragment, null,
|
|
100
|
-
React.createElement(SimpleButton_1.default, { tabIndex: 0, px: 1, mr: 1, variant: "text", style: { textDecoration: 'underline', display: 'inline-block' }, onClick: () => {
|
|
100
|
+
React.createElement(SimpleButton_1.default, { disabled: disabled, tabIndex: 0, px: 1, mr: 1, variant: "text", style: { textDecoration: 'underline', display: 'inline-block' }, onClick: () => {
|
|
101
101
|
selectedMap.clear();
|
|
102
102
|
notifyChange();
|
|
103
103
|
} }, clearSelectionLabel !== null && clearSelectionLabel !== void 0 ? clearSelectionLabel : 'Clear selection.'),
|
|
@@ -106,7 +106,7 @@ function ValueSelector(props) {
|
|
|
106
106
|
: `Your selected ${value.length} ${value.length > 1 ? 'options' : 'option'}.`))));
|
|
107
107
|
return (React.createElement(rebass_1.Box, { mt: selectionBoxPosition === 'bottom' ? 3 : 0, mb: selectionBoxPosition === 'top' ? 3 : 0 },
|
|
108
108
|
selectionBox,
|
|
109
|
-
React.createElement(ValueOptionsTags, { options: options, value: value, selectedMap: selectedMap, toLabel: toLabel, toIdentifier: toIdentifier, onClearOption: notifyChange })));
|
|
109
|
+
React.createElement(ValueOptionsTags, { options: options, value: value, selectedMap: selectedMap, toLabel: toLabel, toIdentifier: toIdentifier, onClearOption: notifyChange, readOnly: disabled })));
|
|
110
110
|
};
|
|
111
111
|
return (React.createElement(rebass_1.Flex, { flexDirection: "column", flex: 1, className: "ab-ValueSelector", style: {
|
|
112
112
|
overflow: 'hidden',
|