@progress/kendo-angular-barcodes 1.0.0 → 2.0.0-dev.202204131407

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.
Files changed (70) hide show
  1. package/{dist/es2015/barcode-validator.d.ts → barcode-validator.d.ts} +0 -0
  2. package/{dist/es2015/barcode.component.d.ts → barcode.component.d.ts} +4 -1
  3. package/{dist/es2015/barcode.module.d.ts → barcode.module.d.ts} +6 -0
  4. package/{dist/es2015/barcodes.module.d.ts → barcodes.module.d.ts} +6 -0
  5. package/{dist/es2015/base.component.d.ts → base.component.d.ts} +6 -3
  6. package/bundles/kendo-angular-barcodes.umd.js +5 -0
  7. package/{dist/es2015/chart-types → chart-types}/barcode-types.d.ts +0 -0
  8. package/{dist/es2015/chart-types → chart-types}/field-types.d.ts +0 -0
  9. package/{dist/es2015/chart-types → chart-types}/qrcode-types.d.ts +0 -0
  10. package/{dist/es2015/chart-types.d.ts → chart-types.d.ts} +0 -0
  11. package/{dist/es2015 → esm2015}/barcode-validator.js +0 -2
  12. package/{dist/es2015 → esm2015}/barcode.component.js +42 -64
  13. package/{dist/es → esm2015}/barcode.module.js +14 -14
  14. package/{dist/es → esm2015}/barcodes.module.js +12 -12
  15. package/{dist/es2015 → esm2015}/base.component.js +12 -10
  16. package/{dist/es2015 → esm2015}/chart-types/barcode-types.js +1 -0
  17. package/{dist/es2015 → esm2015}/chart-types/field-types.js +1 -0
  18. package/{dist/es2015 → esm2015}/chart-types/qrcode-types.js +1 -0
  19. package/{dist/es → esm2015}/chart-types.js +3 -0
  20. package/{dist/es/index.js → esm2015/kendo-angular-barcodes.js} +0 -1
  21. package/{dist/es2015/main.d.ts → esm2015/main.js} +0 -0
  22. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  23. package/{dist/es2015 → esm2015}/qrcode-validator.js +0 -0
  24. package/{dist/es2015 → esm2015}/qrcode.component.js +40 -60
  25. package/{dist/es2015 → esm2015}/qrcode.module.js +14 -11
  26. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-barcodes.js} +129 -155
  27. package/{dist/es2015/index.d.ts → kendo-angular-barcodes.d.ts} +1 -1
  28. package/{dist/es/main.js → main.d.ts} +1 -0
  29. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  30. package/package.json +30 -101
  31. package/{dist/es2015/qrcode-validator.d.ts → qrcode-validator.d.ts} +0 -0
  32. package/{dist/es2015/qrcode.component.d.ts → qrcode.component.d.ts} +4 -1
  33. package/{dist/es2015/qrcode.module.d.ts → qrcode.module.d.ts} +6 -0
  34. package/schematics/ngAdd/index.js +5 -2
  35. package/schematics/ngAdd/index.js.map +1 -1
  36. package/dist/cdn/js/kendo-angular-barcodes.js +0 -20
  37. package/dist/cdn/main.js +0 -5
  38. package/dist/es/barcode-validator.js +0 -51
  39. package/dist/es/barcode.component.js +0 -149
  40. package/dist/es/base.component.js +0 -117
  41. package/dist/es/chart-types/barcode-types.js +0 -4
  42. package/dist/es/chart-types/field-types.js +0 -4
  43. package/dist/es/chart-types/qrcode-types.js +0 -4
  44. package/dist/es/package-metadata.js +0 -15
  45. package/dist/es/qrcode-validator.js +0 -45
  46. package/dist/es/qrcode.component.js +0 -147
  47. package/dist/es/qrcode.module.js +0 -52
  48. package/dist/es2015/barcode.module.js +0 -49
  49. package/dist/es2015/barcodes.module.js +0 -47
  50. package/dist/es2015/chart-types.js +0 -4
  51. package/dist/es2015/index.js +0 -9
  52. package/dist/es2015/index.metadata.json +0 -1
  53. package/dist/es2015/main.js +0 -11
  54. package/dist/fesm5/index.js +0 -629
  55. package/dist/npm/barcode-validator.js +0 -53
  56. package/dist/npm/barcode.component.js +0 -151
  57. package/dist/npm/barcode.module.js +0 -54
  58. package/dist/npm/barcodes.module.js +0 -52
  59. package/dist/npm/base.component.js +0 -119
  60. package/dist/npm/chart-types/barcode-types.js +0 -6
  61. package/dist/npm/chart-types/field-types.js +0 -6
  62. package/dist/npm/chart-types/qrcode-types.js +0 -6
  63. package/dist/npm/chart-types.js +0 -6
  64. package/dist/npm/index.js +0 -13
  65. package/dist/npm/main.js +0 -20
  66. package/dist/npm/package-metadata.js +0 -17
  67. package/dist/npm/qrcode-validator.js +0 -47
  68. package/dist/npm/qrcode.component.js +0 -149
  69. package/dist/npm/qrcode.module.js +0 -54
  70. package/dist/systemjs/kendo-angular-barcodes.js +0 -5
