UNPKG

angularx-qrcode

Version:

Simple QRCode module generator for Angular 4-21 and Ionic 3-8 using node-qrcode

1 lines 19.7 kB
{"version":3,"file":"angularx-qrcode.mjs","sources":["../../../projects/angularx-qrcode/src/lib/angularx-qrcode.component.ts","../../../projects/angularx-qrcode/src/public-api.ts","../../../projects/angularx-qrcode/src/angularx-qrcode.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n OnChanges,\n Output,\n Renderer2,\n ViewChild,\n} from '@angular/core'\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser'\nimport {\n QRCodeRenderersOptions,\n QRCodeToDataURLOptions,\n QRCodeToStringOptions,\n toCanvas,\n toDataURL,\n toString,\n} from 'qrcode'\nimport {\n QRCodeVersion,\n QRCodeElementType,\n FixMeLater,\n QRCodeConfigType,\n QRCodeErrorCorrectionLevel,\n} from './types'\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'qrcode',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<div #qrcElement [class]=\"cssClass\"></div>`,\n})\nexport class QRCodeComponent implements OnChanges {\n @Input() public allowEmptyString = false\n @Input() public colorDark = '#000000ff'\n @Input() public colorLight = '#ffffffff'\n @Input() public cssClass = 'qrcode'\n @Input() public elementType: QRCodeElementType = 'canvas'\n @Input()\n public errorCorrectionLevel: QRCodeErrorCorrectionLevel = 'M'\n @Input() public imageSrc?: string\n @Input() public imageHeight?: number | string\n @Input() public imageWidth?: number | string\n @Input() public margin = 4\n @Input() public qrdata = ''\n @Input() public scale = 4\n @Input() public version?: QRCodeVersion\n @Input() public width = 10\n\n // Accessibility features introduced in 13.0.4+\n @Input() public alt?: string\n @Input() public ariaLabel?: string\n @Input() public title?: string\n\n @Output() qrCodeURL = new EventEmitter<SafeUrl>()\n\n @ViewChild('qrcElement', { static: true }) public qrcElement!: ElementRef\n\n public context: CanvasRenderingContext2D | null = null\n private centerImage?: HTMLImageElement\n\n private renderer = inject(Renderer2)\n private sanitizer = inject(DomSanitizer)\n\n public async ngOnChanges(): Promise<void> {\n await this.createQRCode()\n }\n\n protected isValidQrCodeText(data: string | null): boolean {\n if (this.allowEmptyString === false) {\n return !(typeof data === 'undefined' || data === '' || data === 'null' || data === null)\n }\n return !(typeof data === 'undefined')\n }\n\n private toDataURL(qrCodeConfig: QRCodeToDataURLOptions): Promise<FixMeLater> {\n return new Promise(\n (resolve: (arg: FixMeLater) => FixMeLater, reject: (arg: FixMeLater) => FixMeLater) => {\n toDataURL(this.qrdata, qrCodeConfig, (err: Error | null | undefined, url: string) => {\n if (err) {\n reject(err)\n } else {\n resolve(url)\n }\n })\n }\n )\n }\n\n private toCanvas(\n canvas: HTMLCanvasElement,\n qrCodeConfig: QRCodeRenderersOptions\n ): Promise<FixMeLater> {\n return new Promise(\n (resolve: (arg: FixMeLater) => FixMeLater, reject: (arg: FixMeLater) => FixMeLater) => {\n toCanvas(canvas, this.qrdata, qrCodeConfig, (error: Error | null | undefined) => {\n if (error) {\n reject(error)\n } else {\n resolve('success')\n }\n })\n }\n )\n }\n\n private toSVG(qrCodeConfig: QRCodeToStringOptions): Promise<FixMeLater> {\n return new Promise(\n (resolve: (arg: FixMeLater) => FixMeLater, reject: (arg: FixMeLater) => FixMeLater) => {\n toString(this.qrdata, qrCodeConfig, (err: Error | null | undefined, url: string) => {\n if (err) {\n reject(err)\n } else {\n resolve(url)\n }\n })\n }\n )\n }\n\n private renderElement(element: Element): void {\n for (const node of this.qrcElement.nativeElement.childNodes) {\n this.renderer.removeChild(this.qrcElement.nativeElement, node)\n }\n this.renderer.appendChild(this.qrcElement.nativeElement, element)\n }\n\n private async createQRCode(): Promise<void> {\n // Set sensitive defaults\n if (this.version && this.version > 40) {\n console.warn('[angularx-qrcode] max value for `version` is 40')\n this.version = 40\n } else if (this.version && this.version < 1) {\n console.warn('[angularx-qrcode]`min value for `version` is 1')\n this.version = 1\n } else if (this.version !== undefined && isNaN(this.version)) {\n console.warn('[angularx-qrcode] version should be a number, defaulting to auto.')\n this.version = undefined\n }\n\n try {\n if (!this.isValidQrCodeText(this.qrdata)) {\n throw new Error(\n '[angularx-qrcode] Field `qrdata` is empty, set \\'allowEmptyString=\"true\"\\' to overwrite this behaviour.'\n )\n }\n\n // This is a workaround to allow an empty string as qrdata\n if (this.isValidQrCodeText(this.qrdata) && this.qrdata === '') {\n this.qrdata = ' '\n }\n\n const config: QRCodeConfigType = {\n color: {\n dark: this.colorDark,\n light: this.colorLight,\n },\n errorCorrectionLevel: this.errorCorrectionLevel,\n margin: this.margin,\n scale: this.scale,\n version: this.version,\n width: this.width,\n }\n\n const centerImageSrc = this.imageSrc\n const centerImageHeight = this.imageHeight ? +this.imageHeight : 40\n const centerImageWidth = this.imageWidth ? +this.imageWidth : 40\n\n switch (this.elementType) {\n case 'canvas': {\n const canvasElement: HTMLCanvasElement = this.renderer.createElement('canvas')\n this.context = canvasElement.getContext('2d')\n this.toCanvas(canvasElement, config)\n .then(() => {\n if (this.ariaLabel) {\n this.renderer.setAttribute(canvasElement, 'aria-label', `${this.ariaLabel}`)\n }\n if (this.title) {\n this.renderer.setAttribute(canvasElement, 'title', `${this.title}`)\n }\n\n if (centerImageSrc && this.context) {\n this.centerImage = new Image(centerImageWidth, centerImageHeight)\n\n if (centerImageSrc !== this.centerImage.src) {\n this.centerImage.crossOrigin = 'anonymous'\n this.centerImage.src = centerImageSrc\n }\n\n if (centerImageHeight !== this.centerImage.height) {\n this.centerImage.height = centerImageHeight\n }\n\n if (centerImageWidth !== this.centerImage.width) {\n this.centerImage.width = centerImageWidth\n }\n\n const centerImage = this.centerImage\n\n if (centerImage) {\n centerImage.onload = () => {\n this.context?.drawImage(\n centerImage,\n canvasElement.width / 2 - centerImageWidth / 2,\n canvasElement.height / 2 - centerImageHeight / 2,\n centerImageWidth,\n centerImageHeight\n )\n }\n }\n }\n\n this.renderElement(canvasElement)\n this.emitQRCodeURL(canvasElement as HTMLCanvasElement)\n })\n .catch((e) => {\n console.error('[angularx-qrcode] canvas error:', e)\n })\n break\n }\n case 'svg': {\n const svgParentElement: HTMLElement = this.renderer.createElement('div')\n this.toSVG(config)\n .then((svgString: string) => {\n this.renderer.setProperty(svgParentElement, 'innerHTML', svgString)\n const svgElement = svgParentElement.firstChild as SVGSVGElement\n this.renderer.setAttribute(svgElement, 'height', `${this.width}`)\n this.renderer.setAttribute(svgElement, 'width', `${this.width}`)\n this.renderElement(svgElement)\n this.emitQRCodeURL(svgElement)\n })\n .catch((e) => {\n console.error('[angularx-qrcode] svg error:', e)\n })\n break\n }\n case 'url':\n case 'img':\n default: {\n const imgElement: HTMLImageElement = this.renderer.createElement('img')\n this.toDataURL(config)\n .then((dataUrl: string) => {\n if (this.alt) {\n imgElement.setAttribute('alt', this.alt)\n }\n if (this.ariaLabel) {\n imgElement.setAttribute('aria-label', this.ariaLabel)\n }\n imgElement.setAttribute('src', dataUrl)\n if (this.title) {\n imgElement.setAttribute('title', this.title)\n }\n this.renderElement(imgElement)\n this.emitQRCodeURL(imgElement)\n })\n .catch((e) => {\n console.error('[angularx-qrcode] img/url error:', e)\n })\n }\n }\n } catch (e: FixMeLater) {\n console.error('[angularx-qrcode] Error generating QR Code:', e.message)\n }\n }\n\n convertBase64ImageUrlToBlob(base64ImageUrl: string) {\n // split into two parts\n const parts = base64ImageUrl.split(';base64,')\n // hold the content/mime type f.e. image/png\n const imageType = parts[0].split(':')[1]\n // decode base64 string\n const decodedData = atob(parts[1])\n // create unit8array of size same as row data length\n const uInt8Array = new Uint8Array(decodedData.length)\n // insert all character code into uint8array\n for (let i = 0; i < decodedData.length; ++i) {\n uInt8Array[i] = decodedData.charCodeAt(i)\n }\n // return blob image after conversion\n return new Blob([uInt8Array], { type: imageType })\n }\n\n emitQRCodeURL(element: HTMLCanvasElement | HTMLImageElement | SVGSVGElement) {\n const className = element.constructor.name\n if (className === SVGSVGElement.name) {\n const svgHTML = element.outerHTML\n const blob = new Blob([svgHTML], { type: 'image/svg+xml' })\n const urlSvg = URL.createObjectURL(blob)\n const urlSanitized = this.sanitizer.bypassSecurityTrustUrl(urlSvg)\n this.qrCodeURL.emit(urlSanitized)\n return\n }\n\n let urlImage = ''\n\n if (className === HTMLCanvasElement.name) {\n urlImage = (element as HTMLCanvasElement).toDataURL('image/png')\n }\n\n if (className === HTMLImageElement.name) {\n urlImage = (element as HTMLImageElement).src\n }\n\n const blobData: Blob = this.convertBase64ImageUrlToBlob(urlImage)\n const urlBlob = URL.createObjectURL(blobData)\n const urlSanitized = this.sanitizer.bypassSecurityTrustUrl(urlBlob)\n this.qrCodeURL.emit(urlSanitized)\n }\n}\n","/*\n * Public API Surface of angularx-qrcode\n */\n\nexport { QRCodeComponent } from \"./lib/angularx-qrcode.component\"\nexport * from \"./lib/types\"\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAmCa,eAAe,CAAA;IACV,gBAAgB,GAAG,KAAK;IACxB,SAAS,GAAG,WAAW;IACvB,UAAU,GAAG,WAAW;IACxB,QAAQ,GAAG,QAAQ;IACnB,WAAW,GAAsB,QAAQ;IAElD,oBAAoB,GAA+B,GAAG;AAC7C,IAAA,QAAQ;AACR,IAAA,WAAW;AACX,IAAA,UAAU;IACV,MAAM,GAAG,CAAC;IACV,MAAM,GAAG,EAAE;IACX,KAAK,GAAG,CAAC;AACT,IAAA,OAAO;IACP,KAAK,GAAG,EAAE;;AAGV,IAAA,GAAG;AACH,IAAA,SAAS;AACT,IAAA,KAAK;AAEX,IAAA,SAAS,GAAG,IAAI,YAAY,EAAW;AAEC,IAAA,UAAU;IAErD,OAAO,GAAoC,IAAI;AAC9C,IAAA,WAAW;AAEX,IAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,IAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;AAEjC,IAAA,MAAM,WAAW,GAAA;AACtB,QAAA,MAAM,IAAI,CAAC,YAAY,EAAE;IAC3B;AAEU,IAAA,iB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