@certifaction/vue-pdf-viewer
Advanced tools
Comparing version 1.3.0 to 1.3.1
/*! | ||
* @certifaction/vue-pdf-viewer 1.2.0 | ||
* @certifaction/vue-pdf-viewer 1.3.0 | ||
* | ||
* @link https://certifaction.com | ||
* @source https://github.com/certifaction/js-pdf-viewer.git | ||
* @copyright (c) 2019-2021 Certifaction AG | ||
* @copyright (c) 2019-2022 Certifaction AG | ||
* @license MIT | ||
@@ -22,4 +22,8 @@ */ | ||
methods: { | ||
_$t(key, ...values) { | ||
_$t(key) { | ||
if (typeof this.$t === 'function') { | ||
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
values[_key - 1] = arguments[_key]; | ||
} | ||
return this.$t(key, ...values); | ||
@@ -31,4 +35,8 @@ } | ||
_$tc(key, choice, ...values) { | ||
_$tc(key, choice) { | ||
if (typeof this.$tc === 'function') { | ||
for (var _len2 = arguments.length, values = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | ||
values[_key2 - 2] = arguments[_key2]; | ||
} | ||
return this.$tc(key, choice, ...values); | ||
@@ -48,4 +56,8 @@ } | ||
_$d(value, ...args) { | ||
_$d(value) { | ||
if (typeof this.$d === 'function') { | ||
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
args[_key3 - 1] = arguments[_key3]; | ||
} | ||
return this.$d(value, ...args); | ||
@@ -57,4 +69,8 @@ } | ||
_$n(value, ...args) { | ||
_$n(value) { | ||
if (typeof this.$n === 'function') { | ||
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { | ||
args[_key4 - 1] = arguments[_key4]; | ||
} | ||
return this.$n(value, ...args); | ||
@@ -223,5 +239,7 @@ } | ||
}, | ||
url: { | ||
type: String, | ||
required: true | ||
source: { | ||
required: true, | ||
validator: (value) => { | ||
return !!value && (typeof value === 'string' || value instanceof Uint8Array) | ||
} | ||
}, | ||
@@ -319,9 +337,24 @@ pdfjsViewerOptions: { | ||
const documentLoadingTask = pdfjs.pdfjsLib.getDocument({ | ||
url: this.url, | ||
const docOptions = { | ||
cMapUrl: this.pdfjsCMapUrl, | ||
cMapPacked: true | ||
}); | ||
}; | ||
if (this.source instanceof Uint8Array) { | ||
docOptions.data = this.source; | ||
} else { | ||
docOptions.url = this.source; | ||
} | ||
const documentLoadingTask = pdfjs.pdfjsLib.getDocument(docOptions); | ||
this.pdfDocument = await documentLoadingTask.promise; | ||
const event = new Event('PDFViewer:documentLoaded'); | ||
window.dispatchEvent(event); | ||
eventBus.on('pagesloaded', function() { | ||
const event = new Event('PDFViewer:pagesLoaded'); | ||
window.dispatchEvent(event); | ||
}); | ||
this.pdfViewer.setDocument(this.pdfDocument); | ||
@@ -367,3 +400,3 @@ } | ||
exports['default'] = __vue_component__; | ||
exports["default"] = __vue_component__; | ||
//# sourceMappingURL=certifaction-vue-pdf-viewer.common.js.map |
/*! | ||
* @certifaction/vue-pdf-viewer 1.2.0 | ||
* @certifaction/vue-pdf-viewer 1.3.0 | ||
* | ||
* @link https://certifaction.com | ||
* @source https://github.com/certifaction/js-pdf-viewer.git | ||
* @copyright (c) 2019-2021 Certifaction AG | ||
* @copyright (c) 2019-2022 Certifaction AG | ||
* @license MIT | ||
@@ -18,4 +18,8 @@ */ | ||
methods: { | ||
_$t(key, ...values) { | ||
_$t(key) { | ||
if (typeof this.$t === 'function') { | ||
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
values[_key - 1] = arguments[_key]; | ||
} | ||
return this.$t(key, ...values); | ||
@@ -27,4 +31,8 @@ } | ||
_$tc(key, choice, ...values) { | ||
_$tc(key, choice) { | ||
if (typeof this.$tc === 'function') { | ||
for (var _len2 = arguments.length, values = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | ||
values[_key2 - 2] = arguments[_key2]; | ||
} | ||
return this.$tc(key, choice, ...values); | ||
@@ -44,4 +52,8 @@ } | ||
_$d(value, ...args) { | ||
_$d(value) { | ||
if (typeof this.$d === 'function') { | ||
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
args[_key3 - 1] = arguments[_key3]; | ||
} | ||
return this.$d(value, ...args); | ||
@@ -53,4 +65,8 @@ } | ||
_$n(value, ...args) { | ||
_$n(value) { | ||
if (typeof this.$n === 'function') { | ||
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { | ||
args[_key4 - 1] = arguments[_key4]; | ||
} | ||
return this.$n(value, ...args); | ||
@@ -219,5 +235,7 @@ } | ||
}, | ||
url: { | ||
type: String, | ||
required: true | ||
source: { | ||
required: true, | ||
validator: (value) => { | ||
return !!value && (typeof value === 'string' || value instanceof Uint8Array) | ||
} | ||
}, | ||
@@ -315,9 +333,24 @@ pdfjsViewerOptions: { | ||
const documentLoadingTask = pdfjsLib.getDocument({ | ||
url: this.url, | ||
const docOptions = { | ||
cMapUrl: this.pdfjsCMapUrl, | ||
cMapPacked: true | ||
}); | ||
}; | ||
if (this.source instanceof Uint8Array) { | ||
docOptions.data = this.source; | ||
} else { | ||
docOptions.url = this.source; | ||
} | ||
const documentLoadingTask = pdfjsLib.getDocument(docOptions); | ||
this.pdfDocument = await documentLoadingTask.promise; | ||
const event = new Event('PDFViewer:documentLoaded'); | ||
window.dispatchEvent(event); | ||
eventBus.on('pagesloaded', function() { | ||
const event = new Event('PDFViewer:pagesLoaded'); | ||
window.dispatchEvent(event); | ||
}); | ||
this.pdfViewer.setDocument(this.pdfDocument); | ||
@@ -324,0 +357,0 @@ } |
{ | ||
"name": "@certifaction/vue-pdf-viewer", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "PDF-Viewer for Vue.js based on Mozillas PDF.js", | ||
@@ -61,3 +61,3 @@ "private": false, | ||
}, | ||
"gitHead": "8fcb42a7487bd716c9d2c3b088f924160d82d7be" | ||
"gitHead": "2c051d172c1882b351f6803d0350e7c23f2e7fd7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86132
784