@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
30 lines (29 loc) • 1.52 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import { connect } from 'react-redux';
import * as InternalRedux from '../../Redux/ActionsReducers/InternalRedux';
import { CellSummaryDetails } from './CellSummaryDetails';
import { PanelWithButton } from '../Components/Panels/PanelWithButton';
class CellSummaryPopupComponent extends React.Component {
componentDidMount() {
if (this.props.popupParams?.source === 'ColumnMenu' && this.props.popupParams?.column) {
this.props.api.columnApi.selectColumn(this.props.popupParams?.column.columnId);
this.props.api.internalApi.getAdaptableInstance().refreshSelectedCellsState();
}
this.props.onCreateCellSummary();
}
render() {
return (_jsx(PanelWithButton, { className: "twa:p-0!", variant: "primary", headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), children: _jsx(CellSummaryDetails, { CellSummary: this.props.CellSummary }) }));
}
}
function mapStateToProps(state, ownProps) {
return {
CellSummary: state.Internal.CellSummary.CellSummaryInfo,
};
}
function mapDispatchToProps(dispatch) {
return {
onCreateCellSummary: () => dispatch(InternalRedux.CreateCellSummaryInfo()),
};
}
export let CellSummaryPopup = connect(mapStateToProps, mapDispatchToProps)(CellSummaryPopupComponent);