package/dist/cdn/main.js DELETED
@@ -1,5 +0,0 @@
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
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("tslib"),require("@angular/core"),require("@progress/kendo-charts"),require("@progress/kendo-angular-common"),require("@progress/kendo-drawing"),require("@progress/kendo-licensing")):"function"==typeof define&&define.amd?define([,,,,,],t):"object"==typeof exports?exports.KendoAngularBarcodes=t(require("tslib"),require("@angular/core"),require("@progress/kendo-charts"),require("@progress/kendo-angular-common"),require("@progress/kendo-drawing"),require("@progress/kendo-licensing")):e.KendoAngularBarcodes=t(e.self,e.ng.core,e.KendoCharts,e.KendoAngularCommon,e.KendoDrawing,e.KendoLicensing)}(window,(function(e,t,o,r,n,i){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=10)}([function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t){e.exports=o},function(e,t){e.exports=r},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata={name:"@progress/kendo-angular-barcodes",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1648115793,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(0),n=o(1),i=o(2),a=o(6),d=o(4),s=function(e){function t(t,o,r){var n=e.call(this,t,o,r)||this;return n.element=t,n.renderer=o,n.ngZone=r,n.resizeRateLimit=10,n}return r.__extends(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return{renderAs:this.renderAs,background:this.background,border:this.border,checksum:this.checksum,color:this.color,height:this.height,padding:this.padding,text:this.text,type:this.type,value:this.value,width:this.width}},enumerable:!0,configurable:!0}),t.prototype.createInstance=function(e,t){return new i.Barcode(e,t,this.onError.bind(this))},t.prototype.onError=function(e){if(e.name=d.packageMetadata.productName+" Barcode",this.isDevMode())throw e;console.warn(e)},r.__decorate([n.Input(),r.__metadata("design:type",String)],t.prototype,"background",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Object)],t.prototype,"border",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Boolean)],t.prototype,"checksum",void 0),r.__decorate([n.Input(),r.__metadata("design:type",String)],t.prototype,"color",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Number)],t.prototype,"height",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Object)],t.prototype,"padding",void 0),r.__decorate([n.Input(),r.__metadata("design:type",String)],t.prototype,"renderAs",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Object)],t.prototype,"text",void 0),r.__decorate([n.Input(),r.__metadata("design:type",String)],t.prototype,"type",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Object)],t.prototype,"value",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Number)],t.prototype,"width",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Number)],t.prototype,"resizeRateLimit",void 0),t=r.__decorate([n.Component({changeDetection:n.ChangeDetectionStrategy.OnPush,exportAs:"kendoBarcode",selector:"kendo-barcode",template:'\n <kendo-resize-sensor (resize)="onResize()" [rateLimit]="resizeRateLimit"></kendo-resize-sensor>\n '}),r.__metadata("design:paramtypes",[n.ElementRef,n.Renderer2,n.NgZone])],t)}(a.BaseComponent);t.BarcodeComponent=s},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(0),n=o(1),i=o(3),a=o(11),d=o(12),s=o(4),u=function(){function e(e,t,o){this.element=e,this.renderer=t,this.ngZone=o,this.resizeRateLimit=10,d.validatePackage(s.packageMetadata)}return Object.defineProperty(e.prototype,"autoResize",{get:function(){return this.resizeRateLimit>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canRender",{get:function(){return i.isDocumentAvailable()&&Boolean(this.element)},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.refresh()},e.prototype.ngOnChanges=function(e){e.renderAs&&this.instance&&(this.instance.destroy(),this.instance=null),this.refresh()},e.prototype.resize=function(){this.instance&&this.instance.redraw()},e.prototype.onResize=function(){this.autoResize&&this.resize()},e.prototype.exportImage=function(e){return void 0===e&&(e={}),a.exportImage(this.exportVisual(),e)},e.prototype.exportSVG=function(e){return void 0===e&&(e={}),a.exportSVG(this.exportVisual(),e)},e.prototype.exportVisual=function(){return this.instance.exportVisual()},e.prototype.refresh=function(){if(this.canRender)if(this.instance)this.instance.setOptions(this.options);else{var e=this.element.nativeElement;this.instance=this.createInstance(e,this.options)}},e.prototype.isDevMode=function(){return n.isDevMode()},r.__decorate([n.Input(),r.__metadata("design:type",Number)],e.prototype,"resizeRateLimit",void 0),r.__decorate([n.ViewChild("surface",{static:!0}),r.__metadata("design:type",n.ElementRef)],e.prototype,"surfaceElement",void 0),e}();t.BaseComponent=u},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(0),n=o(1),i=o(2),a=o(6),d=o(4),s=function(e){function t(t,o,r){var n=e.call(this,t,o,r)||this;return n.element=t,n.renderer=o,n.ngZone=r,n.resizeRateLimit=10,n}return r.__extends(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return{background:this.background||"#fff",border:this.border,color:this.color||"#000",encoding:this.encoding,errorCorrection:this.errorCorrection||"L",overlay:this.overlay||{},padding:this.padding,renderAs:this.renderAs,size:this.size,value:this.value}},enumerable:!0,configurable:!0}),t.prototype.createInstance=function(e,t){return new i.QRCode(e,t,this.onError.bind(this))},t.prototype.onError=function(e){if(e.name=d.packageMetadata.productName+" QRCode",this.isDevMode())throw e;console.warn(e)},r.__decorate([n.Input(),r.__metadata("design:type",String)],t.prototype,"background",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Object)],t.prototype,"border",void 0),r.__decorate([n.Input(),r.__metadata("design:type",String)],t.prototype,"color",void 0),r.__decorate([n.Input(),r.__metadata("design:type",String)],t.prototype,"encoding",void 0),r.__decorate([n.Input(),r.__metadata("design:type",String)],t.prototype,"errorCorrection",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Object)],t.prototype,"overlay",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Number)],t.prototype,"padding",void 0),r.__decorate([n.Input(),r.__metadata("design:type",String)],t.prototype,"renderAs",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Object)],t.prototype,"size",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Object)],t.prototype,"value",void 0),r.__decorate([n.Input(),r.__metadata("design:type",Number)],t.prototype,"resizeRateLimit",void 0),t=r.__decorate([n.Component({changeDetection:n.ChangeDetectionStrategy.OnPush,selector:"kendo-qrcode",exportAs:"kendoQRCode",template:'\n <kendo-resize-sensor (resize)="onResize()" [rateLimit]="resizeRateLimit"></kendo-resize-sensor>\n '}),r.__metadata("design:paramtypes",[n.ElementRef,n.Renderer2,n.NgZone])],t)}(a.BaseComponent);t.QRCodeComponent=s},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(0),n=o(1),i=o(3),a=o(5),d=function(){function e(){}return e=r.__decorate([n.NgModule({declarations:[a.BarcodeComponent],imports:[i.ResizeSensorModule],exports:[a.BarcodeComponent]})],e)}();t.BarcodeModule=d},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(0),n=o(1),i=o(3),a=o(7),d=function(){function e(){}return e=r.__decorate([n.NgModule({declarations:[a.QRCodeComponent],imports:[i.ResizeSensorModule],exports:[a.QRCodeComponent]})],e)}();t.QRCodeModule=d},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(5);t.BarcodeComponent=r.BarcodeComponent;var n=o(7);t.QRCodeComponent=n.QRCodeComponent;var i=o(8);t.BarcodeModule=i.BarcodeModule;var a=o(9);t.QRCodeModule=a.QRCodeModule;var d=o(13);t.BarcodesModule=d.BarcodesModule;var s=o(14);t.createBarcodeValidator=s.createBarcodeValidator;var u=o(15);t.createQRCodeValidator=u.createQRCodeValidator},function(e,t){e.exports=n},function(e,t){e.exports=i},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(0),n=o(1),i=o(8),a=o(9),d=function(){function e(){}return e=r.__decorate([n.NgModule({exports:[i.BarcodeModule,a.QRCodeModule]})],e)}();t.BarcodesModule=d},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(2);t.createBarcodeValidator=function(e,t){var o=r.barcodeValidator(e,t);return function(t){if(null==t.value||""===t.value)return null;var r=o(t.value);return!0===r.valid?null:{barcode:{message:r.error.message,value:t.value,type:e}}}}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(2);t.createQRCodeValidator=function(e){void 0===e&&(e="ISO_8859_1");var t=r.qrcodeValidator(e);return function(o){if(!o.value)return null;var r=t(o.value);return!0===r.valid?null:{qrcode:{message:r.error.message,value:o.value,encoding:e}}}}}])}));
@@ -1,51 +0,0 @@
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
- var isPresent = function (value) { return value !== null && value !== undefined; };
10
- var ɵ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 var createBarcodeValidator = function (type, size) {
33
- var validator = barcodeValidator(type, size);
34
- return function (control) {
35
- if (!isPresent(control.value) || control.value === '') {
36
- return null;
37
- }
38
- var 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 };
@@ -1,149 +0,0 @@
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 { Barcode } from '@progress/kendo-charts';
8
- import { BaseComponent } from './base.component';
9
- import { packageMetadata } from './package-metadata';
10
- /**
11
- * Represents the Kendo UI Barcode component for Angular.
12
- *
13
- * @example
14
- * ```ts
15
- * import { Component } from '@angular/core';
16
- *
17
- * _@Component({
18
- * selector: 'my-app',
19
- * template: `
20
- * <kendo-barcode type="EAN8" value="1234567">
21
- * </kendo-barcode>
22
- * `
23
- * })
24
- * export class AppComponent {
25
- * }
26
- * ```
27
- */
28
- var BarcodeComponent = /** @class */ (function (_super) {
29
- tslib_1.__extends(BarcodeComponent, _super);
30
- function BarcodeComponent(element, renderer, ngZone) {
31
- var _this = _super.call(this, element, renderer, ngZone) || this;
32
- _this.element = element;
33
- _this.renderer = renderer;
34
- _this.ngZone = ngZone;
35
- /**
36
- * Limits the automatic resizing of the Barcode. Sets the maximum number of times per second
37
- * that the component redraws its content when the size of its container changes.
38
- * Defaults to `10`. To disable the automatic resizing, set it to `0`.
39
- *
40
- * @example
41
- * ```ts
42
- * _@Component({
43
- * selector: 'my-app',
44
- * template: `
45
- * <kendo-barcode type="EAN8" [value]="1234567"
46
- * [resizeRateLimit]="2">
47
- * </kendo-barcode>
48
- * `
49
- * })
50
- * export class AppComponent {
51
- * }
52
- * ```
53
- */
54
- _this.resizeRateLimit = 10;
55
- return _this;
56
- }
57
- Object.defineProperty(BarcodeComponent.prototype, "options", {
58
- get: function () {
59
- return {
60
- renderAs: this.renderAs,
61
- background: this.background,
62
- border: this.border,
63
- checksum: this.checksum,
64
- color: this.color,
65
- height: this.height,
66
- padding: this.padding,
67
- text: this.text,
68
- type: this.type,
69
- value: this.value,
70
- width: this.width
71
- };
72
- },
73
- enumerable: true,
74
- configurable: true
75
- });
76
- BarcodeComponent.prototype.createInstance = function (element, options) {
77
- return new Barcode(element, options, this.onError.bind(this));
78
- };
79
- BarcodeComponent.prototype.onError = function (error) {
80
- error.name = packageMetadata.productName + ' Barcode';
81
- if (this.isDevMode()) {
82
- throw error;
83
- }
84
- else {
85
- console.warn(error);
86
- }
87
- };
88
- tslib_1.__decorate([
89
- Input(),
90
- tslib_1.__metadata("design:type", String)
91
- ], BarcodeComponent.prototype, "background", void 0);
92
- tslib_1.__decorate([
93
- Input(),
94
- tslib_1.__metadata("design:type", Object)
95
- ], BarcodeComponent.prototype, "border", void 0);
96
- tslib_1.__decorate([
97
- Input(),
98
- tslib_1.__metadata("design:type", Boolean)
99
- ], BarcodeComponent.prototype, "checksum", void 0);
100
- tslib_1.__decorate([
101
- Input(),
102
- tslib_1.__metadata("design:type", String)
103
- ], BarcodeComponent.prototype, "color", void 0);
104
- tslib_1.__decorate([
105
- Input(),
106
- tslib_1.__metadata("design:type", Number)
107
- ], BarcodeComponent.prototype, "height", void 0);
108
- tslib_1.__decorate([
109
- Input(),
110
- tslib_1.__metadata("design:type", Object)
111
- ], BarcodeComponent.prototype, "padding", void 0);
112
- tslib_1.__decorate([
113
- Input(),
114
- tslib_1.__metadata("design:type", String)
115
- ], BarcodeComponent.prototype, "renderAs", void 0);
116
- tslib_1.__decorate([
117
- Input(),
118
- tslib_1.__metadata("design:type", Object)
119
- ], BarcodeComponent.prototype, "text", void 0);
120
- tslib_1.__decorate([
121
- Input(),
122
- tslib_1.__metadata("design:type", String)
123
- ], BarcodeComponent.prototype, "type", void 0);
124
- tslib_1.__decorate([
125
- Input(),
126
- tslib_1.__metadata("design:type", Object)
127
- ], BarcodeComponent.prototype, "value", void 0);
128
- tslib_1.__decorate([
129
- Input(),
130
- tslib_1.__metadata("design:type", Number)
131
- ], BarcodeComponent.prototype, "width", void 0);
132
- tslib_1.__decorate([
133
- Input(),
134
- tslib_1.__metadata("design:type", Number)
135
- ], BarcodeComponent.prototype, "resizeRateLimit", void 0);
136
- BarcodeComponent = tslib_1.__decorate([
137
- Component({
138
- changeDetection: ChangeDetectionStrategy.OnPush,
139
- exportAs: 'kendoBarcode',
140
- selector: 'kendo-barcode',
141
- template: "\n <kendo-resize-sensor (resize)=\"onResize()\" [rateLimit]=\"resizeRateLimit\"></kendo-resize-sensor>\n "
142
- }),
143
- tslib_1.__metadata("design:paramtypes", [ElementRef,
144
- Renderer2,
145
- NgZone])
146
- ], BarcodeComponent);
147
- return BarcodeComponent;
148
- }(BaseComponent));
149
- export { BarcodeComponent };
@@ -1,117 +0,0 @@
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 { ElementRef, Input, isDevMode, ViewChild } from '@angular/core';
7
- import { isDocumentAvailable } from '@progress/kendo-angular-common';
8
- import { exportImage, exportSVG } from '@progress/kendo-drawing';
9
- import { validatePackage } from '@progress/kendo-licensing';
10
- import { packageMetadata } from './package-metadata';
11
- /**
12
- * @hidden
13
- */
14
- var BaseComponent = /** @class */ (function () {
15
- function BaseComponent(element, renderer, ngZone) {
16
- this.element = element;
17
- this.renderer = renderer;
18
- this.ngZone = ngZone;
19
- this.resizeRateLimit = 10;
20
- validatePackage(packageMetadata);
21
- }
22
- Object.defineProperty(BaseComponent.prototype, "autoResize", {
23
- get: function () {
24
- return this.resizeRateLimit > 0;
25
- },
26
- enumerable: true,
27
- configurable: true
28
- });
29
- Object.defineProperty(BaseComponent.prototype, "canRender", {
30
- get: function () {
31
- return isDocumentAvailable() && Boolean(this.element);
32
- },
33
- enumerable: true,
34
- configurable: true
35
- });
36
- BaseComponent.prototype.ngAfterViewInit = function () {
37
- this.refresh();
38
- };
39
- BaseComponent.prototype.ngOnChanges = function (changes) {
40
- // Need to create a new instance if the rendering mode changes.
41
- if (changes['renderAs'] && this.instance) {
42
- this.instance.destroy();
43
- this.instance = null;
44
- }
45
- this.refresh();
46
- };
47
- /**
48
- * Detects the size of the container and redraws the component.
49
- * Resizing is automatic unless you set the `resizeRateLimit` option to `0`.
50
- */
51
- BaseComponent.prototype.resize = function () {
52
- if (this.instance) {
53
- this.instance.redraw();
54
- }
55
- };
56
- /**
57
- * @hidden
58
- */
59
- BaseComponent.prototype.onResize = function () {
60
- if (this.autoResize) {
61
- this.resize();
62
- }
63
- };
64
- /**
65
- * Exports the component as an image. The export operation is asynchronous and returns a promise.
66
- *
67
- * @param {ImageExportOptions} options - The parameters for the exported image.
68
- * @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
69
- */
70
- BaseComponent.prototype.exportImage = function (options) {
71
- if (options === void 0) { options = {}; }
72
- return exportImage(this.exportVisual(), options);
73
- };
74
- /**
75
- * Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
76
- *
77
- * @param options - The parameters for the exported file.
78
- * @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
79
- */
80
- BaseComponent.prototype.exportSVG = function (options) {
81
- if (options === void 0) { options = {}; }
82
- return exportSVG(this.exportVisual(), options);
83
- };
84
- /**
85
- * Exports the component as a Drawing Group.
86
- *
87
- * @returns - The exported Group.
88
- */
89
- BaseComponent.prototype.exportVisual = function () {
90
- return this.instance.exportVisual();
91
- };
92
- BaseComponent.prototype.refresh = function () {
93
- if (!this.canRender) {
94
- return;
95
- }
96
- if (!this.instance) {
97
- var element = this.element.nativeElement;
98
- this.instance = this.createInstance(element, this.options);
99
- }
100
- else {
101
- this.instance.setOptions(this.options);
102
- }
103
- };
104
- BaseComponent.prototype.isDevMode = function () {
105
- return isDevMode();
106
- };
107
- tslib_1.__decorate([
108
- Input(),
109
- tslib_1.__metadata("design:type", Number)
110
- ], BaseComponent.prototype, "resizeRateLimit", void 0);
111
- tslib_1.__decorate([
112
- ViewChild('surface', { static: true }),
113
- tslib_1.__metadata("design:type", ElementRef)
114
- ], BaseComponent.prototype, "surfaceElement", void 0);
115
- return BaseComponent;
116
- }());
117
- export { BaseComponent };
@@ -1,4 +0,0 @@
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
- *-------------------------------------------------------------------------------------------*/
@@ -1,4 +0,0 @@
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
- *-------------------------------------------------------------------------------------------*/
@@ -1,4 +0,0 @@
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
- *-------------------------------------------------------------------------------------------*/
@@ -1,15 +0,0 @@
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
- /**
6
- * @hidden
7
- */
8
- export var packageMetadata = {
9
- name: '@progress/kendo-angular-barcodes',
10
- productName: 'Kendo UI for Angular',
11
- productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1648115793,
13
- version: '',
14
- licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
15
- };
@@ -1,45 +0,0 @@
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 { qrcodeValidator } from '@progress/kendo-charts';
6
- /**
7
- * Creates a value validator for a particular Barcode type.
8
- *
9
- * @param {QRCodeEncoding} encoding The QR Code encoding. Defaults to 'ISO_8859_1'.
10
- * @returns {ValidatorFn} A validator function that returns an error map with the `qrcode` property if the validation check fails, otherwise `null`.
11
- *
12
- * @example
13
- * ```ts-no-run
14
- * const control = new FormControl('Фоо', createQRCodeValidator());
15
- * console.log(control.errors);
16
- *
17
- * // {
18
- * // qrcode: {
19
- * // message: 'Unsupported character in QR Code: "Ф".',
20
- * // value: '1234',
21
- * // type: 'EAN13'
22
- * // }
23
- * // }
24
- * ```
25
- */
26
- export var createQRCodeValidator = function (encoding) {
27
- if (encoding === void 0) { encoding = 'ISO_8859_1'; }
28
- var validator = qrcodeValidator(encoding);
29
- return function (control) {
30
- if (!control.value) {
31
- return null;
32
- }
33
- var result = validator(control.value);
34
- if (result.valid === true) {
35
- return null;
36
- }
37
- return {
38
- qrcode: {
39
- message: result.error.message,
40
- value: control.value,
41
- encoding: encoding
42
- }
43
- };
44
- };
45
- };
@@ -1,147 +0,0 @@
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 };
@@ -1,52 +0,0 @@
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 };
@@ -1,49 +0,0 @@
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 { BarcodeComponent } from './barcode.component';
9
- /**
10
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
11
- * definition for the Barcode component.
12
- *
13
- * @example
14
- *
15
- * ```ts-no-run
16
- * // Import the Barcode module
17
- * import { BarcodeModule } 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, BarcodeModule], // import Barcode module
31
- * bootstrap: [AppComponent]
32
- * })
33
- * export class AppModule {}
34
- *
35
- * // Compile and launch the module
36
- * platformBrowserDynamic().bootstrapModule(AppModule);
37
- *
38
- * ```
39
- */
40
- let BarcodeModule = class BarcodeModule {
41
- };
42
- BarcodeModule = tslib_1.__decorate([
43
- NgModule({
44
- declarations: [BarcodeComponent],
45
- imports: [ResizeSensorModule],
46
- exports: [BarcodeComponent]
47
- })
48
- ], BarcodeModule);
49
- export { BarcodeModule };