@progress/kendo-pdfviewer-common 0.5.0-develop.4 → 0.5.0-develop.6

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.
@@ -23,7 +23,7 @@ export class Component {
23
23
  eventData.defaultPrevented = true;
24
24
  }
25
25
  };
26
- if (isFunction(this.options.events[eventName])) {
26
+ if (this.options.events && isFunction(this.options.events[eventName])) {
27
27
  this.options.events[eventName](extend(eventData, args, {
28
28
  sender: this
29
29
  }));
package/dist/es/utils.js CHANGED
@@ -24,7 +24,7 @@ const isFirefox = (userAgent) => {
24
24
  * @hidden
25
25
  */
26
26
  export const DEFAULT_ZOOM_LEVEL = 1.25;
27
- export const scale = () => (isIOS() ? devicePixelRatio : devicePixelRatio * 3);
27
+ export const scale = (renderScale = 3) => (isIOS() ? devicePixelRatio : devicePixelRatio * (renderScale || 3));
28
28
  export const parsePdfFromBase64String = (base64String) => {
29
29
  return atob(base64String.replace(/^(data:application\/pdf;base64,)/gi, ''));
30
30
  };
@@ -1,7 +1,7 @@
1
1
  var _PdfViewer_instances, _PdfViewer_annotationEditorMode, _PdfViewer_switchAnnotationEditorModeTimeoutId, _PdfViewer_annotationMode, _PdfViewer_eventAbortController, _PdfViewer_onPageRenderedCallback, _PdfViewer_switchToEditAnnotationMode, _PdfViewer_scrollIntoView;
2
2
  import { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
3
  import { deepExtend, Component, isString, toArray, noop, hasValue, toClassSelector, addClass, removeClass, mousewheelDelta, convertToHtml, clamp, createPromise } from "../common/main";
4
- import { currentPage, parsePdfFromBase64String, adjustCanvasSize, createElement, getDevicePixelRatio } from "../utils";
4
+ import { currentPage, parsePdfFromBase64String, adjustCanvasSize, createElement, scale as getScale } from "../utils";
5
5
  import { SearchService } from "../search";
6
6
  import { Scroller, throttle } from "../scroller";
7
7
  import { saveAs } from "@progress/kendo-file-saver";
@@ -752,7 +752,7 @@ export class PdfViewer extends Component {
752
752
  if (zoom <= 0) {
753
753
  return;
754
754
  }
755
- let scaleNum = this.options.renderScale * getDevicePixelRatio();
755
+ let scaleNum = getScale(this.options.renderScale);
756
756
  if (printUnits) {
757
757
  scaleNum = zoom || scaleNum;
758
758
  }
@@ -23,7 +23,7 @@ export class Component {
23
23
  eventData.defaultPrevented = true;
24
24
  }
25
25
  };
26
- if (isFunction(this.options.events[eventName])) {
26
+ if (this.options.events && isFunction(this.options.events[eventName])) {
27
27
  this.options.events[eventName](extend(eventData, args, {
28
28
  sender: this
29
29
  }));
@@ -24,7 +24,7 @@ const isFirefox = (userAgent) => {
24
24
  * @hidden
25
25
  */
26
26
  export const DEFAULT_ZOOM_LEVEL = 1.25;
27
- export const scale = () => (isIOS() ? devicePixelRatio : devicePixelRatio * 3);
27
+ export const scale = (renderScale = 3) => (isIOS() ? devicePixelRatio : devicePixelRatio * (renderScale || 3));
28
28
  export const parsePdfFromBase64String = (base64String) => {
29
29
  return atob(base64String.replace(/^(data:application\/pdf;base64,)/gi, ''));
30
30
  };
@@ -1,7 +1,7 @@
1
1
  var _PdfViewer_instances, _PdfViewer_annotationEditorMode, _PdfViewer_switchAnnotationEditorModeTimeoutId, _PdfViewer_annotationMode, _PdfViewer_eventAbortController, _PdfViewer_onPageRenderedCallback, _PdfViewer_switchToEditAnnotationMode, _PdfViewer_scrollIntoView;
2
2
  import { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
3
  import { deepExtend, Component, isString, toArray, noop, hasValue, toClassSelector, addClass, removeClass, mousewheelDelta, convertToHtml, clamp, createPromise } from "../common/main";
4
- import { currentPage, parsePdfFromBase64String, adjustCanvasSize, createElement, getDevicePixelRatio } from "../utils";
4
+ import { currentPage, parsePdfFromBase64String, adjustCanvasSize, createElement, scale as getScale } from "../utils";
5
5
  import { SearchService } from "../search";
6
6
  import { Scroller, throttle } from "../scroller";
7
7
  import { saveAs } from "@progress/kendo-file-saver";
@@ -752,7 +752,7 @@ export class PdfViewer extends Component {
752
752
  if (zoom <= 0) {
753
753
  return;
754
754
  }
755
- let scaleNum = this.options.renderScale * getDevicePixelRatio();
755
+ let scaleNum = getScale(this.options.renderScale);
756
756
  if (printUnits) {
757
757
  scaleNum = zoom || scaleNum;
758
758
  }
@@ -26,7 +26,7 @@ class Component {
26
26
  eventData.defaultPrevented = true;
27
27
  }
28
28
  };
29
- if ((0, core_1.isFunction)(this.options.events[eventName])) {
29
+ if (this.options.events && (0, core_1.isFunction)(this.options.events[eventName])) {
30
30
  this.options.events[eventName]((0, core_1.extend)(eventData, args, {
31
31
  sender: this
32
32
  }));
@@ -50,7 +50,7 @@ export interface PDFReloadParameters {
50
50
  * @hidden
51
51
  */
52
52
  export declare const DEFAULT_ZOOM_LEVEL = 1.25;
53
- export declare const scale: () => number;
53
+ export declare const scale: (renderScale?: number) => number;
54
54
  export declare const parsePdfFromBase64String: (base64String: string) => string;
55
55
  /**
56
56
  * @hidden
package/dist/npm/utils.js CHANGED
@@ -27,7 +27,7 @@ const isFirefox = (userAgent) => {
27
27
  * @hidden
28
28
  */
29
29
  exports.DEFAULT_ZOOM_LEVEL = 1.25;
30
- const scale = () => (isIOS() ? devicePixelRatio : devicePixelRatio * 3);
30
+ const scale = (renderScale = 3) => (isIOS() ? devicePixelRatio : devicePixelRatio * (renderScale || 3));
31
31
  exports.scale = scale;
32
32
  const parsePdfFromBase64String = (base64String) => {
33
33
  return atob(base64String.replace(/^(data:application\/pdf;base64,)/gi, ''));
@@ -755,7 +755,7 @@ class PdfViewer extends main_1.Component {
755
755
  if (zoom <= 0) {
756
756
  return;
757
757
  }
758
- let scaleNum = this.options.renderScale * (0, utils_1.getDevicePixelRatio)();
758
+ let scaleNum = (0, utils_1.scale)(this.options.renderScale);
759
759
  if (printUnits) {
760
760
  scaleNum = zoom || scaleNum;
761
761
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-pdfviewer-common",
3
3
  "description": "Kendo UI TypeScript package exporting functions for PDFViewer component",
4
- "version": "0.5.0-develop.4",
4
+ "version": "0.5.0-develop.6",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],