@qr-platform/qr-code.js 0.20.1 → 0.20.3
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/CHANGELOG.md +12 -0
- package/README.md +5 -0
- package/docs/advanced-examples.md +39 -0
- package/docs/api-reference-guide.md +3 -1
- package/docs/documentation.md +66 -3
- package/docs/examples.md +76 -0
- package/docs/typescript-types-definitions.md +21 -1
- package/docs/usage-guide.md +43 -8
- package/lib/browser.js +1 -1
- package/lib/core/qr-svg.d.ts +3 -0
- package/lib/esm.js +1 -1
- package/lib/index.js +1 -1
- package/lib/node/core/qr-svg.d.ts +3 -0
- package/lib/node/plugins/QRBorderPlugin.d.ts +2 -2
- package/lib/node/utils/options.d.ts +21 -4
- package/lib/node.js +1 -1
- package/lib/plugins/QRBorderPlugin.d.ts +2 -2
- package/lib/utils/options.d.ts +21 -4
- package/package.json +1 -1
|
@@ -5,6 +5,9 @@ import { BorderOptions, Options } from '../utils/options';
|
|
|
5
5
|
type QRSVGOptions = Pick<Options, 'width' | 'height' | 'isResponsive' | 'margin' | 'document' | 'imageTools' | 'image' | 'imageOptions' | 'dotsOptions' | 'cornersDotOptions' | 'cornersSquareOptions' | 'backgroundOptions' | 'borderOptions' | 'shape' | 'scale' | 'verticalOffset' | 'horizontalOffset' | 'offset'> & {
|
|
6
6
|
width: number;
|
|
7
7
|
height: number;
|
|
8
|
+
userWidth?: number | string;
|
|
9
|
+
userHeight?: number | string;
|
|
10
|
+
zoomFactor?: number;
|
|
8
11
|
hls: boolean;
|
|
9
12
|
errorCorrectionPercent: number;
|
|
10
13
|
bordersMain: {
|
|
@@ -10,8 +10,8 @@ export interface QRBorderPluginStyleOptions {
|
|
|
10
10
|
fontWeight?: string;
|
|
11
11
|
}
|
|
12
12
|
interface QRPluginSettings {
|
|
13
|
-
width?: number;
|
|
14
|
-
height?: number;
|
|
13
|
+
width?: number | string;
|
|
14
|
+
height?: number | string;
|
|
15
15
|
document: Document;
|
|
16
16
|
instanceId: number;
|
|
17
17
|
backgroundOptions?: {
|
|
@@ -110,11 +110,28 @@ export interface Options {
|
|
|
110
110
|
instanceId: number;
|
|
111
111
|
/** Use a custom image fetching & serializaton implementation */
|
|
112
112
|
imageTools?: typeof browserImageTools;
|
|
113
|
-
/**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
/**
|
|
114
|
+
* QR code width in pixels or CSS units (e.g., '300px', '100%')
|
|
115
|
+
* When isResponsive is false: This value overrides the auto-calculated width and sets the SVG width attribute
|
|
116
|
+
* When isResponsive is true: This value is ignored and the SVG uses 100% width
|
|
117
|
+
* If not specified, the library calculates the optimal width based on QR code size and options
|
|
118
|
+
*/
|
|
119
|
+
width?: number | string;
|
|
120
|
+
/**
|
|
121
|
+
* QR code height in pixels or CSS units (e.g., '300px', '100%')
|
|
122
|
+
* When isResponsive is false: This value overrides the auto-calculated height and sets the SVG height attribute
|
|
123
|
+
* When isResponsive is true: This value is ignored and the SVG uses 100% height
|
|
124
|
+
* If not specified, the library calculates the optimal height based on QR code size and options
|
|
125
|
+
*/
|
|
126
|
+
height?: number | string;
|
|
127
|
+
/**
|
|
128
|
+
* Controls whether the QR code SVG should be responsive to its container
|
|
129
|
+
* When true: SVG uses 100% width/height, ignoring any specified width/height values
|
|
130
|
+
* When false (default): SVG uses specified width/height values or auto-calculated dimensions
|
|
131
|
+
* @default false
|
|
132
|
+
*/
|
|
117
133
|
isResponsive?: boolean;
|
|
134
|
+
zoomFactor?: number;
|
|
118
135
|
margin?: number;
|
|
119
136
|
verticalOffset?: number;
|
|
120
137
|
horizontalOffset?: number;
|