chowa
Version:
UI component library based on React
31 lines (30 loc) • 2.31 kB
JavaScript
/**
* @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 no_data_1 = require("../no-data");
const table_body_row_1 = require("./table-body-row");
class TableBody extends React.PureComponent {
render() {
const { data, dataIndexs, globalAlign, rowAttr, highlightRow, noDataDescription, noDataImg, noDataImgStyle, selectable, selectedIndexs, columns, onSelect, onDeSelect, accordion, expanedVisibleMap, expandedRowRender, expandedOpenNode, expandedCloseNode, onExpandedVisibleChange, highlightRowIndex, updateTable, fixed, rowsHeightMap, draggable, rowDragSorter, expanded, striped } = this.props;
if (data.length === 0) {
return (React.createElement("tbody", null,
React.createElement("tr", null,
React.createElement("td", { colSpan: dataIndexs.length },
React.createElement(no_data_1.default, { style: { minHeight: '320px' }, img: noDataImg, imgStyle: noDataImgStyle, description: noDataDescription })))));
}
return (React.createElement("tbody", null, data.map((record, key) => {
const index = record.index;
const height = Array.isArray(rowsHeightMap) ? rowsHeightMap[key] : undefined;
return (React.createElement(table_body_row_1.default, { key: index, renderDataIndex: key, index: index, highlightRowIndex: highlightRowIndex, globalAlign: globalAlign, dataIndexs: dataIndexs, record: record, rowAttr: rowAttr, selectable: selectable, selectedIndexs: selectedIndexs, columns: columns, onSelect: onSelect, onDeSelect: onDeSelect, accordion: accordion, height: height, expanedVisibleMap: expanedVisibleMap, expandedRowRender: expandedRowRender, expandedOpenNode: expandedOpenNode, expandedCloseNode: expandedCloseNode, onExpandedVisibleChange: onExpandedVisibleChange, updateTable: updateTable, highlightRow: highlightRow, fixed: fixed, striped: striped, expanded: expanded, draggable: draggable, rowDragSorter: rowDragSorter }));
})));
}
}
exports.default = TableBody;