summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/table/dist/drawTable.js.map
blob: 526336ab999159c147139b8b625ac034e3d2a1ed (plain)
1
{"version":3,"sources":["../src/drawTable.js"],"names":["rows","border","columnSizeIndex","rowSpanIndex","drawHorizontalLine","output","realRowIndex","rowHeight","rowCount","length","forEach","row","index0"],"mappings":";;;;;;;AAAA;;AAKA;;;;AAEA;;;;;;;;mBAQgBA,I,EAAMC,M,EAAQC,e,EAAiBC,Y,EAAcC,kB,KAAuB;AAClF,MAAIC,MAAJ;AACA,MAAIC,YAAJ;AACA,MAAIC,SAAJ;AAEA,QAAMC,QAAQ,GAAGR,IAAI,CAACS,MAAtB;AAEAH,EAAAA,YAAY,GAAG,CAAf;AAEAD,EAAAA,MAAM,GAAG,EAAT;;AAEA,MAAID,kBAAkB,CAACE,YAAD,EAAeE,QAAf,CAAtB,EAAgD;AAC9CH,IAAAA,MAAM,IAAI,+BAAcH,eAAd,EAA+BD,MAA/B,CAAV;AACD;;AAEDD,EAAAA,IAAI,CAACU,OAAL,CAAa,CAACC,GAAD,EAAMC,MAAN,KAAiB;AAC5BP,IAAAA,MAAM,IAAI,sBAAQM,GAAR,EAAaV,MAAb,CAAV;;AAEA,QAAI,CAACM,SAAL,EAAgB;AACdA,MAAAA,SAAS,GAAGJ,YAAY,CAACG,YAAD,CAAxB;AAEAA,MAAAA,YAAY;AACb;;AAEDC,IAAAA,SAAS;;AAET,QAAIA,SAAS,KAAK,CAAd,IAAmBK,MAAM,KAAKJ,QAAQ,GAAG,CAAzC,IAA8CJ,kBAAkB,CAACE,YAAD,EAAeE,QAAf,CAApE,EAA8F;AAC5FH,MAAAA,MAAM,IAAI,gCAAeH,eAAf,EAAgCD,MAAhC,CAAV;AACD;AACF,GAdD;;AAgBA,MAAIG,kBAAkB,CAACE,YAAD,EAAeE,QAAf,CAAtB,EAAgD;AAC9CH,IAAAA,MAAM,IAAI,kCAAiBH,eAAjB,EAAkCD,MAAlC,CAAV;AACD;;AAED,SAAOI,MAAP;AACD,C","sourcesContent":["import {\n  drawBorderTop,\n  drawBorderJoin,\n  drawBorderBottom\n} from './drawBorder';\nimport drawRow from './drawRow';\n\n/**\n * @param {Array} rows\n * @param {Object} border\n * @param {Array} columnSizeIndex\n * @param {Array} rowSpanIndex\n * @param {Function} drawHorizontalLine\n * @returns {string}\n */\nexport default (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine) => {\n  let output;\n  let realRowIndex;\n  let rowHeight;\n\n  const rowCount = rows.length;\n\n  realRowIndex = 0;\n\n  output = '';\n\n  if (drawHorizontalLine(realRowIndex, rowCount)) {\n    output += drawBorderTop(columnSizeIndex, border);\n  }\n\n  rows.forEach((row, index0) => {\n    output += drawRow(row, border);\n\n    if (!rowHeight) {\n      rowHeight = rowSpanIndex[realRowIndex];\n\n      realRowIndex++;\n    }\n\n    rowHeight--;\n\n    if (rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) {\n      output += drawBorderJoin(columnSizeIndex, border);\n    }\n  });\n\n  if (drawHorizontalLine(realRowIndex, rowCount)) {\n    output += drawBorderBottom(columnSizeIndex, border);\n  }\n\n  return output;\n};\n"],"file":"drawTable.js"}