1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | var _lodash = _interopRequireDefault(require("lodash"));
|
9 |
|
10 | var _wrapCell = _interopRequireDefault(require("./wrapCell"));
|
11 |
|
12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | const mapDataUsingRowHeightIndex = (unmappedRows, rowHeightIndex, config) => {
|
21 | const tableWidth = unmappedRows[0].length;
|
22 | const mappedRows = unmappedRows.map((cells, index0) => {
|
23 | const rowHeight = _lodash.default.times(rowHeightIndex[index0], () => {
|
24 | return new Array(tableWidth).fill('');
|
25 | });
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | cells.forEach((value, index1) => {
|
31 | const cellLines = (0, _wrapCell.default)(value, config.columns[index1].width, config.columns[index1].wrapWord);
|
32 | cellLines.forEach((cellLine, index2) => {
|
33 | rowHeight[index2][index1] = cellLine;
|
34 | });
|
35 | });
|
36 | return rowHeight;
|
37 | });
|
38 | return _lodash.default.flatten(mappedRows);
|
39 | };
|
40 |
|
41 | var _default = mapDataUsingRowHeightIndex;
|
42 | exports.default = _default;
|
43 |
|
\ | No newline at end of file |