| 1 |
"use strict"; |
| 2 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 |
exports.BodyWrapper = void 0; |
| 4 |
const tslib_1 = require("tslib"); |
| 5 |
const jsx_runtime_1 = require("react/jsx-runtime"); |
| 6 |
const react_1 = require("react"); |
| 7 |
const react_2 = require("react"); |
| 8 |
const components_1 = require("../../../components"); |
| 9 |
const components_2 = require("../../../components"); |
| 10 |
const BodyWrapper = (_a) => { |
| 11 |
var { mappedRows, tbodyRef, |
| 12 |
/* eslint-disable @typescript-eslint/no-unused-vars */ |
| 13 |
rows = [], onCollapse, headerRows } = _a, |
| 14 |
/* eslint-enable @typescript-eslint/no-unused-vars */ |
| 15 |
props = tslib_1.__rest(_a, ["mappedRows", "tbodyRef", "rows", "onCollapse", "headerRows"]); |
| 16 |
if (mappedRows && mappedRows.some((row) => row.hasOwnProperty('parent'))) { |
| 17 |
return ((0, jsx_runtime_1.jsx)(react_2.Fragment, { children: (0, components_1.mapOpenedRows)(mappedRows, props.children).map((oneRow, key) => ((0, react_1.createElement)(components_2.Tbody, Object.assign({}, props, { isExpanded: oneRow.isOpen, key: `tbody-${key}`, ref: tbodyRef }), oneRow.rows))) })); |
| 18 |
} |
| 19 |
return (0, jsx_runtime_1.jsx)(components_2.Tbody, Object.assign({}, props, { ref: tbodyRef })); |
| 20 |
}; |
| 21 |
exports.BodyWrapper = BodyWrapper; |
| 22 |
exports.BodyWrapper.displayName = 'BodyWrapper'; |
| 23 |
//# sourceMappingURL=BodyWrapper.js.map |