1
1
/*!
2
2
*
3
- * jsPDF AutoTable plugin v3.8.1
3
+ * jsPDF AutoTable plugin v3.8.2
4
4
*
5
- * Copyright (c) 2023 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable
5
+ * Copyright (c) 2024 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable
6
6
* Licensed under the MIT License.
7
7
* http://opensource.org/licenses/mit-license
8
8
*
16
16
var a = typeof exports === 'object' ? factory ( ( function webpackLoadOptionalExternalModule ( ) { try { return require ( "jspdf" ) ; } catch ( e ) { } } ( ) ) ) : factory ( root [ "jspdf" ] ) ;
17
17
for ( var i in a ) ( typeof exports === 'object' ? exports : root ) [ i ] = a [ i ] ;
18
18
}
19
- } ) ( typeof globalThis !== 'undefined' ? globalThis : typeof this !== 'undefined' ? this : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : global , function ( __WEBPACK_EXTERNAL_MODULE__84__ ) {
19
+ } ) ( typeof globalThis !== 'undefined' ? globalThis : typeof this !== 'undefined' ? this : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : global , function ( __WEBPACK_EXTERNAL_MODULE__964__ ) {
20
20
return /******/ ( function ( ) { // webpackBootstrap
21
21
/******/ "use strict" ;
22
22
/******/ var __webpack_modules__ = ( {
23
23
24
- /***/ 662 :
24
+ /***/ 172 :
25
25
/***/ ( function ( __unused_webpack_module , exports ) {
26
26
27
27
@@ -71,17 +71,17 @@ exports.CellHookData = CellHookData;
71
71
72
72
/***/ } ) ,
73
73
74
- /***/ 790 :
74
+ /***/ 340 :
75
75
/***/ ( function ( __unused_webpack_module , exports , __webpack_require__ ) {
76
76
77
77
78
78
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
79
- var htmlParser_1 = __webpack_require__ ( 148 ) ;
80
- var autoTableText_1 = __webpack_require__ ( 938 ) ;
81
- var documentHandler_1 = __webpack_require__ ( 323 ) ;
82
- var inputParser_1 = __webpack_require__ ( 587 ) ;
83
- var tableDrawer_1 = __webpack_require__ ( 49 ) ;
84
- var tableCalculator_1 = __webpack_require__ ( 858 ) ;
79
+ var htmlParser_1 = __webpack_require__ ( 4 ) ;
80
+ var autoTableText_1 = __webpack_require__ ( 136 ) ;
81
+ var documentHandler_1 = __webpack_require__ ( 744 ) ;
82
+ var inputParser_1 = __webpack_require__ ( 776 ) ;
83
+ var tableDrawer_1 = __webpack_require__ ( 664 ) ;
84
+ var tableCalculator_1 = __webpack_require__ ( 972 ) ;
85
85
function default_1 ( jsPDF ) {
86
86
// eslint-disable-next-line @typescript-eslint/no-explicit-any
87
87
jsPDF . API . autoTable = function ( ) {
@@ -119,14 +119,15 @@ function default_1(jsPDF) {
119
119
documentHandler_1 . DocHandler . setDefaults ( defaults , doc ) ;
120
120
} ;
121
121
jsPDF . API . autoTableHtmlToJson = function ( tableElem , includeHiddenElements ) {
122
+ var _a ;
122
123
if ( includeHiddenElements === void 0 ) { includeHiddenElements = false ; }
123
124
if ( typeof window === 'undefined' ) {
124
125
console . error ( 'Cannot run autoTableHtmlToJson in non browser environment' ) ;
125
126
return null ;
126
127
}
127
128
var doc = new documentHandler_1 . DocHandler ( this ) ;
128
- var _a = ( 0 , htmlParser_1 . parseHtml ) ( doc , tableElem , window , includeHiddenElements , false ) , head = _a . head , body = _a . body ;
129
- var columns = head [ 0 ] . map ( function ( c ) { return c . content ; } ) ;
129
+ var _b = ( 0 , htmlParser_1 . parseHtml ) ( doc , tableElem , window , includeHiddenElements , false ) , head = _b . head , body = _b . body ;
130
+ var columns = ( ( _a = head [ 0 ] ) === null || _a === void 0 ? void 0 : _a . map ( function ( c ) { return c . content ; } ) ) || [ ] ;
130
131
return { columns : columns , rows : body , data : body } ;
131
132
} ;
132
133
/**
@@ -167,7 +168,7 @@ exports["default"] = default_1;
167
168
168
169
/***/ } ) ,
169
170
170
- /***/ 938 :
171
+ /***/ 136 :
171
172
/***/ ( function ( __unused_webpack_module , exports ) {
172
173
173
174
@@ -230,7 +231,7 @@ exports["default"] = default_1;
230
231
231
232
/***/ } ) ,
232
233
233
- /***/ 200 :
234
+ /***/ 420 :
234
235
/***/ ( function ( __unused_webpack_module , exports ) {
235
236
236
237
@@ -338,7 +339,7 @@ exports.getPageAvailableWidth = getPageAvailableWidth;
338
339
339
340
/***/ } ) ,
340
341
341
- /***/ 913 :
342
+ /***/ 796 :
342
343
/***/ ( function ( __unused_webpack_module , exports ) {
343
344
344
345
@@ -372,18 +373,18 @@ exports.HtmlRowInput = HtmlRowInput;
372
373
// Base style for all themes
373
374
function defaultStyles ( scaleFactor ) {
374
375
return {
375
- font : 'helvetica' ,
376
- fontStyle : 'normal' ,
377
- overflow : 'linebreak' ,
378
- fillColor : false ,
376
+ font : 'helvetica' , // helvetica, times, courier
377
+ fontStyle : 'normal' , // normal, bold, italic, bolditalic
378
+ overflow : 'linebreak' , // linebreak, ellipsize, visible or hidden
379
+ fillColor : false , // Either false for transparent, rbg array e.g. [255, 255, 255] or gray level e.g 200
379
380
textColor : 20 ,
380
- halign : 'left' ,
381
- valign : 'top' ,
381
+ halign : 'left' , // left, center, right, justify
382
+ valign : 'top' , // top, middle, bottom
382
383
fontSize : 10 ,
383
- cellPadding : 5 / scaleFactor ,
384
+ cellPadding : 5 / scaleFactor , // number or {top,left,right,left,vertical,horizontal}
384
385
lineColor : 200 ,
385
386
lineWidth : 0 ,
386
- cellWidth : 'auto' ,
387
+ cellWidth : 'auto' , // 'auto'|'wrap'|number
387
388
minCellHeight : 0 ,
388
389
minCellWidth : 0 ,
389
390
} ;
@@ -432,7 +433,7 @@ exports.getTheme = getTheme;
432
433
433
434
/***/ } ) ,
434
435
435
- /***/ 259 :
436
+ /***/ 903 :
436
437
/***/ ( function ( __unused_webpack_module , exports , __webpack_require__ ) {
437
438
438
439
@@ -441,7 +442,7 @@ exports.parseCss = void 0;
441
442
// Limitations
442
443
// - No support for border spacing
443
444
// - No support for transparency
444
- var common_1 = __webpack_require__ ( 200 ) ;
445
+ var common_1 = __webpack_require__ ( 420 ) ;
445
446
function parseCss ( supportedFonts , element , scaleFactor , style , window ) {
446
447
var result = { } ;
447
448
var pxScaleFactor = 96 / 72 ;
@@ -587,7 +588,7 @@ function parsePadding(style, scaleFactor) {
587
588
588
589
/***/ } ) ,
589
590
590
- /***/ 323 :
591
+ /***/ 744 :
591
592
/***/ ( function ( __unused_webpack_module , exports ) {
592
593
593
594
@@ -758,14 +759,14 @@ exports.DocHandler = DocHandler;
758
759
759
760
/***/ } ) ,
760
761
761
- /***/ 148 :
762
+ /***/ 4 :
762
763
/***/ ( function ( __unused_webpack_module , exports , __webpack_require__ ) {
763
764
764
765
765
766
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
766
767
exports . parseHtml = void 0 ;
767
- var cssParser_1 = __webpack_require__ ( 259 ) ;
768
- var config_1 = __webpack_require__ ( 913 ) ;
768
+ var cssParser_1 = __webpack_require__ ( 903 ) ;
769
+ var config_1 = __webpack_require__ ( 796 ) ;
769
770
function parseHtml ( doc , input , window , includeHiddenHtml , useCss ) {
770
771
var _a , _b ;
771
772
if ( includeHiddenHtml === void 0 ) { includeHiddenHtml = false ; }
@@ -846,17 +847,17 @@ function parseCellContent(orgCell) {
846
847
847
848
/***/ } ) ,
848
849
849
- /***/ 587 :
850
+ /***/ 776 :
850
851
/***/ ( function ( __unused_webpack_module , exports , __webpack_require__ ) {
851
852
852
853
853
854
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
854
855
exports . parseInput = void 0 ;
855
- var htmlParser_1 = __webpack_require__ ( 148 ) ;
856
- var polyfills_1 = __webpack_require__ ( 360 ) ;
857
- var common_1 = __webpack_require__ ( 200 ) ;
858
- var documentHandler_1 = __webpack_require__ ( 323 ) ;
859
- var inputValidator_1 = __webpack_require__ ( 291 ) ;
856
+ var htmlParser_1 = __webpack_require__ ( 4 ) ;
857
+ var polyfills_1 = __webpack_require__ ( 356 ) ;
858
+ var common_1 = __webpack_require__ ( 420 ) ;
859
+ var documentHandler_1 = __webpack_require__ ( 744 ) ;
860
+ var inputValidator_1 = __webpack_require__ ( 792 ) ;
860
861
function parseInput ( d , current ) {
861
862
var doc = new documentHandler_1 . DocHandler ( d ) ;
862
863
var document = doc . getDocumentOptions ( ) ;
@@ -1058,7 +1059,7 @@ function parseColumns(head, body, foot) {
1058
1059
1059
1060
/***/ } ) ,
1060
1061
1061
- /***/ 291 :
1062
+ /***/ 792 :
1062
1063
/***/ ( function ( __unused_webpack_module , exports ) {
1063
1064
1064
1065
@@ -1183,15 +1184,15 @@ function checkStyles(styles) {
1183
1184
1184
1185
/***/ } ) ,
1185
1186
1186
- /***/ 287 :
1187
+ /***/ 260 :
1187
1188
/***/ ( function ( __unused_webpack_module , exports , __webpack_require__ ) {
1188
1189
1189
1190
1190
1191
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
1191
1192
exports . Column = exports . Cell = exports . Row = exports . Table = void 0 ;
1192
- var config_1 = __webpack_require__ ( 913 ) ;
1193
- var HookData_1 = __webpack_require__ ( 662 ) ;
1194
- var common_1 = __webpack_require__ ( 200 ) ;
1193
+ var config_1 = __webpack_require__ ( 796 ) ;
1194
+ var HookData_1 = __webpack_require__ ( 172 ) ;
1195
+ var common_1 = __webpack_require__ ( 420 ) ;
1195
1196
var Table = /** @class */ ( function ( ) {
1196
1197
function Table ( input , content ) {
1197
1198
this . pageNumber = 1 ;
@@ -1413,7 +1414,7 @@ exports.Column = Column;
1413
1414
1414
1415
/***/ } ) ,
1415
1416
1416
- /***/ 360 :
1417
+ /***/ 356 :
1417
1418
/***/ ( function ( __unused_webpack_module , exports ) {
1418
1419
1419
1420
@@ -1446,17 +1447,17 @@ exports.assign = assign;
1446
1447
1447
1448
/***/ } ) ,
1448
1449
1449
- /***/ 858 :
1450
+ /***/ 972 :
1450
1451
/***/ ( function ( __unused_webpack_module , exports , __webpack_require__ ) {
1451
1452
1452
1453
1453
1454
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
1454
1455
exports . createTable = void 0 ;
1455
- var documentHandler_1 = __webpack_require__ ( 323 ) ;
1456
- var models_1 = __webpack_require__ ( 287 ) ;
1457
- var widthCalculator_1 = __webpack_require__ ( 189 ) ;
1458
- var config_1 = __webpack_require__ ( 913 ) ;
1459
- var polyfills_1 = __webpack_require__ ( 360 ) ;
1456
+ var documentHandler_1 = __webpack_require__ ( 744 ) ;
1457
+ var models_1 = __webpack_require__ ( 260 ) ;
1458
+ var widthCalculator_1 = __webpack_require__ ( 324 ) ;
1459
+ var config_1 = __webpack_require__ ( 796 ) ;
1460
+ var polyfills_1 = __webpack_require__ ( 356 ) ;
1460
1461
function createTable ( jsPDFDoc , input ) {
1461
1462
var doc = new documentHandler_1 . DocHandler ( jsPDFDoc ) ;
1462
1463
var content = parseContent ( input , doc . scaleFactor ( ) ) ;
@@ -1606,18 +1607,18 @@ function cellStyles(sectionName, column, rowIndex, themeName, styles, scaleFacto
1606
1607
1607
1608
/***/ } ) ,
1608
1609
1609
- /***/ 49 :
1610
+ /***/ 664 :
1610
1611
/***/ ( function ( __unused_webpack_module , exports , __webpack_require__ ) {
1611
1612
1612
1613
1613
1614
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
1614
1615
exports . addPage = exports . drawTable = void 0 ;
1615
- var common_1 = __webpack_require__ ( 200 ) ;
1616
- var models_1 = __webpack_require__ ( 287 ) ;
1617
- var documentHandler_1 = __webpack_require__ ( 323 ) ;
1618
- var polyfills_1 = __webpack_require__ ( 360 ) ;
1619
- var autoTableText_1 = __webpack_require__ ( 938 ) ;
1620
- var tablePrinter_1 = __webpack_require__ ( 435 ) ;
1616
+ var common_1 = __webpack_require__ ( 420 ) ;
1617
+ var models_1 = __webpack_require__ ( 260 ) ;
1618
+ var documentHandler_1 = __webpack_require__ ( 744 ) ;
1619
+ var polyfills_1 = __webpack_require__ ( 356 ) ;
1620
+ var autoTableText_1 = __webpack_require__ ( 136 ) ;
1621
+ var tablePrinter_1 = __webpack_require__ ( 224 ) ;
1621
1622
function drawTable ( jsPDFDoc , table ) {
1622
1623
var settings = table . settings ;
1623
1624
var startY = settings . startY ;
@@ -2053,13 +2054,13 @@ function nextPage(doc) {
2053
2054
2054
2055
/***/ } ) ,
2055
2056
2056
- /***/ 435 :
2057
+ /***/ 224 :
2057
2058
/***/ ( function ( __unused_webpack_module , exports , __webpack_require__ ) {
2058
2059
2059
2060
2060
2061
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
2061
2062
exports . calculateAllColumnsCanFitInPage = void 0 ;
2062
- var common_1 = __webpack_require__ ( 200 ) ;
2063
+ var common_1 = __webpack_require__ ( 420 ) ;
2063
2064
// get columns can be fit into page
2064
2065
function getColumnsCanFitInPage ( doc , table , config ) {
2065
2066
var _a ;
@@ -2129,13 +2130,13 @@ exports.calculateAllColumnsCanFitInPage = calculateAllColumnsCanFitInPage;
2129
2130
2130
2131
/***/ } ) ,
2131
2132
2132
- /***/ 189 :
2133
+ /***/ 324 :
2133
2134
/***/ ( function ( __unused_webpack_module , exports , __webpack_require__ ) {
2134
2135
2135
2136
2136
2137
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
2137
2138
exports . ellipsize = exports . resizeColumns = exports . calculateWidths = void 0 ;
2138
- var common_1 = __webpack_require__ ( 200 ) ;
2139
+ var common_1 = __webpack_require__ ( 420 ) ;
2139
2140
/**
2140
2141
* Calculate the column widths
2141
2142
*/
@@ -2442,12 +2443,12 @@ function ellipsizeStr(text, width, styles, doc, overflow) {
2442
2443
2443
2444
/***/ } ) ,
2444
2445
2445
- /***/ 84 :
2446
+ /***/ 964 :
2446
2447
/***/ ( function ( module ) {
2447
2448
2448
- if ( typeof __WEBPACK_EXTERNAL_MODULE__84__ === 'undefined' ) { var e = new Error ( "Cannot find module 'undefined'" ) ; e . code = 'MODULE_NOT_FOUND' ; throw e ; }
2449
+ if ( typeof __WEBPACK_EXTERNAL_MODULE__964__ === 'undefined' ) { var e = new Error ( "Cannot find module 'undefined'" ) ; e . code = 'MODULE_NOT_FOUND' ; throw e ; }
2449
2450
2450
- module . exports = __WEBPACK_EXTERNAL_MODULE__84__ ;
2451
+ module . exports = __WEBPACK_EXTERNAL_MODULE__964__ ;
2451
2452
2452
2453
/***/ } )
2453
2454
@@ -2485,15 +2486,15 @@ var exports = __webpack_exports__;
2485
2486
2486
2487
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
2487
2488
exports . Cell = exports . Column = exports . Row = exports . Table = exports . CellHookData = exports . __drawTable = exports . __createTable = exports . applyPlugin = void 0 ;
2488
- var applyPlugin_1 = __webpack_require__ ( 790 ) ;
2489
- var inputParser_1 = __webpack_require__ ( 587 ) ;
2490
- var tableDrawer_1 = __webpack_require__ ( 49 ) ;
2491
- var tableCalculator_1 = __webpack_require__ ( 858 ) ;
2492
- var models_1 = __webpack_require__ ( 287 ) ;
2489
+ var applyPlugin_1 = __webpack_require__ ( 340 ) ;
2490
+ var inputParser_1 = __webpack_require__ ( 776 ) ;
2491
+ var tableDrawer_1 = __webpack_require__ ( 664 ) ;
2492
+ var tableCalculator_1 = __webpack_require__ ( 972 ) ;
2493
+ var models_1 = __webpack_require__ ( 260 ) ;
2493
2494
Object . defineProperty ( exports , "Table" , ( { enumerable : true , get : function ( ) { return models_1 . Table ; } } ) ) ;
2494
- var HookData_1 = __webpack_require__ ( 662 ) ;
2495
+ var HookData_1 = __webpack_require__ ( 172 ) ;
2495
2496
Object . defineProperty ( exports , "CellHookData" , ( { enumerable : true , get : function ( ) { return HookData_1 . CellHookData ; } } ) ) ;
2496
- var models_2 = __webpack_require__ ( 287 ) ;
2497
+ var models_2 = __webpack_require__ ( 260 ) ;
2497
2498
Object . defineProperty ( exports , "Cell" , ( { enumerable : true , get : function ( ) { return models_2 . Cell ; } } ) ) ;
2498
2499
Object . defineProperty ( exports , "Column" , ( { enumerable : true , get : function ( ) { return models_2 . Column ; } } ) ) ;
2499
2500
Object . defineProperty ( exports , "Row" , ( { enumerable : true , get : function ( ) { return models_2 . Row ; } } ) ) ;
@@ -2520,7 +2521,7 @@ function __drawTable(d, table) {
2520
2521
exports . __drawTable = __drawTable ;
2521
2522
try {
2522
2523
// eslint-disable-next-line @typescript-eslint/no-var-requires
2523
- var jsPDF = __webpack_require__ ( 84 ) ;
2524
+ var jsPDF = __webpack_require__ ( 964 ) ;
2524
2525
// Webpack imported jspdf instead of jsPDF for some reason
2525
2526
// while it seemed to work everywhere else.
2526
2527
if ( jsPDF . jsPDF )
0 commit comments