choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
46 lines (41 loc) • 1.19 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
export default function ColGroup(props, _ref) {
var table = _ref.table;
var _table$props = table.props,
prefixCls = _table$props.prefixCls,
expandIconAsCell = _table$props.expandIconAsCell;
var fixed = props.fixed;
var cols = [];
if (expandIconAsCell && fixed !== 'right') {
cols.push(React.createElement("col", {
className: "".concat(prefixCls, "-expand-icon-col"),
key: "rc-table-expand-icon-col"
}));
}
var leafColumns;
if (fixed === 'left') {
leafColumns = table.columnManager.leftLeafColumns();
} else if (fixed === 'right') {
leafColumns = table.columnManager.rightLeafColumns();
} else {
leafColumns = table.columnManager.leafColumns();
}
cols = cols.concat(leafColumns.map(function (c) {
return React.createElement("col", {
key: c.key || c.dataIndex,
style: {
width: c.width,
minWidth: c.width
}
});
}));
return React.createElement("colgroup", null, cols);
}
ColGroup.propTypes = {
fixed: PropTypes.string
};
ColGroup.contextTypes = {
table: PropTypes.any
};
//# sourceMappingURL=ColGroup.js.map