@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
22 lines (21 loc) • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PanelWithRow = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const rebass_1 = require("rebass");
const Panel_1 = tslib_1.__importDefault(require("../../../components/Panel"));
// We cannot destructure this.props using the react way in typescript which is a real pain as you
// need to transfer props individually as a consequence
// let { buttonContent, ...other } = this.props
class PanelWithRow extends React.Component {
render() {
const headerItems = this.props.colItems.map((colItem, index) => (React.createElement(rebass_1.Text, { key: colItem.key || colItem.Content || index, fontWeight: "bold", fontSize: 'var(--ab-font-size-3)', paddingLeft: 1, paddingRight: 1, style: {
flex: colItem.Size,
} }, colItem.Content)));
const header = (React.createElement(rebass_1.Flex, { alignItems: this.props.headerAlign || 'center', style: { width: '100%' } }, headerItems));
return (React.createElement("div", { style: this.props.style, className: this.props.className },
React.createElement(Panel_1.default, { bodyScroll: true, header: header, border: this.props.border, bodyProps: this.props.bodyProps }, this.props.children)));
}
}
exports.PanelWithRow = PanelWithRow;