UNPKG

primeng-extensions

Version:

[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![npm](https://img.shields.io/npm/dt/primeng-extensions.svg)]() [![Dependency Status][daviddm-image]][daviddm-url] ![Crates.io](https://img.shields.io/github/license/mashape

105 lines 4.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var common_1 = require("@angular/common"); var i0 = require("@angular/core"); var _c0 = ["qrcode"]; var QRCodeComponent = /** @class */ (function () { function QRCodeComponent() { this.background = 'white'; this.backgroundAlpha = 1.0; this.foreground = 'black'; this.foregroundAlpha = 1.0; this.level = 'L'; this.mime = 'image/png'; this.padding = null; this.size = 100; } QRCodeComponent.prototype.ngOnInit = function () { this.initialized = false; }; QRCodeComponent.prototype.ngAfterViewChecked = function () { if (!this.initialized) { this.init(); } }; QRCodeComponent.prototype.init = function () { this.initialized = true; var qrObject = { element: this.containerViewChild.nativeElement, background: this.background, backgroundAlpha: this.backgroundAlpha, foreground: this.foreground, foregroundAlpha: this.foregroundAlpha, level: this.level, mime: this.mime, padding: this.padding, size: this.size, value: this.value }; this.qrcode = new QRious(qrObject); }; QRCodeComponent.prototype.ngOnDestroy = function () { this.qrcode = null; this.initialized = false; }; QRCodeComponent.ɵfac = function QRCodeComponent_Factory(t) { return new (t || QRCodeComponent)(); }; QRCodeComponent.ɵcmp = i0.ɵɵdefineComponent({ type: QRCodeComponent, selectors: [["pe-qrcode"]], viewQuery: function QRCodeComponent_Query(rf, ctx) { if (rf & 1) { i0.ɵɵviewQuery(_c0, true); } if (rf & 2) { var _t; i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.containerViewChild = _t.first); } }, inputs: { value: "value", background: "background", backgroundAlpha: "backgroundAlpha", foreground: "foreground", foregroundAlpha: "foregroundAlpha", level: "level", mime: "mime", padding: "padding", size: "size" }, decls: 3, vars: 0, consts: [[1, "ui-widget", "ui-corner-all"], ["qrcode", ""]], template: function QRCodeComponent_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "div", 0); i0.ɵɵelement(1, "canvas", null, 1); i0.ɵɵelementEnd(); } }, encapsulation: 2 }); return QRCodeComponent; }()); exports.QRCodeComponent = QRCodeComponent; /*@__PURE__*/ (function () { i0.ɵsetClassMetadata(QRCodeComponent, [{ type: core_1.Component, args: [{ selector: 'pe-qrcode', template: "\n <div class=\"ui-widget ui-corner-all\">\n <canvas #qrcode></canvas>\n </div>" }] }], null, { value: [{ type: core_1.Input }], background: [{ type: core_1.Input }], backgroundAlpha: [{ type: core_1.Input }], foreground: [{ type: core_1.Input }], foregroundAlpha: [{ type: core_1.Input }], level: [{ type: core_1.Input }], mime: [{ type: core_1.Input }], padding: [{ type: core_1.Input }], size: [{ type: core_1.Input }], containerViewChild: [{ type: core_1.ViewChild, args: ['qrcode'] }] }); })(); var QRCodeModule = /** @class */ (function () { function QRCodeModule() { } QRCodeModule.ɵmod = i0.ɵɵdefineNgModule({ type: QRCodeModule }); QRCodeModule.ɵinj = i0.ɵɵdefineInjector({ factory: function QRCodeModule_Factory(t) { return new (t || QRCodeModule)(); }, imports: [[common_1.CommonModule]] }); return QRCodeModule; }()); exports.QRCodeModule = QRCodeModule; (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(QRCodeModule, { declarations: [QRCodeComponent], imports: [common_1.CommonModule], exports: [QRCodeComponent] }); })(); /*@__PURE__*/ (function () { i0.ɵsetClassMetadata(QRCodeModule, [{ type: core_1.NgModule, args: [{ imports: [common_1.CommonModule], exports: [QRCodeComponent], declarations: [QRCodeComponent] }] }], null, null); })(); //# sourceMappingURL=qrcode.js.map