Skip to content

Commit

Permalink
3.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbengtsson committed Nov 1, 2023
1 parent c40e174 commit 16b9a37
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 29 deletions.
2 changes: 1 addition & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ declare class DocHandler {
height: number;
};
scaleFactor(): number;
get lineHeightFactor(): number;
getLineHeightFactor(): number;
getLineHeight(fontSize: number): number;
pageNumber(): number;
}
Expand Down
20 changes: 8 additions & 12 deletions dist/jspdf.plugin.autotable.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
*
* jsPDF AutoTable plugin v3.7.0
* jsPDF AutoTable plugin v3.7.1
*
* Copyright (c) 2023 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable
* Licensed under the MIT License.
Expand Down Expand Up @@ -736,16 +736,12 @@ var DocHandler = /** @class */ (function () {
DocHandler.prototype.scaleFactor = function () {
return this.jsPDFDocument.internal.scaleFactor;
};
Object.defineProperty(DocHandler.prototype, "lineHeightFactor", {
get: function () {
var doc = this.jsPDFDocument;
return doc.getLineHeightFactor ? doc.getLineHeightFactor() : 1.15;
},
enumerable: false,
configurable: true
});
DocHandler.prototype.getLineHeightFactor = function () {
var doc = this.jsPDFDocument;
return doc.getLineHeightFactor ? doc.getLineHeightFactor() : 1.15;
};
DocHandler.prototype.getLineHeight = function (fontSize) {
return (fontSize / this.scaleFactor()) * this.lineHeightFactor;
return (fontSize / this.scaleFactor()) * this.getLineHeightFactor();
};
DocHandler.prototype.pageNumber = function () {
var pageInfo = this.jsPDFDocument.internal.getCurrentPageInfo();
Expand Down Expand Up @@ -1748,7 +1744,7 @@ function modifyRowToFit(row, remainingPageSpace, table, doc) {
remainderCell.text = cell.text.splice(remainingLineCount, cell.text.length);
}
var scaleFactor = doc.scaleFactor();
var lineHeightFactor = doc.lineHeightFactor;
var lineHeightFactor = doc.getLineHeightFactor();
cell.contentHeight = cell.getContentHeight(scaleFactor, lineHeightFactor);
if (cell.contentHeight >= remainingPageSpace) {
cell.contentHeight = remainingPageSpace;
Expand Down Expand Up @@ -2347,7 +2343,7 @@ function fitContent(table, doc) {
cell.text = result;
}
}
cell.contentHeight = cell.getContentHeight(doc.scaleFactor(), doc.lineHeightFactor);
cell.contentHeight = cell.getContentHeight(doc.scaleFactor(), doc.getLineHeightFactor());
var realContentHeight = cell.contentHeight / cell.rowSpan;
if (cell.rowSpan > 1 &&
rowSpanHeight.count * rowSpanHeight.height <
Expand Down
4 changes: 2 additions & 2 deletions dist/jspdf.plugin.autotable.min.js

Large diffs are not rendered by default.

18 changes: 7 additions & 11 deletions dist/jspdf.plugin.autotable.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -612,16 +612,12 @@ var DocHandler = /** @class */ (function () {
DocHandler.prototype.scaleFactor = function () {
return this.jsPDFDocument.internal.scaleFactor;
};
Object.defineProperty(DocHandler.prototype, "lineHeightFactor", {
get: function () {
var doc = this.jsPDFDocument;
return doc.getLineHeightFactor ? doc.getLineHeightFactor() : 1.15;
},
enumerable: false,
configurable: true
});
DocHandler.prototype.getLineHeightFactor = function () {
var doc = this.jsPDFDocument;
return doc.getLineHeightFactor ? doc.getLineHeightFactor() : 1.15;
};
DocHandler.prototype.getLineHeight = function (fontSize) {
return (fontSize / this.scaleFactor()) * this.lineHeightFactor;
return (fontSize / this.scaleFactor()) * this.getLineHeightFactor();
};
DocHandler.prototype.pageNumber = function () {
var pageInfo = this.jsPDFDocument.internal.getCurrentPageInfo();
Expand Down Expand Up @@ -1396,7 +1392,7 @@ function modifyRowToFit(row, remainingPageSpace, table, doc) {
remainderCell.text = cell.text.splice(remainingLineCount, cell.text.length);
}
var scaleFactor = doc.scaleFactor();
var lineHeightFactor = doc.lineHeightFactor;
var lineHeightFactor = doc.getLineHeightFactor();
cell.contentHeight = cell.getContentHeight(scaleFactor, lineHeightFactor);
if (cell.contentHeight >= remainingPageSpace) {
cell.contentHeight = remainingPageSpace;
Expand Down Expand Up @@ -1906,7 +1902,7 @@ function fitContent(table, doc) {
cell.text = result;
}
}
cell.contentHeight = cell.getContentHeight(doc.scaleFactor(), doc.lineHeightFactor);
cell.contentHeight = cell.getContentHeight(doc.scaleFactor(), doc.getLineHeightFactor());
var realContentHeight = cell.contentHeight / cell.rowSpan;
if (cell.rowSpan > 1 &&
rowSpanHeight.count * rowSpanHeight.height <
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jspdf-autotable",
"version": "3.7.0",
"version": "3.7.1",
"description": "Generate pdf tables with javascript (jsPDF plugin)",
"main": "dist/jspdf.plugin.autotable.js",
"exports": {
Expand Down

0 comments on commit 16b9a37

Please sign in to comment.