@progress/kendo-angular-barcodes 17.0.0-develop.21 → 17.0.0-develop.22
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/barcode.component.d.ts +1 -1
- package/base.component.d.ts +1 -1
- package/chart-types/barcode-types.d.ts +1 -1
- package/chart-types/field-types.d.ts +2 -2
- package/chart-types/qrcode-types.d.ts +2 -2
- package/esm2022/barcode.component.mjs +384 -0
- package/{esm2020 → esm2022}/barcode.module.mjs +4 -4
- package/{esm2020 → esm2022}/barcodes.module.mjs +4 -4
- package/{esm2020 → esm2022}/base.component.mjs +15 -10
- package/{esm2020 → esm2022}/package-metadata.mjs +2 -2
- package/esm2022/qrcode.component.mjs +361 -0
- package/{esm2020 → esm2022}/qrcode.module.mjs +4 -4
- package/fesm2022/progress-kendo-angular-barcodes.mjs +1102 -0
- package/package.json +12 -18
- package/qrcode.component.d.ts +1 -1
- package/schematics/ngAdd/index.js +1 -1
- package/esm2020/barcode.component.mjs +0 -124
- package/esm2020/qrcode.component.mjs +0 -124
- package/fesm2015/progress-kendo-angular-barcodes.mjs +0 -600
- package/fesm2020/progress-kendo-angular-barcodes.mjs +0 -600
- /package/{esm2020 → esm2022}/barcode-validator.mjs +0 -0
- /package/{esm2020 → esm2022}/chart-types/barcode-types.mjs +0 -0
- /package/{esm2020 → esm2022}/chart-types/field-types.mjs +0 -0
- /package/{esm2020 → esm2022}/chart-types/qrcode-types.mjs +0 -0
- /package/{esm2020 → esm2022}/chart-types.mjs +0 -0
- /package/{esm2020 → esm2022}/directives.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/progress-kendo-angular-barcodes.mjs +0 -0
- /package/{esm2020 → esm2022}/qrcode-validator.mjs +0 -0
@@ -0,0 +1,361 @@
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
5
|
+
import { ChangeDetectionStrategy, Component, ElementRef, Input, NgZone, Renderer2 } from '@angular/core';
|
6
|
+
import { QRCode } from '@progress/kendo-charts';
|
7
|
+
import { BaseComponent } from './base.component';
|
8
|
+
import { packageMetadata } from './package-metadata';
|
9
|
+
import { ResizeSensorComponent } from '@progress/kendo-angular-common';
|
10
|
+
import * as i0 from "@angular/core";
|
11
|
+
const DEFAULT_COLOR = '#000';
|
12
|
+
const DEFAULT_BACKGROUND = '#fff';
|
13
|
+
const DEFAULT_ERROR_CORRECTION = 'L';
|
14
|
+
/**
|
15
|
+
* Represents the Kendo UI QR Code component for Angular.
|
16
|
+
*
|
17
|
+
* @example
|
18
|
+
* ```ts
|
19
|
+
* import { Component } from '@angular/core';
|
20
|
+
*
|
21
|
+
* _@Component({
|
22
|
+
* selector: 'my-app',
|
23
|
+
* template: `
|
24
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui">
|
25
|
+
* </kendo-qrcode>
|
26
|
+
* `
|
27
|
+
* })
|
28
|
+
* export class AppComponent {
|
29
|
+
* }
|
30
|
+
* ```
|
31
|
+
*/
|
32
|
+
export class QRCodeComponent extends BaseComponent {
|
33
|
+
element;
|
34
|
+
renderer;
|
35
|
+
ngZone;
|
36
|
+
/**
|
37
|
+
* The background color of the QR Code. Accepts a valid CSS color string, including hex and rgb.
|
38
|
+
*
|
39
|
+
* @default "white"
|
40
|
+
*
|
41
|
+
* @example
|
42
|
+
* ```ts-preview
|
43
|
+
* import { Component } from '@angular/core';
|
44
|
+
*
|
45
|
+
* _@Component({
|
46
|
+
* selector: 'my-app',
|
47
|
+
* template: `
|
48
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
49
|
+
* background="#fc0">
|
50
|
+
* </kendo-qrcode>
|
51
|
+
* `
|
52
|
+
* })
|
53
|
+
* export class AppComponent {
|
54
|
+
* }
|
55
|
+
* ```
|
56
|
+
*/
|
57
|
+
background;
|
58
|
+
/**
|
59
|
+
* The border of the QR Code.
|
60
|
+
*
|
61
|
+
* @example
|
62
|
+
* ```ts-preview
|
63
|
+
* import { Component } from '@angular/core';
|
64
|
+
* import { Border } from '@progress/kendo-angular-barcodes';
|
65
|
+
*
|
66
|
+
* _@Component({
|
67
|
+
* selector: 'my-app',
|
68
|
+
* template: `
|
69
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
70
|
+
* [border]="qrcodeBorder" [padding]="5">
|
71
|
+
* </kendo-qrcode>
|
72
|
+
* `
|
73
|
+
* })
|
74
|
+
* export class AppComponent {
|
75
|
+
* qrcodeBorder: Border = {
|
76
|
+
* color: '#fc0',
|
77
|
+
* width: 2
|
78
|
+
* };
|
79
|
+
* }
|
80
|
+
* ```
|
81
|
+
*/
|
82
|
+
border;
|
83
|
+
/**
|
84
|
+
* The color of the QR Code. Accepts a valid CSS color string, including hex and rgb.
|
85
|
+
*
|
86
|
+
* @default "black"
|
87
|
+
*
|
88
|
+
* @example
|
89
|
+
* ```ts-preview
|
90
|
+
* _@Component({
|
91
|
+
* selector: 'my-app',
|
92
|
+
* template: `
|
93
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
94
|
+
* color="#fc0">
|
95
|
+
* </kendo-qrcode>
|
96
|
+
* `
|
97
|
+
* })
|
98
|
+
* export class AppComponent {
|
99
|
+
* }
|
100
|
+
* ```
|
101
|
+
*/
|
102
|
+
color;
|
103
|
+
/**
|
104
|
+
* The encoding mode used to encode the value.
|
105
|
+
*
|
106
|
+
* > **Important** The UTF-8 encoding is not included in the specifications and is not supported by all readers.
|
107
|
+
*
|
108
|
+
* The possible values are:
|
109
|
+
* * `"ISO_8859_1"`—Supports all characters from the [ISO/IEC 8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1) character set.
|
110
|
+
* * `"UTF_8"`—Supports all [Unicode](https://en.wikipedia.org/wiki/List_of_Unicode_characters) characters.
|
111
|
+
*
|
112
|
+
* @default "ISO_8859_1"
|
113
|
+
*
|
114
|
+
* @example
|
115
|
+
* ```ts-preview
|
116
|
+
* _@Component({
|
117
|
+
* selector: 'my-app',
|
118
|
+
* template: `
|
119
|
+
* <kendo-qrcode value="АБВ" encoding="UTF_8">
|
120
|
+
* </kendo-qrcode>
|
121
|
+
* `
|
122
|
+
* })
|
123
|
+
* export class AppComponent {
|
124
|
+
* }
|
125
|
+
* ```
|
126
|
+
*/
|
127
|
+
encoding;
|
128
|
+
/**
|
129
|
+
* The error correction level to use.
|
130
|
+
*
|
131
|
+
* The possible values are:
|
132
|
+
* * `"L"`—Approximately 7% of the codewords can be restored.
|
133
|
+
* * `"M"`—Approximately 15% of the codewords can be restored.
|
134
|
+
* * `"Q"`—Approximately 25% of the codewords can be restored.
|
135
|
+
* * `"H"`—Approximately 30% of the codewords can be restored.
|
136
|
+
*
|
137
|
+
* @default "L"
|
138
|
+
*
|
139
|
+
* @example
|
140
|
+
* ```ts-preview
|
141
|
+
* _@Component({
|
142
|
+
* selector: 'my-app',
|
143
|
+
* template: `
|
144
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
145
|
+
* errorCorrection="Q">
|
146
|
+
* </kendo-qrcode>
|
147
|
+
* `
|
148
|
+
* })
|
149
|
+
* export class AppComponent {
|
150
|
+
* }
|
151
|
+
* ```
|
152
|
+
*/
|
153
|
+
errorCorrection;
|
154
|
+
/**
|
155
|
+
* An optional image overlay that will placed over the QR Code.
|
156
|
+
*
|
157
|
+
* > **Note** Always test if the code reads correctly with the applied overlay.
|
158
|
+
* > Depending on the length of the value and the size of the overlay, you might need to raise the `errorCorrection` level to `"M"` or `"H"`.
|
159
|
+
*
|
160
|
+
* @example
|
161
|
+
* ```ts-preview
|
162
|
+
* import { QRCodeOverlay } from '@progress/kendo-angular-barcodes';
|
163
|
+
*
|
164
|
+
* _@Component({
|
165
|
+
* selector: 'my-app',
|
166
|
+
* template: `
|
167
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
168
|
+
* [overlay]="qrcodeOverlay">
|
169
|
+
* </kendo-qrcode>
|
170
|
+
* `
|
171
|
+
* })
|
172
|
+
* export class AppComponent {
|
173
|
+
* qrcodeOverlay: QRCodeOverlay = {
|
174
|
+
* type: 'swiss'
|
175
|
+
* };
|
176
|
+
* }
|
177
|
+
* ```
|
178
|
+
*/
|
179
|
+
overlay;
|
180
|
+
/**
|
181
|
+
* The padding of the QR Code. The value sets all paddings in pixels.
|
182
|
+
*
|
183
|
+
* @default 0
|
184
|
+
*
|
185
|
+
* @example
|
186
|
+
* ```ts-preview
|
187
|
+
* import { Component } from '@angular/core';
|
188
|
+
*
|
189
|
+
* _@Component({
|
190
|
+
* selector: 'my-app',
|
191
|
+
* template: `
|
192
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
193
|
+
* [padding]="10" background="#fc0">
|
194
|
+
* </kendo-qrcode>
|
195
|
+
* `
|
196
|
+
* })
|
197
|
+
* export class AppComponent {
|
198
|
+
* }
|
199
|
+
* ```
|
200
|
+
*/
|
201
|
+
padding;
|
202
|
+
/**
|
203
|
+
* Sets the preferred rendering mode of the QR Code.
|
204
|
+
*
|
205
|
+
* The supported values are:
|
206
|
+
* * `"canvas"`—Renders the component as a Canvas element.
|
207
|
+
* * `"svg"`—Renders the component as an inline SVG document.
|
208
|
+
*
|
209
|
+
* @default "svg"
|
210
|
+
*
|
211
|
+
* @example
|
212
|
+
* ```ts-preview
|
213
|
+
* _@Component({
|
214
|
+
* selector: 'my-app',
|
215
|
+
* template: `
|
216
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
217
|
+
* renderAs="canvas">
|
218
|
+
* </kendo-qrcode>
|
219
|
+
* `
|
220
|
+
* })
|
221
|
+
* export class AppComponent {
|
222
|
+
* }
|
223
|
+
* ```
|
224
|
+
*/
|
225
|
+
renderAs;
|
226
|
+
/**
|
227
|
+
* Specifies the size of a QR Code. Numeric values are treated as pixels.
|
228
|
+
*
|
229
|
+
* If no size is specified, the size will be determined from the element width and height.
|
230
|
+
* If the element has width or height of zero, a default value of 200 pixels will be used.
|
231
|
+
*
|
232
|
+
* @default "200px"
|
233
|
+
*
|
234
|
+
* @example
|
235
|
+
* ```ts-preview
|
236
|
+
* _@Component({
|
237
|
+
* selector: 'my-app',
|
238
|
+
* template: `
|
239
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
240
|
+
* [size]="200">
|
241
|
+
* </kendo-qrcode>
|
242
|
+
*
|
243
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
244
|
+
* [style.width.px]="200" [style.height.px]="200">
|
245
|
+
* </kendo-qrcode>
|
246
|
+
* `
|
247
|
+
* })
|
248
|
+
* export class AppComponent {
|
249
|
+
* }
|
250
|
+
* ```
|
251
|
+
*/
|
252
|
+
size;
|
253
|
+
/**
|
254
|
+
* The value of the QR Code.
|
255
|
+
*
|
256
|
+
* @example
|
257
|
+
* ```ts-preview
|
258
|
+
* _@Component({
|
259
|
+
* selector: 'my-app',
|
260
|
+
* template: `
|
261
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui">
|
262
|
+
* </kendo-qrcode>
|
263
|
+
* `
|
264
|
+
* })
|
265
|
+
* export class AppComponent {
|
266
|
+
* }
|
267
|
+
* ```
|
268
|
+
*/
|
269
|
+
value;
|
270
|
+
/**
|
271
|
+
* Limits the automatic resizing of the QR Code. Sets the maximum number of times per second
|
272
|
+
* that the component redraws its content when the size of its container changes.
|
273
|
+
* Defaults to `10`. To disable the automatic resizing, set it to `0`.
|
274
|
+
*
|
275
|
+
* @example
|
276
|
+
* ```ts
|
277
|
+
* _@Component({
|
278
|
+
* selector: 'my-app',
|
279
|
+
* template: `
|
280
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
281
|
+
* [resizeRateLimit]="2">
|
282
|
+
* </kendo-qrcode>
|
283
|
+
* `
|
284
|
+
* })
|
285
|
+
* export class AppComponent {
|
286
|
+
* }
|
287
|
+
* ```
|
288
|
+
*/
|
289
|
+
resizeRateLimit = 10;
|
290
|
+
get options() {
|
291
|
+
return {
|
292
|
+
background: this.background || DEFAULT_BACKGROUND,
|
293
|
+
border: this.border,
|
294
|
+
color: this.color || DEFAULT_COLOR,
|
295
|
+
encoding: this.encoding,
|
296
|
+
errorCorrection: this.errorCorrection || DEFAULT_ERROR_CORRECTION,
|
297
|
+
overlay: this.overlay || {},
|
298
|
+
padding: this.padding,
|
299
|
+
renderAs: this.renderAs,
|
300
|
+
size: this.size,
|
301
|
+
value: this.value
|
302
|
+
};
|
303
|
+
}
|
304
|
+
constructor(element, renderer, ngZone) {
|
305
|
+
super(element, renderer, ngZone);
|
306
|
+
this.element = element;
|
307
|
+
this.renderer = renderer;
|
308
|
+
this.ngZone = ngZone;
|
309
|
+
}
|
310
|
+
createInstance(element, options) {
|
311
|
+
return new QRCode(element, options, this.onError.bind(this));
|
312
|
+
}
|
313
|
+
onError(error) {
|
314
|
+
error.name = packageMetadata.productName + ' QRCode';
|
315
|
+
if (this.isDevMode()) {
|
316
|
+
throw error;
|
317
|
+
}
|
318
|
+
else {
|
319
|
+
console.warn(error);
|
320
|
+
}
|
321
|
+
}
|
322
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: QRCodeComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
323
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: QRCodeComponent, isStandalone: true, selector: "kendo-qrcode", inputs: { background: "background", border: "border", color: "color", encoding: "encoding", errorCorrection: "errorCorrection", overlay: "overlay", padding: "padding", renderAs: "renderAs", size: "size", value: "value", resizeRateLimit: "resizeRateLimit" }, exportAs: ["kendoQRCode"], usesInheritance: true, ngImport: i0, template: `
|
324
|
+
<kendo-resize-sensor (resize)="onResize()" [rateLimit]="resizeRateLimit"></kendo-resize-sensor>
|
325
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
326
|
+
}
|
327
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: QRCodeComponent, decorators: [{
|
328
|
+
type: Component,
|
329
|
+
args: [{
|
330
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
331
|
+
selector: 'kendo-qrcode',
|
332
|
+
exportAs: 'kendoQRCode',
|
333
|
+
template: `
|
334
|
+
<kendo-resize-sensor (resize)="onResize()" [rateLimit]="resizeRateLimit"></kendo-resize-sensor>
|
335
|
+
`,
|
336
|
+
standalone: true,
|
337
|
+
imports: [ResizeSensorComponent]
|
338
|
+
}]
|
339
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { background: [{
|
340
|
+
type: Input
|
341
|
+
}], border: [{
|
342
|
+
type: Input
|
343
|
+
}], color: [{
|
344
|
+
type: Input
|
345
|
+
}], encoding: [{
|
346
|
+
type: Input
|
347
|
+
}], errorCorrection: [{
|
348
|
+
type: Input
|
349
|
+
}], overlay: [{
|
350
|
+
type: Input
|
351
|
+
}], padding: [{
|
352
|
+
type: Input
|
353
|
+
}], renderAs: [{
|
354
|
+
type: Input
|
355
|
+
}], size: [{
|
356
|
+
type: Input
|
357
|
+
}], value: [{
|
358
|
+
type: Input
|
359
|
+
}], resizeRateLimit: [{
|
360
|
+
type: Input
|
361
|
+
}] } });
|
@@ -40,11 +40,11 @@ import * as i1 from "./qrcode.component";
|
|
40
40
|
* ```
|
41
41
|
*/
|
42
42
|
export class QRCodeModule {
|
43
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: QRCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
44
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: QRCodeModule, imports: [i1.QRCodeComponent], exports: [i1.QRCodeComponent] });
|
45
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: QRCodeModule, providers: [ResizeBatchService], imports: [KENDO_QRCODE] });
|
43
46
|
}
|
44
|
-
|
45
|
-
QRCodeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: QRCodeModule, imports: [i1.QRCodeComponent], exports: [i1.QRCodeComponent] });
|
46
|
-
QRCodeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QRCodeModule, providers: [ResizeBatchService], imports: [KENDO_QRCODE] });
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QRCodeModule, decorators: [{
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: QRCodeModule, decorators: [{
|
48
48
|
type: NgModule,
|
49
49
|
args: [{
|
50
50
|
imports: [...KENDO_QRCODE],
|