3 Object.defineProperty(exports, "__esModule", {
6 exports.default = void 0;
8 var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
10 var _times2 = _interopRequireDefault(require("lodash/times"));
12 var _wrapCell = _interopRequireDefault(require("./wrapCell"));
14 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17 * @param {Array} unmappedRows
18 * @param {number[]} rowHeightIndex
19 * @param {Object} config
22 const mapDataUsingRowHeightIndex = (unmappedRows, rowHeightIndex, config) => {
23 const tableWidth = unmappedRows[0].length;
24 const mappedRows = unmappedRows.map((cells, index0) => {
25 const rowHeight = (0, _times2.default)(rowHeightIndex[index0], () => {
26 return new Array(tableWidth).fill('');
28 // [{row index within rowSaw; index2}]
29 // [{cell index within a virtual row; index1}]
31 cells.forEach((value, index1) => {
32 const cellLines = (0, _wrapCell.default)(value, config.columns[index1].width, config.columns[index1].wrapWord);
33 cellLines.forEach((cellLine, index2) => {
34 rowHeight[index2][index1] = cellLine;
39 return (0, _flatten2.default)(mappedRows);
42 var _default = mapDataUsingRowHeightIndex;
43 exports.default = _default;
44 //# sourceMappingURL=mapDataUsingRowHeightIndex.js.map