UNPKG

chowa

Version:

UI component library based on React

30 lines (29 loc) 1.36 kB
/** * @license chowa v1.1.3 * * Copyright (c) Chowa Techonlogies Co.,Ltd.(http://www.chowa.cn). * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); const utils_1 = require("../utils"); class TableColGroup extends React.PureComponent { render() { const { dataIndexs, columnsWidthMap, selectable, expanded, fixed } = this.props; const selectColWidth = columnsWidthMap[utils_1.preClass('table-selection-cell')]; const expandedColWidth = columnsWidthMap[utils_1.preClass('table-expanded-cell')]; return (React.createElement("colgroup", { key: 'table-colgroup' }, selectable && fixed !== 'right' && React.createElement("col", { width: selectColWidth, style: { width: selectColWidth } }), dataIndexs.map((dataIndex, key) => { const width = columnsWidthMap[dataIndex]; return (React.createElement("col", { width: width, style: { width }, key: key })); }), expanded && fixed !== 'left' && React.createElement("col", { width: expandedColWidth, style: { width: expandedColWidth } }))); } } exports.default = TableColGroup;