@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
37 lines (36 loc) • 1.63 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CellSummaryDetails = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const EmptyContent_1 = tslib_1.__importDefault(require("../../components/EmptyContent"));
const InfiniteTable_1 = require("../../components/InfiniteTable");
const columnsMap = {
Operation: { field: 'Operation', defaultFlex: 1 },
Value: { field: 'Value', defaultFlex: 1 },
};
const tableDOMProps = {
style: {
height: '100%',
minWidth: '20rem',
minHeight: 380,
},
};
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 (React.createElement(React.Fragment, null, this.props.CellSummary != null ? (React.createElement(InfiniteTable_1.DataSource, { data: data, primaryKey: "Operation" },
React.createElement(InfiniteTable_1.InfiniteTableGrid, { domProps: tableDOMProps, columns: columnsMap }))) : (React.createElement(EmptyContent_1.default, null,
React.createElement("p", null, "No cells are selected - please select some cells.")))));
}
}
exports.CellSummaryDetails = CellSummaryDetails;