代码拉取完成,页面将自动刷新
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
var _times2 = _interopRequireDefault(require("lodash/times"));
var _wrapCell = _interopRequireDefault(require("./wrapCell"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @param {Array} unmappedRows
* @param {number[]} rowHeightIndex
* @param {Object} config
* @returns {Array}
*/
const mapDataUsingRowHeightIndex = (unmappedRows, rowHeightIndex, config) => {
const tableWidth = unmappedRows[0].length;
const mappedRows = unmappedRows.map((cells, index0) => {
const rowHeight = (0, _times2.default)(rowHeightIndex[index0], () => {
return new Array(tableWidth).fill('');
}); // rowHeight
// [{row index within rowSaw; index2}]
// [{cell index within a virtual row; index1}]
cells.forEach((value, index1) => {
const cellLines = (0, _wrapCell.default)(value, config.columns[index1].width, config.columns[index1].wrapWord);
cellLines.forEach((cellLine, index2) => {
rowHeight[index2][index1] = cellLine;
});
});
return rowHeight;
});
return (0, _flatten2.default)(mappedRows);
};
var _default = mapDataUsingRowHeightIndex;
exports.default = _default;
//# sourceMappingURL=mapDataUsingRowHeightIndex.js.map
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。