Comparing version 5.1.1 to 5.2.0
@@ -349,2 +349,3 @@ (function (global, factory) { | ||
var validColorRegex = /^#(?:[0-9a-fA-F]{3,4}){1,2}$/; | ||
var QrCodeDirective = /** @class */ (function () { | ||
@@ -355,2 +356,4 @@ function QrCodeDirective(viewContainerRef) { | ||
this.errorCorrectionLevel = QrCodeDirective.DEFAULT_ERROR_CORRECTION_LEVEL; | ||
this.darkColor = "#000000FF"; | ||
this.lightColor = "#FFFFFFFF"; | ||
// eslint-disable-next-line @angular-eslint/no-input-rename | ||
@@ -362,3 +365,3 @@ this.margin = 16; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var canvas, context, errorCorrectionLevel, centerImageSrc, centerImageWidth, centerImageHeight, centerImage_1; | ||
var canvas, context, errorCorrectionLevel, dark, light, centerImageSrc, centerImageWidth, centerImageHeight, centerImage_1; | ||
return __generator(this, function (_c) { | ||
@@ -392,2 +395,12 @@ switch (_c.label) { | ||
errorCorrectionLevel = (_a = this.errorCorrectionLevel) !== null && _a !== void 0 ? _a : QrCodeDirective.DEFAULT_ERROR_CORRECTION_LEVEL; | ||
dark = validColorRegex.test(this.darkColor) ? this.darkColor : undefined; | ||
light = validColorRegex.test(this.lightColor) ? this.lightColor : undefined; | ||
if (i0.isDevMode()) { | ||
if (!dark && this.darkColor) { | ||
console.error("[ng-qrcode] darkColor set to invalid value, must be RGBA hex color string, eg: #3050A1FF"); | ||
} | ||
if (!light && this.lightColor) { | ||
console.error("[ng-qrcode] lightColor set to invalid value, must be RGBA hex color string, eg: #3050A130"); | ||
} | ||
} | ||
return [4 /*yield*/, qrcode__default["default"] | ||
@@ -399,2 +412,6 @@ .toCanvas(canvas, this.value, { | ||
margin: this.margin, | ||
color: { | ||
dark: dark, | ||
light: light, | ||
}, | ||
})]; | ||
@@ -433,5 +450,5 @@ case 1: | ||
QrCodeDirective.DEFAULT_CENTER_IMAGE_SIZE = 40; | ||
QrCodeDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: QrCodeDirective, deps: [{ token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive }); | ||
QrCodeDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.8", type: QrCodeDirective, selector: "canvas[qrCode]", inputs: { value: ["qrCode", "value"], version: ["qrCodeVersion", "version"], errorCorrectionLevel: ["qrCodeErrorCorrectionLevel", "errorCorrectionLevel"], width: "width", height: "height", centerImageSrc: ["qrCodeCenterImageSrc", "centerImageSrc"], centerImageWidth: ["qrCodeCenterImageWidth", "centerImageWidth"], centerImageHeight: ["qrCodeCenterImageHeight", "centerImageHeight"], margin: ["qrCodeMargin", "margin"] }, usesOnChanges: true, ngImport: i0__namespace }); | ||
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: QrCodeDirective, decorators: [{ | ||
QrCodeDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: QrCodeDirective, deps: [{ token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive }); | ||
QrCodeDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: QrCodeDirective, selector: "canvas[qrCode]", inputs: { value: ["qrCode", "value"], version: ["qrCodeVersion", "version"], errorCorrectionLevel: ["qrCodeErrorCorrectionLevel", "errorCorrectionLevel"], width: "width", height: "height", darkColor: "darkColor", lightColor: "lightColor", centerImageSrc: ["qrCodeCenterImageSrc", "centerImageSrc"], centerImageWidth: ["qrCodeCenterImageWidth", "centerImageWidth"], centerImageHeight: ["qrCodeCenterImageHeight", "centerImageHeight"], margin: ["qrCodeMargin", "margin"] }, usesOnChanges: true, ngImport: i0__namespace }); | ||
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: QrCodeDirective, decorators: [{ | ||
type: i0.Directive, | ||
@@ -455,2 +472,6 @@ args: [{ | ||
type: i0.Input | ||
}], darkColor: [{ | ||
type: i0.Input | ||
}], lightColor: [{ | ||
type: i0.Input | ||
}], centerImageSrc: [{ | ||
@@ -484,9 +505,9 @@ type: i0.Input, | ||
}()); | ||
QrCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: QrCodeComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component }); | ||
QrCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.8", type: QrCodeComponent, selector: "qr-code", inputs: { value: "value", size: "size", errorCorrectionLevel: "errorCorrectionLevel", centerImageSrc: "centerImageSrc", centerImageSize: "centerImageSize", margin: "margin" }, ngImport: i0__namespace, template: "\n <canvas *ngIf=\"value\"\n [qrCode]=\"value\"\n [qrCodeErrorCorrectionLevel]=\"errorCorrectionLevel\"\n [qrCodeCenterImageSrc]=\"centerImageSrc\"\n [qrCodeCenterImageWidth]=\"centerImageSize\"\n [qrCodeCenterImageHeight]=\"centerImageSize\"\n [qrCodeMargin]=\"margin\"\n [width]=\"size\"\n [height]=\"size\">\n </canvas>\n ", isInline: true, directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: QrCodeDirective, selector: "canvas[qrCode]", inputs: ["qrCode", "qrCodeVersion", "qrCodeErrorCorrectionLevel", "width", "height", "qrCodeCenterImageSrc", "qrCodeCenterImageWidth", "qrCodeCenterImageHeight", "qrCodeMargin"] }] }); | ||
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: QrCodeComponent, decorators: [{ | ||
QrCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: QrCodeComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component }); | ||
QrCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: QrCodeComponent, selector: "qr-code", inputs: { value: "value", size: "size", darkColor: "darkColor", lightColor: "lightColor", errorCorrectionLevel: "errorCorrectionLevel", centerImageSrc: "centerImageSrc", centerImageSize: "centerImageSize", margin: "margin" }, ngImport: i0__namespace, template: "\n <canvas *ngIf=\"value\"\n [qrCode]=\"value\"\n [qrCodeErrorCorrectionLevel]=\"errorCorrectionLevel\"\n [qrCodeCenterImageSrc]=\"centerImageSrc\"\n [qrCodeCenterImageWidth]=\"centerImageSize\"\n [qrCodeCenterImageHeight]=\"centerImageSize\"\n [qrCodeMargin]=\"margin\"\n [width]=\"size\"\n [height]=\"size\"\n [darkColor]=\"darkColor\"\n [lightColor]=\"lightColor\"\n >\n </canvas>\n ", isInline: true, directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: QrCodeDirective, selector: "canvas[qrCode]", inputs: ["qrCode", "qrCodeVersion", "qrCodeErrorCorrectionLevel", "width", "height", "darkColor", "lightColor", "qrCodeCenterImageSrc", "qrCodeCenterImageWidth", "qrCodeCenterImageHeight", "qrCodeMargin"] }] }); | ||
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: QrCodeComponent, decorators: [{ | ||
type: i0.Component, | ||
args: [{ | ||
selector: "qr-code", | ||
template: "\n <canvas *ngIf=\"value\"\n [qrCode]=\"value\"\n [qrCodeErrorCorrectionLevel]=\"errorCorrectionLevel\"\n [qrCodeCenterImageSrc]=\"centerImageSrc\"\n [qrCodeCenterImageWidth]=\"centerImageSize\"\n [qrCodeCenterImageHeight]=\"centerImageSize\"\n [qrCodeMargin]=\"margin\"\n [width]=\"size\"\n [height]=\"size\">\n </canvas>\n ", | ||
template: "\n <canvas *ngIf=\"value\"\n [qrCode]=\"value\"\n [qrCodeErrorCorrectionLevel]=\"errorCorrectionLevel\"\n [qrCodeCenterImageSrc]=\"centerImageSrc\"\n [qrCodeCenterImageWidth]=\"centerImageSize\"\n [qrCodeCenterImageHeight]=\"centerImageSize\"\n [qrCodeMargin]=\"margin\"\n [width]=\"size\"\n [height]=\"size\"\n [darkColor]=\"darkColor\"\n [lightColor]=\"lightColor\"\n >\n </canvas>\n ", | ||
styles: [], | ||
@@ -498,2 +519,6 @@ }] | ||
type: i0.Input | ||
}], darkColor: [{ | ||
type: i0.Input | ||
}], lightColor: [{ | ||
type: i0.Input | ||
}], errorCorrectionLevel: [{ | ||
@@ -514,10 +539,10 @@ type: i0.Input | ||
}()); | ||
QrCodeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: QrCodeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule }); | ||
QrCodeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: QrCodeModule, declarations: [QrCodeComponent, | ||
QrCodeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: QrCodeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule }); | ||
QrCodeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: QrCodeModule, declarations: [QrCodeComponent, | ||
QrCodeDirective], imports: [i1.CommonModule], exports: [QrCodeComponent, | ||
QrCodeDirective] }); | ||
QrCodeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: QrCodeModule, imports: [[ | ||
QrCodeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: QrCodeModule, imports: [[ | ||
i1.CommonModule, | ||
]] }); | ||
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0__namespace, type: QrCodeModule, decorators: [{ | ||
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: QrCodeModule, decorators: [{ | ||
type: i0.NgModule, | ||
@@ -524,0 +549,0 @@ args: [{ |
@@ -0,1 +1,5 @@ | ||
# 5.2.0 - 2021-10-17 | ||
- Support `darkColor` and `lightColor` inputs | ||
- Lockfile maintenance | ||
# 5.1.1 - 2021-10-03 | ||
@@ -2,0 +6,0 @@ - Dependencies updated, rebuild with latest angular-devkit |
@@ -7,4 +7,4 @@ import { Component, Input } from "@angular/core"; | ||
} | ||
QrCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); | ||
QrCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.8", type: QrCodeComponent, selector: "qr-code", inputs: { value: "value", size: "size", errorCorrectionLevel: "errorCorrectionLevel", centerImageSrc: "centerImageSrc", centerImageSize: "centerImageSize", margin: "margin" }, ngImport: i0, template: ` | ||
QrCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); | ||
QrCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: QrCodeComponent, selector: "qr-code", inputs: { value: "value", size: "size", darkColor: "darkColor", lightColor: "lightColor", errorCorrectionLevel: "errorCorrectionLevel", centerImageSrc: "centerImageSrc", centerImageSize: "centerImageSize", margin: "margin" }, ngImport: i0, template: ` | ||
<canvas *ngIf="value" | ||
@@ -18,6 +18,9 @@ [qrCode]="value" | ||
[width]="size" | ||
[height]="size"> | ||
[height]="size" | ||
[darkColor]="darkColor" | ||
[lightColor]="lightColor" | ||
> | ||
</canvas> | ||
`, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.QrCodeDirective, selector: "canvas[qrCode]", inputs: ["qrCode", "qrCodeVersion", "qrCodeErrorCorrectionLevel", "width", "height", "qrCodeCenterImageSrc", "qrCodeCenterImageWidth", "qrCodeCenterImageHeight", "qrCodeMargin"] }] }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeComponent, decorators: [{ | ||
`, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.QrCodeDirective, selector: "canvas[qrCode]", inputs: ["qrCode", "qrCodeVersion", "qrCodeErrorCorrectionLevel", "width", "height", "darkColor", "lightColor", "qrCodeCenterImageSrc", "qrCodeCenterImageWidth", "qrCodeCenterImageHeight", "qrCodeMargin"] }] }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeComponent, decorators: [{ | ||
type: Component, | ||
@@ -35,3 +38,6 @@ args: [{ | ||
[width]="size" | ||
[height]="size"> | ||
[height]="size" | ||
[darkColor]="darkColor" | ||
[lightColor]="lightColor" | ||
> | ||
</canvas> | ||
@@ -45,2 +51,6 @@ `, | ||
type: Input | ||
}], darkColor: [{ | ||
type: Input | ||
}], lightColor: [{ | ||
type: Input | ||
}], errorCorrectionLevel: [{ | ||
@@ -55,2 +65,2 @@ type: Input | ||
}] } }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXItY29kZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9u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XCJcbiAgICAgICAgICAgIFtxckNvZGVDZW50ZXJJbWFnZVdpZHRoXT1cImNlbnRlckltYWdlU2l6ZVwiXG4gICAgICAgICAgICBbcXJDb2RlQ2VudGVySW1hZ2VIZWlnaHRdPVwiY2VudGVySW1hZ2VTaXplXCJcbiAgICAgICAgICAgIFtxckNvZGVNYXJnaW5dPVwibWFyZ2luXCJcbiAgICAgICAgICAgIFt3aWR0aF09XCJzaXplXCJcbiAgICAgICAgICAgIFtoZWlnaHRdPVwic2l6ZVwiPlxuICAgIDwvY2FudmFzPlxuICBgLFxuICBzdHlsZXM6IFtdLFxufSlcbmV4cG9ydCBjbGFzcyBRckNvZGVDb21wb25lbnQge1xuXG4gIEBJbnB1dCgpXG4gIHZhbHVlPzogc3RyaW5nXG5cbiAgQElucHV0KClcbiAgc2l6ZT86IHN0cmluZyB8IG51bWJlclxuXG4gIEBJbnB1dCgpXG4gIGVycm9yQ29ycmVjdGlvbkxldmVsPzogUXJDb2RlRXJyb3JDb3JyZWN0aW9uTGV2ZWxcblxuICBASW5wdXQoKVxuICBjZW50ZXJJbWFnZVNyYz86IHN0cmluZ1xuXG4gIEBJbnB1dCgpXG4gIGNlbnRlckltYWdlU2l6ZT86IHN0cmluZyB8IG51bWJlclxuXG4gIEBJbnB1dCgpXG4gIG1hcmdpbj86IG51bWJlclxuXG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXItY29kZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZy1xcmNvZGUvc3JjL2xpYi9xci1jb2RlLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxNQUFNLGVBQWUsQ0FBQTs7OztBQXNCaEQsTUFBTSxPQUFPLGVBQWU7OzZHQUFm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dodF09XCJjZW50ZXJJbWFnZVNpemVcIlxuICAgICAgICAgICAgW3FyQ29kZU1hcmdpbl09XCJtYXJnaW5cIlxuICAgICAgICAgICAgW3dpZHRoXT1cInNpemVcIlxuICAgICAgICAgICAgW2hlaWdodF09XCJzaXplXCJcbiAgICAgICAgICAgIFtkYXJrQ29sb3JdPVwiZGFya0NvbG9yXCJcbiAgICAgICAgICAgIFtsaWdodENvbG9yXT1cImxpZ2h0Q29sb3JcIlxuICAgID5cbiAgICA8L2NhbnZhcz5cbiAgYCxcbiAgc3R5bGVzOiBbXSxcbn0pXG5leHBvcnQgY2xhc3MgUXJDb2RlQ29tcG9uZW50IHtcblxuICBASW5wdXQoKVxuICB2YWx1ZT86IHN0cmluZ1xuXG4gIEBJbnB1dCgpXG4gIHNpemU/OiBzdHJpbmcgfCBudW1iZXJcblxuICBASW5wdXQoKVxuICBkYXJrQ29sb3I/OiBSR0JBQ29sb3JcblxuICBASW5wdXQoKVxuICBsaWdodENvbG9yPzogUkdCQUNvbG9yXG5cbiAgQElucHV0KClcbiAgZXJyb3JDb3JyZWN0aW9uTGV2ZWw/OiBRckNvZGVFcnJvckNvcnJlY3Rpb25MZXZlbFxuXG4gIEBJbnB1dCgpXG4gIGNlbnRlckltYWdlU3JjPzogc3RyaW5nXG5cbiAgQElucHV0KClcbiAgY2VudGVySW1hZ2VTaXplPzogc3RyaW5nIHwgbnVtYmVyXG5cbiAgQElucHV0KClcbiAgbWFyZ2luPzogbnVtYmVyXG5cbn1cbiJdfQ== |
import { __awaiter } from "tslib"; | ||
import { Directive, Input } from "@angular/core"; | ||
import { Directive, Input, isDevMode } from "@angular/core"; | ||
import qrcode from "qrcode"; | ||
import * as i0 from "@angular/core"; | ||
const validColorRegex = /^#(?:[0-9a-fA-F]{3,4}){1,2}$/; | ||
export class QrCodeDirective { | ||
@@ -10,2 +11,4 @@ constructor(viewContainerRef) { | ||
this.errorCorrectionLevel = QrCodeDirective.DEFAULT_ERROR_CORRECTION_LEVEL; | ||
this.darkColor = "#000000FF"; | ||
this.lightColor = "#FFFFFFFF"; | ||
// eslint-disable-next-line @angular-eslint/no-input-rename | ||
@@ -42,2 +45,12 @@ this.margin = 16; | ||
const errorCorrectionLevel = (_a = this.errorCorrectionLevel) !== null && _a !== void 0 ? _a : QrCodeDirective.DEFAULT_ERROR_CORRECTION_LEVEL; | ||
const dark = validColorRegex.test(this.darkColor) ? this.darkColor : undefined; | ||
const light = validColorRegex.test(this.lightColor) ? this.lightColor : undefined; | ||
if (isDevMode()) { | ||
if (!dark && this.darkColor) { | ||
console.error("[ng-qrcode] darkColor set to invalid value, must be RGBA hex color string, eg: #3050A1FF"); | ||
} | ||
if (!light && this.lightColor) { | ||
console.error("[ng-qrcode] lightColor set to invalid value, must be RGBA hex color string, eg: #3050A130"); | ||
} | ||
} | ||
yield qrcode | ||
@@ -49,2 +62,6 @@ .toCanvas(canvas, this.value, { | ||
margin: this.margin, | ||
color: { | ||
dark, | ||
light, | ||
}, | ||
}); | ||
@@ -77,5 +94,5 @@ const centerImageSrc = this.centerImageSrc; | ||
QrCodeDirective.DEFAULT_CENTER_IMAGE_SIZE = 40; | ||
QrCodeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); | ||
QrCodeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.8", type: QrCodeDirective, selector: "canvas[qrCode]", inputs: { value: ["qrCode", "value"], version: ["qrCodeVersion", "version"], errorCorrectionLevel: ["qrCodeErrorCorrectionLevel", "errorCorrectionLevel"], width: "width", height: "height", centerImageSrc: ["qrCodeCenterImageSrc", "centerImageSrc"], centerImageWidth: ["qrCodeCenterImageWidth", "centerImageWidth"], centerImageHeight: ["qrCodeCenterImageHeight", "centerImageHeight"], margin: ["qrCodeMargin", "margin"] }, usesOnChanges: true, ngImport: i0 }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeDirective, decorators: [{ | ||
QrCodeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); | ||
QrCodeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: QrCodeDirective, selector: "canvas[qrCode]", inputs: { value: ["qrCode", "value"], version: ["qrCodeVersion", "version"], errorCorrectionLevel: ["qrCodeErrorCorrectionLevel", "errorCorrectionLevel"], width: "width", height: "height", darkColor: "darkColor", lightColor: "lightColor", centerImageSrc: ["qrCodeCenterImageSrc", "centerImageSrc"], centerImageWidth: ["qrCodeCenterImageWidth", "centerImageWidth"], centerImageHeight: ["qrCodeCenterImageHeight", "centerImageHeight"], margin: ["qrCodeMargin", "margin"] }, usesOnChanges: true, ngImport: i0 }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeDirective, decorators: [{ | ||
type: Directive, | ||
@@ -99,2 +116,6 @@ args: [{ | ||
type: Input | ||
}], darkColor: [{ | ||
type: Input | ||
}], lightColor: [{ | ||
type: Input | ||
}], centerImageSrc: [{ | ||
@@ -122,2 +143,2 @@ type: Input, | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXItY29kZS5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZy1xcmNvZGUvc3JjL2xpYi9xci1jb2RlLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQStCLE1BQU0sZUFBZSxDQUFB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hZ2VXaWR0aFxuICAgICAgfVxuXG4gICAgICBpZiAoY2VudGVySW1hZ2VIZWlnaHQgIT09IHRoaXMuY2VudGVySW1hZ2UuaGVpZ2h0KSB7XG4gICAgICAgIHRoaXMuY2VudGVySW1hZ2UuaGVpZ2h0ID0gY2VudGVySW1hZ2VIZWlnaHRcbiAgICAgIH1cblxuICAgICAgY29uc3QgY2VudGVySW1hZ2UgPSB0aGlzLmNlbnRlckltYWdlXG5cbiAgICAgIGNlbnRlckltYWdlLm9ubG9hZCA9ICgpID0+IHtcbiAgICAgICAgY29udGV4dC5kcmF3SW1hZ2UoXG4gICAgICAgICAgY2VudGVySW1hZ2UsXG4gICAgICAgICAgY2FudmFzLndpZHRoIC8gMiAtIGNlbnRlckltYWdlV2lkdGggLyAyLFxuICAgICAgICAgIGNhbnZhcy5oZWlnaHQgLyAyIC0gY2VudGVySW1hZ2VIZWlnaHQgLyAyLCBjZW50ZXJJbWFnZVdpZHRoLCBjZW50ZXJJbWFnZUhlaWdodCxcbiAgICAgICAgKVxuICAgICAgfVxuICAgIH1cblxuICB9XG5cbn1cblxuZnVuY3Rpb24gZ2V0SW50T3JEZWZhdWx0KHZhbHVlOiBzdHJpbmcgfCBudW1iZXIgfCB1bmRlZmluZWQsIGRlZmF1bHRWYWx1ZTogbnVtYmVyKTogbnVtYmVyIHtcbiAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHwgdmFsdWUgPT09IFwiXCIpIHtcbiAgICByZXR1cm4gZGVmYXVsdFZhbHVlXG4gIH1cblxuICBpZiAodHlwZW9mIHZhbHVlID09PSBcInN0cmluZ1wiKSB7XG4gICAgcmV0dXJuIHBhcnNlSW50KHZhbHVlLCAxMClcbiAgfVxuXG4gIHJldHVybiB2YWx1ZVxufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXItY29kZS5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyI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h0KSB7XG4gICAgICAgIHRoaXMuY2VudGVySW1hZ2UuaGVpZ2h0ID0gY2VudGVySW1hZ2VIZWlnaHRcbiAgICAgIH1cblxuICAgICAgY29uc3QgY2VudGVySW1hZ2UgPSB0aGlzLmNlbnRlckltYWdlXG5cbiAgICAgIGNlbnRlckltYWdlLm9ubG9hZCA9ICgpID0+IHtcbiAgICAgICAgY29udGV4dC5kcmF3SW1hZ2UoXG4gICAgICAgICAgY2VudGVySW1hZ2UsXG4gICAgICAgICAgY2FudmFzLndpZHRoIC8gMiAtIGNlbnRlckltYWdlV2lkdGggLyAyLFxuICAgICAgICAgIGNhbnZhcy5oZWlnaHQgLyAyIC0gY2VudGVySW1hZ2VIZWlnaHQgLyAyLCBjZW50ZXJJbWFnZVdpZHRoLCBjZW50ZXJJbWFnZUhlaWdodCxcbiAgICAgICAgKVxuICAgICAgfVxuICAgIH1cblxuICB9XG5cbn1cblxuZnVuY3Rpb24gZ2V0SW50T3JEZWZhdWx0KHZhbHVlOiBzdHJpbmcgfCBudW1iZXIgfCB1bmRlZmluZWQsIGRlZmF1bHRWYWx1ZTogbnVtYmVyKTogbnVtYmVyIHtcbiAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHwgdmFsdWUgPT09IFwiXCIpIHtcbiAgICByZXR1cm4gZGVmYXVsdFZhbHVlXG4gIH1cblxuICBpZiAodHlwZW9mIHZhbHVlID09PSBcInN0cmluZ1wiKSB7XG4gICAgcmV0dXJuIHBhcnNlSW50KHZhbHVlLCAxMClcbiAgfVxuXG4gIHJldHVybiB2YWx1ZVxufVxuIl19 |
@@ -8,10 +8,10 @@ import { CommonModule } from "@angular/common"; | ||
} | ||
QrCodeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); | ||
QrCodeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeModule, declarations: [QrCodeComponent, | ||
QrCodeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); | ||
QrCodeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeModule, declarations: [QrCodeComponent, | ||
QrCodeDirective], imports: [CommonModule], exports: [QrCodeComponent, | ||
QrCodeDirective] }); | ||
QrCodeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeModule, imports: [[ | ||
QrCodeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeModule, imports: [[ | ||
CommonModule, | ||
]] }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeModule, decorators: [{ | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeModule, decorators: [{ | ||
type: NgModule, | ||
@@ -32,2 +32,2 @@ args: [{ | ||
}] }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXItY29kZS5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZy1xcmNvZGUvc3JjL2xpYi9xci1jb2RlLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUE7QUFDOUMsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQTtBQUN4QyxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0scUJBQXFCLENBQUE7QUFDckQ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mcm9tIFwiLi9xci1jb2RlLmRpcmVjdGl2ZVwiXG5cbkBOZ01vZHVsZSh7XG4gIGRlY2xhcmF0aW9uczogW1xuICAgIFFyQ29kZUNvbXBvbmVudCxcbiAgICBRckNvZGVEaXJlY3RpdmUsXG4gIF0sXG4gIGltcG9ydHM6IFtcbiAgICBDb21tb25Nb2R1bGUsXG4gIF0sXG4gIGV4cG9ydHM6IFtcbiAgICBRckNvZGVDb21wb25lbnQsXG4gICAgUXJDb2RlRGlyZWN0aXZlLFxuICBdLFxufSlcbmV4cG9ydCBjbGFzcyBRckNvZGVNb2R1bGUge1xufVxuIl19 |
export {}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZy1xcmNvZGUvc3JjL2xpYi90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgUXJDb2RlRXJyb3JDb3JyZWN0aW9uTGV2ZWwgPSBcImxvd1wiIHwgXCJtZWRpdW1cIiB8IFwicXVhcnRpbGVcIiB8IFwiaGlnaFwiIHwgXCJMXCIgfCBcIk1cIiB8IFwiUVwiIHwgXCJIXCJcbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZy1xcmNvZGUvc3JjL2xpYi90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgUXJDb2RlRXJyb3JDb3JyZWN0aW9uTGV2ZWwgPSBcImxvd1wiIHwgXCJtZWRpdW1cIiB8IFwicXVhcnRpbGVcIiB8IFwiaGlnaFwiIHwgXCJMXCIgfCBcIk1cIiB8IFwiUVwiIHwgXCJIXCJcbi8vIFRPRE86IHVzZSBtb3JlIHNwZWNpZmljIHR5cGUgaWYgaHR0cHM6Ly9naXRodWIuY29tL21pY3Jvc29mdC9UeXBlU2NyaXB0L2lzc3Vlcy80MTE2MCBsYW5kc1xuZXhwb3J0IHR5cGUgUkdCQUNvbG9yID0gYCMke3N0cmluZ31gXG4iXX0= |
import * as i0 from '@angular/core'; | ||
import { Directive, Input, Component, NgModule } from '@angular/core'; | ||
import { isDevMode, Directive, Input, Component, NgModule } from '@angular/core'; | ||
import * as i1 from '@angular/common'; | ||
@@ -8,2 +8,3 @@ import { CommonModule } from '@angular/common'; | ||
const validColorRegex = /^#(?:[0-9a-fA-F]{3,4}){1,2}$/; | ||
class QrCodeDirective { | ||
@@ -14,2 +15,4 @@ constructor(viewContainerRef) { | ||
this.errorCorrectionLevel = QrCodeDirective.DEFAULT_ERROR_CORRECTION_LEVEL; | ||
this.darkColor = "#000000FF"; | ||
this.lightColor = "#FFFFFFFF"; | ||
// eslint-disable-next-line @angular-eslint/no-input-rename | ||
@@ -46,2 +49,12 @@ this.margin = 16; | ||
const errorCorrectionLevel = (_a = this.errorCorrectionLevel) !== null && _a !== void 0 ? _a : QrCodeDirective.DEFAULT_ERROR_CORRECTION_LEVEL; | ||
const dark = validColorRegex.test(this.darkColor) ? this.darkColor : undefined; | ||
const light = validColorRegex.test(this.lightColor) ? this.lightColor : undefined; | ||
if (isDevMode()) { | ||
if (!dark && this.darkColor) { | ||
console.error("[ng-qrcode] darkColor set to invalid value, must be RGBA hex color string, eg: #3050A1FF"); | ||
} | ||
if (!light && this.lightColor) { | ||
console.error("[ng-qrcode] lightColor set to invalid value, must be RGBA hex color string, eg: #3050A130"); | ||
} | ||
} | ||
yield qrcode | ||
@@ -53,2 +66,6 @@ .toCanvas(canvas, this.value, { | ||
margin: this.margin, | ||
color: { | ||
dark, | ||
light, | ||
}, | ||
}); | ||
@@ -81,5 +98,5 @@ const centerImageSrc = this.centerImageSrc; | ||
QrCodeDirective.DEFAULT_CENTER_IMAGE_SIZE = 40; | ||
QrCodeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); | ||
QrCodeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.8", type: QrCodeDirective, selector: "canvas[qrCode]", inputs: { value: ["qrCode", "value"], version: ["qrCodeVersion", "version"], errorCorrectionLevel: ["qrCodeErrorCorrectionLevel", "errorCorrectionLevel"], width: "width", height: "height", centerImageSrc: ["qrCodeCenterImageSrc", "centerImageSrc"], centerImageWidth: ["qrCodeCenterImageWidth", "centerImageWidth"], centerImageHeight: ["qrCodeCenterImageHeight", "centerImageHeight"], margin: ["qrCodeMargin", "margin"] }, usesOnChanges: true, ngImport: i0 }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeDirective, decorators: [{ | ||
QrCodeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); | ||
QrCodeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: QrCodeDirective, selector: "canvas[qrCode]", inputs: { value: ["qrCode", "value"], version: ["qrCodeVersion", "version"], errorCorrectionLevel: ["qrCodeErrorCorrectionLevel", "errorCorrectionLevel"], width: "width", height: "height", darkColor: "darkColor", lightColor: "lightColor", centerImageSrc: ["qrCodeCenterImageSrc", "centerImageSrc"], centerImageWidth: ["qrCodeCenterImageWidth", "centerImageWidth"], centerImageHeight: ["qrCodeCenterImageHeight", "centerImageHeight"], margin: ["qrCodeMargin", "margin"] }, usesOnChanges: true, ngImport: i0 }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeDirective, decorators: [{ | ||
type: Directive, | ||
@@ -103,2 +120,6 @@ args: [{ | ||
type: Input | ||
}], darkColor: [{ | ||
type: Input | ||
}], lightColor: [{ | ||
type: Input | ||
}], centerImageSrc: [{ | ||
@@ -129,4 +150,4 @@ type: Input, | ||
} | ||
QrCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); | ||
QrCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.8", type: QrCodeComponent, selector: "qr-code", inputs: { value: "value", size: "size", errorCorrectionLevel: "errorCorrectionLevel", centerImageSrc: "centerImageSrc", centerImageSize: "centerImageSize", margin: "margin" }, ngImport: i0, template: ` | ||
QrCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); | ||
QrCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: QrCodeComponent, selector: "qr-code", inputs: { value: "value", size: "size", darkColor: "darkColor", lightColor: "lightColor", errorCorrectionLevel: "errorCorrectionLevel", centerImageSrc: "centerImageSrc", centerImageSize: "centerImageSize", margin: "margin" }, ngImport: i0, template: ` | ||
<canvas *ngIf="value" | ||
@@ -140,6 +161,9 @@ [qrCode]="value" | ||
[width]="size" | ||
[height]="size"> | ||
[height]="size" | ||
[darkColor]="darkColor" | ||
[lightColor]="lightColor" | ||
> | ||
</canvas> | ||
`, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: QrCodeDirective, selector: "canvas[qrCode]", inputs: ["qrCode", "qrCodeVersion", "qrCodeErrorCorrectionLevel", "width", "height", "qrCodeCenterImageSrc", "qrCodeCenterImageWidth", "qrCodeCenterImageHeight", "qrCodeMargin"] }] }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeComponent, decorators: [{ | ||
`, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: QrCodeDirective, selector: "canvas[qrCode]", inputs: ["qrCode", "qrCodeVersion", "qrCodeErrorCorrectionLevel", "width", "height", "darkColor", "lightColor", "qrCodeCenterImageSrc", "qrCodeCenterImageWidth", "qrCodeCenterImageHeight", "qrCodeMargin"] }] }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeComponent, decorators: [{ | ||
type: Component, | ||
@@ -157,3 +181,6 @@ args: [{ | ||
[width]="size" | ||
[height]="size"> | ||
[height]="size" | ||
[darkColor]="darkColor" | ||
[lightColor]="lightColor" | ||
> | ||
</canvas> | ||
@@ -167,2 +194,6 @@ `, | ||
type: Input | ||
}], darkColor: [{ | ||
type: Input | ||
}], lightColor: [{ | ||
type: Input | ||
}], errorCorrectionLevel: [{ | ||
@@ -180,10 +211,10 @@ type: Input | ||
} | ||
QrCodeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); | ||
QrCodeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeModule, declarations: [QrCodeComponent, | ||
QrCodeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); | ||
QrCodeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeModule, declarations: [QrCodeComponent, | ||
QrCodeDirective], imports: [CommonModule], exports: [QrCodeComponent, | ||
QrCodeDirective] }); | ||
QrCodeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeModule, imports: [[ | ||
QrCodeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeModule, imports: [[ | ||
CommonModule, | ||
]] }); | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.8", ngImport: i0, type: QrCodeModule, decorators: [{ | ||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: QrCodeModule, decorators: [{ | ||
type: NgModule, | ||
@@ -190,0 +221,0 @@ args: [{ |
@@ -1,2 +0,2 @@ | ||
import { QrCodeErrorCorrectionLevel } from "./types"; | ||
import { QrCodeErrorCorrectionLevel, RGBAColor } from "./types"; | ||
import * as i0 from "@angular/core"; | ||
@@ -6,2 +6,4 @@ export declare class QrCodeComponent { | ||
size?: string | number; | ||
darkColor?: RGBAColor; | ||
lightColor?: RGBAColor; | ||
errorCorrectionLevel?: QrCodeErrorCorrectionLevel; | ||
@@ -12,3 +14,3 @@ centerImageSrc?: string; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<QrCodeComponent, never>; | ||
static ɵcmp: i0.ɵɵComponentDeclaration<QrCodeComponent, "qr-code", never, { "value": "value"; "size": "size"; "errorCorrectionLevel": "errorCorrectionLevel"; "centerImageSrc": "centerImageSrc"; "centerImageSize": "centerImageSize"; "margin": "margin"; }, {}, never, never>; | ||
static ɵcmp: i0.ɵɵComponentDeclaration<QrCodeComponent, "qr-code", never, { "value": "value"; "size": "size"; "darkColor": "darkColor"; "lightColor": "lightColor"; "errorCorrectionLevel": "errorCorrectionLevel"; "centerImageSrc": "centerImageSrc"; "centerImageSize": "centerImageSize"; "margin": "margin"; }, {}, never, never>; | ||
} |
import { OnChanges, ViewContainerRef } from "@angular/core"; | ||
import { QrCodeErrorCorrectionLevel } from "./types"; | ||
import { QrCodeErrorCorrectionLevel, RGBAColor } from "./types"; | ||
import * as i0 from "@angular/core"; | ||
@@ -13,2 +13,4 @@ export declare class QrCodeDirective implements OnChanges { | ||
height?: number; | ||
darkColor: RGBAColor; | ||
lightColor: RGBAColor; | ||
centerImageSrc?: string; | ||
@@ -22,3 +24,3 @@ centerImageWidth?: number | string; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<QrCodeDirective, never>; | ||
static ɵdir: i0.ɵɵDirectiveDeclaration<QrCodeDirective, "canvas[qrCode]", never, { "value": "qrCode"; "version": "qrCodeVersion"; "errorCorrectionLevel": "qrCodeErrorCorrectionLevel"; "width": "width"; "height": "height"; "centerImageSrc": "qrCodeCenterImageSrc"; "centerImageWidth": "qrCodeCenterImageWidth"; "centerImageHeight": "qrCodeCenterImageHeight"; "margin": "qrCodeMargin"; }, {}, never>; | ||
static ɵdir: i0.ɵɵDirectiveDeclaration<QrCodeDirective, "canvas[qrCode]", never, { "value": "qrCode"; "version": "qrCodeVersion"; "errorCorrectionLevel": "qrCodeErrorCorrectionLevel"; "width": "width"; "height": "height"; "darkColor": "darkColor"; "lightColor": "lightColor"; "centerImageSrc": "qrCodeCenterImageSrc"; "centerImageWidth": "qrCodeCenterImageWidth"; "centerImageHeight": "qrCodeCenterImageHeight"; "margin": "qrCodeMargin"; }, {}, never>; | ||
} |
export declare type QrCodeErrorCorrectionLevel = "low" | "medium" | "quartile" | "high" | "L" | "M" | "Q" | "H"; | ||
export declare type RGBAColor = `#${string}`; |
{ | ||
"name": "ng-qrcode", | ||
"description": "Simple AOT compatible QR code generator for your Angular project.", | ||
"version": "5.1.1", | ||
"version": "5.2.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -44,2 +44,14 @@ # Angular QR Code Generator | ||
#### darkColor: RGBAColor (optional) | ||
An RGBA Hex string to use as the color for the dark / filled modules. | ||
If an invalid value is passed, the default will be used. | ||
**Default** black ("#000000FF") | ||
#### lightColor: RGBAColor (optional) | ||
An RGBA Hex string to use as the color for the empty space. | ||
If an invalid value is passed, the default will be used. | ||
**Default** white ("#FFFFFFFF") | ||
#### errorCorrectionLevel: string (optional) | ||
@@ -46,0 +58,0 @@ Controls the amount of redundant information included to make the QR code |
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
131177
1097
114