@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
27 lines (26 loc) • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const InfiniteTable_1 = require("../../../components/InfiniteTable");
const join_1 = tslib_1.__importDefault(require("../../utils/join"));
const baseClassName = 'ab-GridList';
const columnsMap = {
item: { field: 'item', header: null, defaultFlex: 1 },
};
const GridList = (props) => {
const data = React.Children.map(props.children, (c, index) => {
return {
item: c,
id: index,
};
}).filter((data) => !!data.item);
return (React.createElement(InfiniteTable_1.DataSource, { data: data, primaryKey: "id" },
React.createElement(InfiniteTable_1.InfiniteTableGrid, { header: false, showZebraRows: props.showZebraRows, rowHeight: props.rowHeight ?? '--ab-grid-row-height', domProps: {
className: (0, join_1.default)(baseClassName, props.className),
style: {
minHeight: '15rem',
},
}, columns: columnsMap })));
};
exports.default = GridList;