@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
31 lines (30 loc) • 1.35 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import * as React from 'react';
import EmptyContent from '../../components/EmptyContent';
import { DataSource, InfiniteTableGrid } from '../../components/InfiniteTable';
const columnsMap = {
Operation: { field: 'Operation', defaultFlex: 1 },
Value: { field: 'Value', defaultFlex: 1 },
};
const tableDOMProps = {
style: {
height: '100%',
minWidth: '20rem',
minHeight: 380,
},
};
export class CellSummaryDetails extends React.Component {
render() {
let data = [];
if (this.props.CellSummary != null) {
data = Object.keys(this.props.CellSummary).map((operationName) => {
const operationLabel = operationName === 'Std_Deviation' ? 'Std. Deviation' : operationName;
return {
Operation: operationLabel,
Value: this.props.CellSummary[operationName],
};
});
}
return (_jsx(_Fragment, { children: this.props.CellSummary != null ? (_jsx(DataSource, { data: data, primaryKey: "Operation", children: _jsx(InfiniteTableGrid, { domProps: tableDOMProps, columns: columnsMap }) })) : (_jsx(EmptyContent, { children: _jsx("p", { children: "No cells are selected - please select some cells." }) })) }));
}
}