mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
1 line
89 KiB
JSON
1 line
89 KiB
JSON
|
|
{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar core_1 = require(\"@angular/core\");\nfunction isSSR() {\n return typeof window === 'undefined';\n}\nif (!isSSR()) {\n window['pdfjs-dist/build/pdf'] = require('pdfjs-dist/build/pdf');\n require('pdfjs-dist/web/compatibility');\n require('pdfjs-dist/web/pdf_viewer');\n PDFJS.verbosity = PDFJS.VERBOSITY_LEVELS.errors;\n}\nvar ɵngcc0 = require('@angular/core');\nvar PdfViewerComponent = function () {\n function PdfViewerComponent(element) {\n this.element = element;\n this._renderText = true;\n this._stickToPage = false;\n this._originalSize = true;\n this._page = 1;\n this._zoom = 1;\n this._rotation = 0;\n this._showAll = true;\n this._canAutoResize = true;\n this._fitToPage = false;\n this._externalLinkTarget = 'blank';\n this.afterLoadComplete = new core_1.EventEmitter();\n this.onError = new core_1.EventEmitter();\n this.onProgress = new core_1.EventEmitter();\n this.pageChange = new core_1.EventEmitter(true);\n if (!isSSR() && typeof PDFJS.workerSrc !== 'string') {\n PDFJS.workerSrc = \"https://cdnjs.cloudflare.com/ajax/libs/pdf.js/\" + PDFJS.version + \"/pdf.worker.min.js\";\n }\n }\n PdfViewerComponent.prototype.ngOnInit = function () {\n if (!isSSR()) {\n this.setupViewer();\n }\n };\n PdfViewerComponent.prototype.onPageResize = function () {\n var _this = this;\n if (!this._canAutoResize) {\n return;\n }\n if (this.resizeTimeout) {\n clearTimeout(this.resizeTimeout);\n }\n this.resizeTimeout = setTimeout(function () {\n _this.updateSize();\n }, 100);\n };\n PdfViewerComponent.prototype.ngOnChanges = function (changes) {\n if (isSSR()) {\n return;\n }\n if ('src' in changes) {\n this.loadPDF();\n } else if (this._pdf) {\n if ('renderText' in changes) {\n this.setupViewer();\n }\n this.update();\n }\n };\n Object.defineProperty(PdfViewerComponent.prototype, \"page\", {\n set: function (_page) {\n _page = parseInt(_page, 10);\n if (this._pdf && !this.isValidPageNumber(_page)) {\n _page = 1;\n }\n this._page = _page;\n this.pageChange.emit(_page);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfViewerComponent.prototype, \"renderText\", {\n set: function (renderText) {\n this._renderText = renderText;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfViewerComponent.prototype, \"originalSize\", {\n set: function (originalSize) {\n this._originalSize = originalSize;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfViewerComponent.prototype, \"showAll\", {\n set: function (value) {\n this._showAll = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfViewerComponent.prototype, \"stickToPage\", {\n set: function (value) {\n this._stickToPage = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfViewerComponent.prototype, \"zoom\", {\n get: function () {\n return this._zoom;\n },\n set: function (value) {\n if (value <= 0) {\n return;\n }\n this._zoom = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfViewerComponent.prototype, \"rotation\", {\n set: function (value) {\n if (!(typeof value === 'number' && value % 90 === 0)) {\n console.warn('Invalid pages rotation angle.');\n return;\n }\n this._rotation = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfViewerComponent.prototype, \"externalLinkTarget\", {\n set: function (value) {\n this._externalLinkTarget = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PdfViewerComponent.prototype, \"autoresize\", {\n
|