Skip to content

Commit

Permalink
Revert "webpack build"
Browse files Browse the repository at this point in the history
This reverts commit 969fc82.
  • Loading branch information
Lucas Lustosa Madureira authored and simonbengtsson committed Dec 6, 2023
1 parent 525357f commit cb13942
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 33 deletions.
24 changes: 8 additions & 16 deletions dist/jspdf.plugin.autotable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1686,9 +1686,7 @@ function printTableWithHorizontalPageBreak(doc, table, startPos, cursor) {
doc.applyStyles(doc.userStyles);
// add page to print next columns in new page
if (index > 0) {
// When adding a page here, make sure not to print the footers
// because they were already printed before on this same loop
addPage(doc, table, startPos, cursor, colsAndIndexes.columns, true);
addPage(doc, table, startPos, cursor, colsAndIndexes.columns);
}
else {
// print head for selected columns
Expand All @@ -1707,26 +1705,21 @@ function printTableWithHorizontalPageBreak(doc, table, startPos, cursor) {
var lastPrintedRowIndex = lastRowIndexOfLastPage_1;
if (firstColumnsToFitResult) {
doc.applyStyles(doc.userStyles);
var firstColumnsToFit = firstColumnsToFitResult.columns;
if (lastRowIndexOfLastPage_1 >= 0) {
// When adding a page here, make sure not to print the footers
// because they were already printed before on this same loop
addPage(doc, table, startPos, cursor, firstColumnsToFit, true);
addPage(doc, table, startPos, cursor, firstColumnsToFitResult.columns);
}
else {
printHead(doc, table, cursor, firstColumnsToFit);
printHead(doc, table, cursor, firstColumnsToFitResult.columns);
}
lastPrintedRowIndex = printBodyWithoutPageBreaks(doc, table, lastRowIndexOfLastPage_1 + 1, cursor, firstColumnsToFit);
printFoot(doc, table, cursor, firstColumnsToFit);
lastPrintedRowIndex = printBodyWithoutPageBreaks(doc, table, lastRowIndexOfLastPage_1 + 1, cursor, firstColumnsToFitResult.columns);
printFoot(doc, table, cursor, firstColumnsToFitResult.columns);
}
// Check how many rows were printed, so that the next columns would not print more rows than that
var maxNumberOfRows = lastPrintedRowIndex - lastRowIndexOfLastPage_1;
// Print the next columns, never exceding maxNumberOfRows
allColumnsCanFitResult.slice(1).forEach(function (colsAndIndexes) {
doc.applyStyles(doc.userStyles);
// When adding a page here, make sure not to print the footers
// because they were already printed before on this same loop
addPage(doc, table, startPos, cursor, colsAndIndexes.columns, true);
addPage(doc, table, startPos, cursor, colsAndIndexes.columns);
printBodyWithoutPageBreaks(doc, table, lastRowIndexOfLastPage_1 + 1, cursor, colsAndIndexes.columns, maxNumberOfRows);
printFoot(doc, table, cursor, colsAndIndexes.columns);
});
Expand Down Expand Up @@ -2013,11 +2006,10 @@ function getRemainingPageSpace(doc, table, isLastRow, cursor) {
}
return doc.pageSize().height - cursor.y - bottomContentHeight;
}
function addPage(doc, table, startPos, cursor, columns, suppressFooter) {
function addPage(doc, table, startPos, cursor, columns) {
if (columns === void 0) { columns = []; }
if (suppressFooter === void 0) { suppressFooter = false; }
doc.applyStyles(doc.userStyles);
if (table.settings.showFoot === 'everyPage' && !suppressFooter) {
if (table.settings.showFoot === 'everyPage') {
table.foot.forEach(function (row) { return printRow(doc, table, row, cursor, columns); });
}
// Add user content just before adding new page ensure it will
Expand Down
Loading

0 comments on commit cb13942

Please sign in to comment.