mapDataUsingRowHeightIndex.js.map 2.06 KB
{"version":3,"sources":["../src/mapDataUsingRowHeightIndex.js"],"names":["unmappedRows","rowHeightIndex","config","tableWidth","length","mappedRows","map","cells","index0","rowHeight","_","times","Array","fill","forEach","value","index1","cellLines","columns","width","wrapWord","cellLine","index2","flatten"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;;oCAMgBA,Y,EAAcC,c,EAAgBC,M,KAAW;AACvD,QAAMC,UAAU,GAAGH,YAAY,CAAC,CAAD,CAAZ,CAAgBI,MAAnC;AAEA,QAAMC,UAAU,GAAGL,YAAY,CAACM,GAAb,CAAiB,CAACC,KAAD,EAAQC,MAAR,KAAmB;AACrD,UAAMC,SAAS,GAAGC,gBAAEC,KAAF,CAAQV,cAAc,CAACO,MAAD,CAAtB,EAAgC,MAAM;AACtD,aAAO,IAAII,KAAJ,CAAUT,UAAV,EAAsBU,IAAtB,CAA2B,EAA3B,CAAP;AACD,KAFiB,CAAlB,CADqD,CAKrD;AACA;AACA;;;AAEAN,IAAAA,KAAK,CAACO,OAAN,CAAc,CAACC,KAAD,EAAQC,MAAR,KAAmB;AAC/B,YAAMC,SAAS,GAAG,uBAASF,KAAT,EAAgBb,MAAM,CAACgB,OAAP,CAAeF,MAAf,EAAuBG,KAAvC,EAA8CjB,MAAM,CAACgB,OAAP,CAAeF,MAAf,EAAuBI,QAArE,CAAlB;AAEAH,MAAAA,SAAS,CAACH,OAAV,CAAkB,CAACO,QAAD,EAAWC,MAAX,KAAsB;AACtCb,QAAAA,SAAS,CAACa,MAAD,CAAT,CAAkBN,MAAlB,IAA4BK,QAA5B;AACD,OAFD;AAGD,KAND;AAQA,WAAOZ,SAAP;AACD,GAlBkB,CAAnB;AAoBA,SAAOC,gBAAEa,OAAF,CAAUlB,UAAV,CAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {Array} unmappedRows\n * @param {number[]} rowHeightIndex\n * @param {Object} config\n * @returns {Array}\n */\nexport default (unmappedRows, rowHeightIndex, config) => {\n  const tableWidth = unmappedRows[0].length;\n\n  const mappedRows = unmappedRows.map((cells, index0) => {\n    const rowHeight = _.times(rowHeightIndex[index0], () => {\n      return new Array(tableWidth).fill('');\n    });\n\n    // rowHeight\n    //     [{row index within rowSaw; index2}]\n    //     [{cell index within a virtual row; index1}]\n\n    cells.forEach((value, index1) => {\n      const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord);\n\n      cellLines.forEach((cellLine, index2) => {\n        rowHeight[index2][index1] = cellLine;\n      });\n    });\n\n    return rowHeight;\n  });\n\n  return _.flatten(mappedRows);\n};\n"],"file":"mapDataUsingRowHeightIndex.js"}