| 1 |
import { __rest } from "tslib"; |
| 2 |
import { jsx as _jsx } from "react/jsx-runtime"; |
| 3 |
import { createElement as _createElement } from "react"; |
| 4 |
import { Fragment } from 'react'; |
| 5 |
import { mapOpenedRows } from '../../../components'; |
| 6 |
import { Tbody } from '../../../components'; |
| 7 |
export const BodyWrapper = (_a) => { |
| 8 |
var { mappedRows, tbodyRef, |
| 9 |
/* eslint-disable @typescript-eslint/no-unused-vars */ |
| 10 |
rows = [], onCollapse, headerRows } = _a, |
| 11 |
/* eslint-enable @typescript-eslint/no-unused-vars */ |
| 12 |
props = __rest(_a, ["mappedRows", "tbodyRef", "rows", "onCollapse", "headerRows"]); |
| 13 |
if (mappedRows && mappedRows.some((row) => row.hasOwnProperty('parent'))) { |
| 14 |
return (_jsx(Fragment, { children: mapOpenedRows(mappedRows, props.children).map((oneRow, key) => (_createElement(Tbody, Object.assign({}, props, { isExpanded: oneRow.isOpen, key: `tbody-${key}`, ref: tbodyRef }), oneRow.rows))) })); |
| 15 |
} |
| 16 |
return _jsx(Tbody, Object.assign({}, props, { ref: tbodyRef })); |
| 17 |
}; |
| 18 |
BodyWrapper.displayName = 'BodyWrapper'; |
| 19 |
//# sourceMappingURL=BodyWrapper.js.map |