@progress/kendo-angular-barcodes 1.0.0-next.202203150945 → 1.0.0
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/dist/cdn/js/kendo-angular-barcodes.js +20 -0
- package/dist/cdn/main.js +5 -0
- package/dist/es/barcode-validator.js +51 -0
- package/dist/es/barcode.component.js +149 -0
- package/dist/es/barcode.module.js +52 -0
- package/dist/es/barcodes.module.js +50 -0
- package/dist/es/base.component.js +117 -0
- package/dist/es/chart-types/barcode-types.js +4 -0
- package/dist/es/chart-types/field-types.js +4 -0
- package/dist/es/chart-types/qrcode-types.js +4 -0
- package/dist/es/chart-types.js +4 -0
- package/dist/es/index.js +9 -0
- package/dist/es/main.js +11 -0
- package/dist/es/package-metadata.js +15 -0
- package/dist/es/qrcode-validator.js +45 -0
- package/dist/es/qrcode.component.js +147 -0
- package/dist/es/qrcode.module.js +52 -0
- package/dist/es2015/barcode-validator.d.ts +29 -0
- package/dist/es2015/barcode-validator.js +51 -0
- package/dist/es2015/barcode.component.d.ts +312 -0
- package/dist/es2015/barcode.component.js +144 -0
- package/dist/es2015/barcode.module.d.ts +37 -0
- package/dist/es2015/barcode.module.js +49 -0
- package/dist/es2015/barcodes.module.d.ts +37 -0
- package/dist/es2015/barcodes.module.js +47 -0
- package/dist/es2015/base.component.d.ts +55 -0
- package/dist/es2015/base.component.js +105 -0
- package/dist/es2015/chart-types/barcode-types.d.ts +109 -0
- package/dist/es2015/chart-types/barcode-types.js +4 -0
- package/dist/es2015/chart-types/field-types.d.ts +75 -0
- package/dist/es2015/chart-types/field-types.js +4 -0
- package/dist/es2015/chart-types/qrcode-types.d.ts +124 -0
- package/dist/es2015/chart-types/qrcode-types.js +4 -0
- package/dist/es2015/chart-types.d.ts +7 -0
- package/dist/es2015/chart-types.js +4 -0
- package/dist/es2015/index.d.ts +9 -0
- package/dist/es2015/index.js +9 -0
- package/dist/es2015/index.metadata.json +1 -0
- package/dist/es2015/main.d.ts +12 -0
- package/dist/es2015/main.js +11 -0
- package/dist/es2015/package-metadata.d.ts +9 -0
- package/dist/es2015/package-metadata.js +15 -0
- package/dist/es2015/qrcode-validator.d.ts +27 -0
- package/dist/es2015/qrcode-validator.js +44 -0
- package/dist/es2015/qrcode.component.d.ts +289 -0
- package/dist/es2015/qrcode.component.js +142 -0
- package/dist/es2015/qrcode.module.d.ts +37 -0
- package/dist/es2015/qrcode.module.js +49 -0
- package/dist/fesm2015/index.js +598 -0
- package/dist/fesm5/index.js +629 -0
- package/dist/npm/barcode-validator.js +53 -0
- package/dist/npm/barcode.component.js +151 -0
- package/dist/npm/barcode.module.js +54 -0
- package/dist/npm/barcodes.module.js +52 -0
- package/dist/npm/base.component.js +119 -0
- package/dist/npm/chart-types/barcode-types.js +6 -0
- package/dist/npm/chart-types/field-types.js +6 -0
- package/dist/npm/chart-types/qrcode-types.js +6 -0
- package/dist/npm/chart-types.js +6 -0
- package/dist/npm/index.js +13 -0
- package/dist/npm/main.js +20 -0
- package/dist/npm/package-metadata.js +17 -0
- package/dist/npm/qrcode-validator.js +47 -0
- package/dist/npm/qrcode.component.js +149 -0
- package/dist/npm/qrcode.module.js +54 -0
- package/dist/systemjs/kendo-angular-barcodes.js +5 -0
- package/package.json +100 -33
- package/schematics/ngAdd/index.js +2 -5
- package/schematics/ngAdd/index.js.map +1 -1
- package/bundles/kendo-angular-barcodes.umd.js +0 -5
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { ChangeDetectionStrategy, Component, ElementRef, Input, NgZone, Renderer2 } from '@angular/core';
|
|
7
|
+
import { QRCode } from '@progress/kendo-charts';
|
|
8
|
+
import { BaseComponent } from './base.component';
|
|
9
|
+
import { packageMetadata } from './package-metadata';
|
|
10
|
+
var DEFAULT_COLOR = '#000';
|
|
11
|
+
var DEFAULT_BACKGROUND = '#fff';
|
|
12
|
+
var DEFAULT_ERROR_CORRECTION = 'L';
|
|
13
|
+
/**
|
|
14
|
+
* Represents the Kendo UI QR Code component for Angular.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { Component } from '@angular/core';
|
|
19
|
+
*
|
|
20
|
+
* _@Component({
|
|
21
|
+
* selector: 'my-app',
|
|
22
|
+
* template: `
|
|
23
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui">
|
|
24
|
+
* </kendo-qrcode>
|
|
25
|
+
* `
|
|
26
|
+
* })
|
|
27
|
+
* export class AppComponent {
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
var QRCodeComponent = /** @class */ (function (_super) {
|
|
32
|
+
tslib_1.__extends(QRCodeComponent, _super);
|
|
33
|
+
function QRCodeComponent(element, renderer, ngZone) {
|
|
34
|
+
var _this = _super.call(this, element, renderer, ngZone) || this;
|
|
35
|
+
_this.element = element;
|
|
36
|
+
_this.renderer = renderer;
|
|
37
|
+
_this.ngZone = ngZone;
|
|
38
|
+
/**
|
|
39
|
+
* Limits the automatic resizing of the QR Code. Sets the maximum number of times per second
|
|
40
|
+
* that the component redraws its content when the size of its container changes.
|
|
41
|
+
* Defaults to `10`. To disable the automatic resizing, set it to `0`.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* _@Component({
|
|
46
|
+
* selector: 'my-app',
|
|
47
|
+
* template: `
|
|
48
|
+
* <kendo-qrcode value="https://www.telerik.com/kendo-angular-ui"
|
|
49
|
+
* [resizeRateLimit]="2">
|
|
50
|
+
* </kendo-qrcode>
|
|
51
|
+
* `
|
|
52
|
+
* })
|
|
53
|
+
* export class AppComponent {
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
_this.resizeRateLimit = 10;
|
|
58
|
+
return _this;
|
|
59
|
+
}
|
|
60
|
+
Object.defineProperty(QRCodeComponent.prototype, "options", {
|
|
61
|
+
get: function () {
|
|
62
|
+
return {
|
|
63
|
+
background: this.background || DEFAULT_BACKGROUND,
|
|
64
|
+
border: this.border,
|
|
65
|
+
color: this.color || DEFAULT_COLOR,
|
|
66
|
+
encoding: this.encoding,
|
|
67
|
+
errorCorrection: this.errorCorrection || DEFAULT_ERROR_CORRECTION,
|
|
68
|
+
overlay: this.overlay || {},
|
|
69
|
+
padding: this.padding,
|
|
70
|
+
renderAs: this.renderAs,
|
|
71
|
+
size: this.size,
|
|
72
|
+
value: this.value
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
enumerable: true,
|
|
76
|
+
configurable: true
|
|
77
|
+
});
|
|
78
|
+
QRCodeComponent.prototype.createInstance = function (element, options) {
|
|
79
|
+
return new QRCode(element, options, this.onError.bind(this));
|
|
80
|
+
};
|
|
81
|
+
QRCodeComponent.prototype.onError = function (error) {
|
|
82
|
+
error.name = packageMetadata.productName + ' QRCode';
|
|
83
|
+
if (this.isDevMode()) {
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
console.warn(error);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
tslib_1.__decorate([
|
|
91
|
+
Input(),
|
|
92
|
+
tslib_1.__metadata("design:type", String)
|
|
93
|
+
], QRCodeComponent.prototype, "background", void 0);
|
|
94
|
+
tslib_1.__decorate([
|
|
95
|
+
Input(),
|
|
96
|
+
tslib_1.__metadata("design:type", Object)
|
|
97
|
+
], QRCodeComponent.prototype, "border", void 0);
|
|
98
|
+
tslib_1.__decorate([
|
|
99
|
+
Input(),
|
|
100
|
+
tslib_1.__metadata("design:type", String)
|
|
101
|
+
], QRCodeComponent.prototype, "color", void 0);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
Input(),
|
|
104
|
+
tslib_1.__metadata("design:type", String)
|
|
105
|
+
], QRCodeComponent.prototype, "encoding", void 0);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
Input(),
|
|
108
|
+
tslib_1.__metadata("design:type", String)
|
|
109
|
+
], QRCodeComponent.prototype, "errorCorrection", void 0);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
Input(),
|
|
112
|
+
tslib_1.__metadata("design:type", Object)
|
|
113
|
+
], QRCodeComponent.prototype, "overlay", void 0);
|
|
114
|
+
tslib_1.__decorate([
|
|
115
|
+
Input(),
|
|
116
|
+
tslib_1.__metadata("design:type", Number)
|
|
117
|
+
], QRCodeComponent.prototype, "padding", void 0);
|
|
118
|
+
tslib_1.__decorate([
|
|
119
|
+
Input(),
|
|
120
|
+
tslib_1.__metadata("design:type", String)
|
|
121
|
+
], QRCodeComponent.prototype, "renderAs", void 0);
|
|
122
|
+
tslib_1.__decorate([
|
|
123
|
+
Input(),
|
|
124
|
+
tslib_1.__metadata("design:type", Object)
|
|
125
|
+
], QRCodeComponent.prototype, "size", void 0);
|
|
126
|
+
tslib_1.__decorate([
|
|
127
|
+
Input(),
|
|
128
|
+
tslib_1.__metadata("design:type", Object)
|
|
129
|
+
], QRCodeComponent.prototype, "value", void 0);
|
|
130
|
+
tslib_1.__decorate([
|
|
131
|
+
Input(),
|
|
132
|
+
tslib_1.__metadata("design:type", Number)
|
|
133
|
+
], QRCodeComponent.prototype, "resizeRateLimit", void 0);
|
|
134
|
+
QRCodeComponent = tslib_1.__decorate([
|
|
135
|
+
Component({
|
|
136
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
137
|
+
selector: 'kendo-qrcode',
|
|
138
|
+
exportAs: 'kendoQRCode',
|
|
139
|
+
template: "\n <kendo-resize-sensor (resize)=\"onResize()\" [rateLimit]=\"resizeRateLimit\"></kendo-resize-sensor>\n "
|
|
140
|
+
}),
|
|
141
|
+
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
142
|
+
Renderer2,
|
|
143
|
+
NgZone])
|
|
144
|
+
], QRCodeComponent);
|
|
145
|
+
return QRCodeComponent;
|
|
146
|
+
}(BaseComponent));
|
|
147
|
+
export { QRCodeComponent };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { NgModule } from '@angular/core';
|
|
7
|
+
import { ResizeSensorModule } from '@progress/kendo-angular-common';
|
|
8
|
+
import { QRCodeComponent } from './qrcode.component';
|
|
9
|
+
/**
|
|
10
|
+
* Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
|
|
11
|
+
* definition for the QR Code component.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* ```ts-no-run
|
|
16
|
+
* // Import the QR Code module
|
|
17
|
+
* import { QRCodeModule } from '@progress/kendo-angular-barcodes';
|
|
18
|
+
*
|
|
19
|
+
* // The browser platform with a compiler
|
|
20
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
21
|
+
*
|
|
22
|
+
* import { NgModule } from '@angular/core';
|
|
23
|
+
*
|
|
24
|
+
* // Import the app component
|
|
25
|
+
* import { AppComponent } from './app.component';
|
|
26
|
+
*
|
|
27
|
+
* // Define the app module
|
|
28
|
+
* _@NgModule({
|
|
29
|
+
* declarations: [AppComponent], // declare app component
|
|
30
|
+
* imports: [BrowserModule, QRCodeModule], // import QRCodeModule module
|
|
31
|
+
* bootstrap: [AppComponent]
|
|
32
|
+
* })
|
|
33
|
+
* export class AppModule {}
|
|
34
|
+
*
|
|
35
|
+
* // Compile and launch the module
|
|
36
|
+
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
37
|
+
*
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
var QRCodeModule = /** @class */ (function () {
|
|
41
|
+
function QRCodeModule() {
|
|
42
|
+
}
|
|
43
|
+
QRCodeModule = tslib_1.__decorate([
|
|
44
|
+
NgModule({
|
|
45
|
+
declarations: [QRCodeComponent],
|
|
46
|
+
imports: [ResizeSensorModule],
|
|
47
|
+
exports: [QRCodeComponent]
|
|
48
|
+
})
|
|
49
|
+
], QRCodeModule);
|
|
50
|
+
return QRCodeModule;
|
|
51
|
+
}());
|
|
52
|
+
export { QRCodeModule };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ValidatorFn } from '@angular/forms';
|
|
6
|
+
import { geometry } from '@progress/kendo-drawing';
|
|
7
|
+
import { BarcodeType } from './chart-types';
|
|
8
|
+
/**
|
|
9
|
+
* Creates a value validator for a particular Barcode type.
|
|
10
|
+
*
|
|
11
|
+
* @param {BarcodeType} type The type of the Barcode.
|
|
12
|
+
* @param {Size} size The size of the barcode, excluding the text label, padding and border. Optional.
|
|
13
|
+
* @returns {ValidatorFn} A validator function that returns an error map with the `barcode` property if the validation check fails, otherwise `null`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts-no-run
|
|
17
|
+
* const control = new FormControl('1234', createBarcodeValidator('EAN8'));
|
|
18
|
+
* console.log(control.errors);
|
|
19
|
+
*
|
|
20
|
+
* // {
|
|
21
|
+
* // barcode: {
|
|
22
|
+
* // message: 'The value of the "EAN13" encoding should be 12 symbols',
|
|
23
|
+
* // value: '1234',
|
|
24
|
+
* // type: 'EAN13'
|
|
25
|
+
* // }
|
|
26
|
+
* // }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const createBarcodeValidator: (type: BarcodeType, size?: geometry.Size) => ValidatorFn;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { barcodeValidator } from '@progress/kendo-charts';
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
const isPresent = (value) => value !== null && value !== undefined;
|
|
10
|
+
const ɵ0 = isPresent;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a value validator for a particular Barcode type.
|
|
13
|
+
*
|
|
14
|
+
* @param {BarcodeType} type The type of the Barcode.
|
|
15
|
+
* @param {Size} size The size of the barcode, excluding the text label, padding and border. Optional.
|
|
16
|
+
* @returns {ValidatorFn} A validator function that returns an error map with the `barcode` property if the validation check fails, otherwise `null`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts-no-run
|
|
20
|
+
* const control = new FormControl('1234', createBarcodeValidator('EAN8'));
|
|
21
|
+
* console.log(control.errors);
|
|
22
|
+
*
|
|
23
|
+
* // {
|
|
24
|
+
* // barcode: {
|
|
25
|
+
* // message: 'The value of the "EAN13" encoding should be 12 symbols',
|
|
26
|
+
* // value: '1234',
|
|
27
|
+
* // type: 'EAN13'
|
|
28
|
+
* // }
|
|
29
|
+
* // }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const createBarcodeValidator = (type, size) => {
|
|
33
|
+
const validator = barcodeValidator(type, size);
|
|
34
|
+
return (control) => {
|
|
35
|
+
if (!isPresent(control.value) || control.value === '') {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const result = validator(control.value);
|
|
39
|
+
if (result.valid === true) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
barcode: {
|
|
44
|
+
message: result.error.message,
|
|
45
|
+
value: control.value,
|
|
46
|
+
type: type
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export { ɵ0 };
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ElementRef, NgZone, Renderer2 } from '@angular/core';
|
|
6
|
+
import { Barcode, BarcodeOptions } from '@progress/kendo-charts';
|
|
7
|
+
import { BaseComponent } from './base.component';
|
|
8
|
+
import { BarcodeText, BarcodeType, Border, Padding, RenderMode } from './chart-types';
|
|
9
|
+
/**
|
|
10
|
+
* Represents the Kendo UI Barcode component for Angular.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { Component } from '@angular/core';
|
|
15
|
+
*
|
|
16
|
+
* _@Component({
|
|
17
|
+
* selector: 'my-app',
|
|
18
|
+
* template: `
|
|
19
|
+
* <kendo-barcode type="EAN8" value="1234567">
|
|
20
|
+
* </kendo-barcode>
|
|
21
|
+
* `
|
|
22
|
+
* })
|
|
23
|
+
* export class AppComponent {
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class BarcodeComponent extends BaseComponent {
|
|
28
|
+
protected element: ElementRef;
|
|
29
|
+
protected renderer: Renderer2;
|
|
30
|
+
protected ngZone: NgZone;
|
|
31
|
+
/**
|
|
32
|
+
* The background color of the Barcode. Accepts a valid CSS color string, including hex and rgb.
|
|
33
|
+
*
|
|
34
|
+
* @default "white"
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts-preview
|
|
38
|
+
* import { Component } from '@angular/core';
|
|
39
|
+
*
|
|
40
|
+
* _@Component({
|
|
41
|
+
* selector: 'my-app',
|
|
42
|
+
* template: `
|
|
43
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
44
|
+
* background="#fc0">
|
|
45
|
+
* </kendo-barcode>
|
|
46
|
+
* `
|
|
47
|
+
* })
|
|
48
|
+
* export class AppComponent {
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
background?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The border of the Barcode.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts-preview
|
|
58
|
+
* import { Component } from '@angular/core';
|
|
59
|
+
* import { Border } from '@progress/kendo-angular-barcodes';
|
|
60
|
+
*
|
|
61
|
+
* _@Component({
|
|
62
|
+
* selector: 'my-app',
|
|
63
|
+
* template: `
|
|
64
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
65
|
+
* [border]="barcodeBorder" [padding]="5">
|
|
66
|
+
* </kendo-barcode>
|
|
67
|
+
* `
|
|
68
|
+
* })
|
|
69
|
+
* export class AppComponent {
|
|
70
|
+
* barcodeBorder: Border = {
|
|
71
|
+
* color: '#fc0',
|
|
72
|
+
* width: 2
|
|
73
|
+
* };
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
border?: Border;
|
|
78
|
+
/**
|
|
79
|
+
* If set to `true`, the Barcode will display the checksum digit next to the value in the text area.
|
|
80
|
+
*
|
|
81
|
+
* @default false
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts-preview
|
|
85
|
+
* _@Component({
|
|
86
|
+
* selector: 'my-app',
|
|
87
|
+
* template: `
|
|
88
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
89
|
+
* [checksum]="true">
|
|
90
|
+
* </kendo-barcode>
|
|
91
|
+
* `
|
|
92
|
+
* })
|
|
93
|
+
* export class AppComponent {
|
|
94
|
+
* }
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
checksum?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* The color of the Barcode. Accepts a valid CSS color string, including hex and rgb.
|
|
100
|
+
*
|
|
101
|
+
* @default "black"
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts-preview
|
|
105
|
+
* _@Component({
|
|
106
|
+
* selector: 'my-app',
|
|
107
|
+
* template: `
|
|
108
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
109
|
+
* color="#fc0">
|
|
110
|
+
* </kendo-barcode>
|
|
111
|
+
* `
|
|
112
|
+
* })
|
|
113
|
+
* export class AppComponent {
|
|
114
|
+
* }
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
color?: string;
|
|
118
|
+
/**
|
|
119
|
+
* The height of the Barcode in pixels.
|
|
120
|
+
*
|
|
121
|
+
* The Barcode dimensions can also be set through regular CSS styling.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts-preview
|
|
125
|
+
* _@Component({
|
|
126
|
+
* selector: 'my-app',
|
|
127
|
+
* template: `
|
|
128
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
129
|
+
* [width]="200" [height]="100">
|
|
130
|
+
* </kendo-barcode>
|
|
131
|
+
*
|
|
132
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
133
|
+
* style="width: 200px; height: 100px;">
|
|
134
|
+
* </kendo-barcode>
|
|
135
|
+
* `
|
|
136
|
+
* })
|
|
137
|
+
* export class AppComponent {
|
|
138
|
+
* }
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
height?: number;
|
|
142
|
+
/**
|
|
143
|
+
* The padding of the Barcode. A numeric value sets all paddings.
|
|
144
|
+
*
|
|
145
|
+
* @default 0
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts-preview
|
|
149
|
+
* import { Component } from '@angular/core';
|
|
150
|
+
* import { Padding } from '@progress/kendo-angular-barcodes';
|
|
151
|
+
*
|
|
152
|
+
* _@Component({
|
|
153
|
+
* selector: 'my-app',
|
|
154
|
+
* template: `
|
|
155
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
156
|
+
* [padding]="5" background="#fc0">
|
|
157
|
+
* </kendo-barcode>
|
|
158
|
+
*
|
|
159
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
160
|
+
* [padding]="barcodePadding" background="#cf0">
|
|
161
|
+
* </kendo-barcode>
|
|
162
|
+
* `
|
|
163
|
+
* })
|
|
164
|
+
* export class AppComponent {
|
|
165
|
+
* barcodePadding: Padding = {
|
|
166
|
+
* top: 20,
|
|
167
|
+
* bottom: 10,
|
|
168
|
+
* left: 5,
|
|
169
|
+
* right: 5
|
|
170
|
+
* };
|
|
171
|
+
* }
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
padding?: Padding | number;
|
|
175
|
+
/**
|
|
176
|
+
* Sets the preferred rendering mode of the Barcode.
|
|
177
|
+
*
|
|
178
|
+
* The supported values are:
|
|
179
|
+
* * `"canvas"`—Renders the component as a Canvas element.
|
|
180
|
+
* * `"svg"`—Renders the component as an inline SVG document.
|
|
181
|
+
*
|
|
182
|
+
* @default "svg"
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```ts-preview
|
|
186
|
+
* _@Component({
|
|
187
|
+
* selector: 'my-app',
|
|
188
|
+
* template: `
|
|
189
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
190
|
+
* renderAs="canvas">
|
|
191
|
+
* </kendo-barcode>
|
|
192
|
+
* `
|
|
193
|
+
* })
|
|
194
|
+
* export class AppComponent {
|
|
195
|
+
* }
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
renderAs?: RenderMode;
|
|
199
|
+
/**
|
|
200
|
+
* The Barcode text label configuration.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```ts-preview
|
|
204
|
+
* import { Component } from '@angular/core';
|
|
205
|
+
* import { BarcodeText } from '@progress/kendo-angular-barcodes';
|
|
206
|
+
*
|
|
207
|
+
* _@Component({
|
|
208
|
+
* selector: 'my-app',
|
|
209
|
+
* template: `
|
|
210
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
211
|
+
* [text]="barcodeText">
|
|
212
|
+
* </kendo-barcode>
|
|
213
|
+
* `
|
|
214
|
+
* })
|
|
215
|
+
* export class AppComponent {
|
|
216
|
+
* barcodeText: BarcodeText = {
|
|
217
|
+
* color: '#fc0',
|
|
218
|
+
* font: '20px monospace'
|
|
219
|
+
* };
|
|
220
|
+
* }
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
text?: BarcodeText;
|
|
224
|
+
/**
|
|
225
|
+
* The symbology (encoding) the Barcode will use.
|
|
226
|
+
*
|
|
227
|
+
* @default "Code39"
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```ts-preview
|
|
231
|
+
* import { Component } from '@angular/core';
|
|
232
|
+
*
|
|
233
|
+
* _@Component({
|
|
234
|
+
* selector: 'my-app',
|
|
235
|
+
* template: `
|
|
236
|
+
* <kendo-barcode type="EAN13" value="123456789987">
|
|
237
|
+
* </kendo-barcode>
|
|
238
|
+
* `
|
|
239
|
+
* })
|
|
240
|
+
* export class AppComponent {
|
|
241
|
+
* }
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
type: BarcodeType;
|
|
245
|
+
/**
|
|
246
|
+
* The value of the Barcode.
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```ts-preview
|
|
250
|
+
* import { Component } from '@angular/core';
|
|
251
|
+
*
|
|
252
|
+
* _@Component({
|
|
253
|
+
* selector: 'my-app',
|
|
254
|
+
* template: `
|
|
255
|
+
* <kendo-barcode type="EAN13" value="123456789987">
|
|
256
|
+
* </kendo-barcode>
|
|
257
|
+
* `
|
|
258
|
+
* })
|
|
259
|
+
* export class AppComponent {
|
|
260
|
+
* }
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
263
|
+
value: number | string;
|
|
264
|
+
/**
|
|
265
|
+
* The width of the Barcode in pixels.
|
|
266
|
+
*
|
|
267
|
+
* The Barcode dimensions can also be set through regular CSS styling.
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* ```ts-preview
|
|
271
|
+
* _@Component({
|
|
272
|
+
* selector: 'my-app',
|
|
273
|
+
* template: `
|
|
274
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
275
|
+
* [width]="200" [height]="100">
|
|
276
|
+
* </kendo-barcode>
|
|
277
|
+
*
|
|
278
|
+
* <kendo-barcode type="EAN8" value="1234567"
|
|
279
|
+
* style="width: 200px; height: 100px;">
|
|
280
|
+
* </kendo-barcode>
|
|
281
|
+
* `
|
|
282
|
+
* })
|
|
283
|
+
* export class AppComponent {
|
|
284
|
+
* }
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
width?: number;
|
|
288
|
+
/**
|
|
289
|
+
* Limits the automatic resizing of the Barcode. Sets the maximum number of times per second
|
|
290
|
+
* that the component redraws its content when the size of its container changes.
|
|
291
|
+
* Defaults to `10`. To disable the automatic resizing, set it to `0`.
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```ts
|
|
295
|
+
* _@Component({
|
|
296
|
+
* selector: 'my-app',
|
|
297
|
+
* template: `
|
|
298
|
+
* <kendo-barcode type="EAN8" [value]="1234567"
|
|
299
|
+
* [resizeRateLimit]="2">
|
|
300
|
+
* </kendo-barcode>
|
|
301
|
+
* `
|
|
302
|
+
* })
|
|
303
|
+
* export class AppComponent {
|
|
304
|
+
* }
|
|
305
|
+
* ```
|
|
306
|
+
*/
|
|
307
|
+
resizeRateLimit: number;
|
|
308
|
+
protected readonly options: BarcodeOptions;
|
|
309
|
+
constructor(element: ElementRef, renderer: Renderer2, ngZone: NgZone);
|
|
310
|
+
protected createInstance(element: any, options: any): Barcode;
|
|
311
|
+
protected onError(error: Error): void;
|
|
312
|
+
}
|