@websy/websy-designs 1.4.32 → 1.4.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/helpers/v1/pdfHelper.js +26 -24
- package/dist/websy-designs-es6.debug.js +1 -1
- package/dist/websy-designs-es6.js +1 -1
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +1 -1
- package/dist/websy-designs.js +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +3 -3
- package/readme.md +4 -0
|
@@ -75,31 +75,33 @@ let convertHTMLToPDF = (html, name, callback, options_in = null, displayHeaderFo
|
|
|
75
75
|
// Using this method to preserve external resources while maximizing allowed size of pdf
|
|
76
76
|
// Capture first request only
|
|
77
77
|
// page.setRequestInterception(true).then(() => {
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
page.setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36').then(() => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}, err => {
|
|
96
|
-
console.log('error evaluating handle in puppeteer', err)
|
|
97
|
-
callback(err)
|
|
98
|
-
})
|
|
99
|
-
}, err => {
|
|
100
|
-
console.log('error setting content in puppeteer', err)
|
|
101
|
-
callback(err)
|
|
78
|
+
// page.once('request', request => {
|
|
79
|
+
// // Fulfill request with HTML, and continue all subsequent requests
|
|
80
|
+
// request.respond({body: html})
|
|
81
|
+
// page.on('request', request => request.continue())
|
|
82
|
+
// })
|
|
83
|
+
// page.setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36').then(() => {
|
|
84
|
+
console.log(page)
|
|
85
|
+
page.setContent(html, {waitUntil: process.env.PDF_WAIT_FOR || ['networkidle2']}).then(() => {
|
|
86
|
+
// page.evaluateHandle('document.fonts.ready').then(() => {
|
|
87
|
+
report.pdfPage(page, options).then(pdf => {
|
|
88
|
+
browser.close()
|
|
89
|
+
callback(null, toBuffer(pdf.buffer))
|
|
90
|
+
}, (error) => {
|
|
91
|
+
console.log(error)
|
|
92
|
+
console.log('info', `Error creating PDF: ${error}`)
|
|
93
|
+
browser.close()
|
|
94
|
+
callback(error)
|
|
102
95
|
})
|
|
96
|
+
// }, err => {
|
|
97
|
+
// console.log('error evaluating handle in puppeteer', err)
|
|
98
|
+
// callback(err)
|
|
99
|
+
// })
|
|
100
|
+
// }, err => {
|
|
101
|
+
// console.log('error setting content in puppeteer', err)
|
|
102
|
+
// callback(err)
|
|
103
|
+
// })
|
|
104
|
+
// })
|
|
103
105
|
}, err => {
|
|
104
106
|
console.log('error setting user agent in puppeteer', err)
|
|
105
107
|
callback(err)
|
|
@@ -231,7 +231,7 @@ class ButtonGroup {
|
|
|
231
231
|
if (el && this.options.items) {
|
|
232
232
|
el.innerHTML = this.options.items.map((t, i) => {
|
|
233
233
|
let activeClass = ''
|
|
234
|
-
if (this.options.activeItem
|
|
234
|
+
if (this.options.activeItem !== -1) {
|
|
235
235
|
activeClass = i === this.options.activeItem ? 'active' : 'inactive'
|
|
236
236
|
}
|
|
237
237
|
return `
|
|
@@ -299,7 +299,7 @@ var ButtonGroup = /*#__PURE__*/function () {
|
|
|
299
299
|
el.innerHTML = this.options.items.map(function (t, i) {
|
|
300
300
|
var activeClass = '';
|
|
301
301
|
|
|
302
|
-
if (_this.options.activeItem
|
|
302
|
+
if (_this.options.activeItem !== -1) {
|
|
303
303
|
activeClass = i === _this.options.activeItem ? 'active' : 'inactive';
|
|
304
304
|
}
|
|
305
305
|
|