@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
28 lines (27 loc) • 1.89 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import { connect } from 'react-redux';
import * as ToolPanelRedux from '../../../Redux/ActionsReducers/ToolPanelRedux';
import { PopupPanel } from '../Popups/AdaptablePopup/PopupPanel';
import { ToolPanelPopupSections, ToolPanelConfigView } from './ToolPanelPopupSections';
export { ToolPanelConfigView } from './ToolPanelPopupSections';
class ToolPanelPopupComponent extends React.Component {
render() {
const initialTab = this.props.popupParams?.config?.initialTab ?? ToolPanelConfigView.ToolPanels;
const isToolPanelReadOnly = this.props.api.entitlementApi.isModuleReadOnlyEntitlement('ToolPanel');
return (_jsx(PopupPanel, { headerText: "Tool Panel", glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), scrollable: false, bodyClassName: "twa:gap-3 twa:flex twa:flex-col twa:h-full twa:min-h-0", children: _jsx(ToolPanelPopupSections, { ToolPanelState: this.props.ToolPanelState, InternalState: this.props.InternalState, initialTab: initialTab, isToolPanelReadOnly: isToolPanelReadOnly, onToolPanelSetModuleButtons: this.props.onToolPanelSetModuleButtons, onToolPanelSetToolPanels: this.props.onToolPanelSetToolPanels }) }));
}
}
function mapStateToProps(state) {
return {
ToolPanelState: state.ToolPanel,
InternalState: state.Internal,
};
}
function mapDispatchToProps(dispatch) {
return {
onToolPanelSetModuleButtons: (moduleButtons) => dispatch(ToolPanelRedux.ToolPanelSetModuleButtons(moduleButtons)),
onToolPanelSetToolPanels: (toolPanels) => dispatch(ToolPanelRedux.ToolPanelSetToolPanels(toolPanels)),
};
}
export let ToolPanelPopup = connect(mapStateToProps, mapDispatchToProps)(ToolPanelPopupComponent);