xl-public-utils 1.0.20 → 1.0.21
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.
- package/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/qrcode.js +4 -0
package/index.d.ts
CHANGED
|
@@ -832,6 +832,8 @@ declare module "xl-public-utils" {
|
|
|
832
832
|
guardrightpos?: number | undefined;
|
|
833
833
|
guardleftypos?: number | undefined;
|
|
834
834
|
guardrightypos?: number | undefined;
|
|
835
|
+
eclevel?: 'L' | 'M' | 'Q' | 'H',
|
|
836
|
+
version?: number
|
|
835
837
|
}
|
|
836
838
|
export interface RenderOptions extends BwippOptions {
|
|
837
839
|
bcid: string;
|
package/package.json
CHANGED
package/src/qrcode.js
CHANGED
|
@@ -43,6 +43,8 @@ export function generateQRCodeWithText(content, options = {}) {
|
|
|
43
43
|
textLeftMargin = 20,
|
|
44
44
|
fontWeight = 700,
|
|
45
45
|
textColor = '#000',
|
|
46
|
+
eclevel = 'M',
|
|
47
|
+
version = 1,
|
|
46
48
|
textContent
|
|
47
49
|
} = options
|
|
48
50
|
/**
|
|
@@ -83,6 +85,8 @@ export function generateQRCodeWithText(content, options = {}) {
|
|
|
83
85
|
width: qrcodeW, // QR code width
|
|
84
86
|
height: qrcodeH, // QR code height
|
|
85
87
|
includetext: false, // Do not include text below QR code
|
|
88
|
+
eclevel,
|
|
89
|
+
version
|
|
86
90
|
});
|
|
87
91
|
// Draw the QR code on the left (300x300), centered vertically at (0, 21)
|
|
88
92
|
ctx.drawImage(tempCanvas, left, top, qrcodeW, qrcodeH);
|