@progress/kendo-react-barcodes 4.14.0-dev.202112141254

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 (103) hide show
  1. package/LICENSE.md +11 -0
  2. package/NOTICE.txt +78 -0
  3. package/README.md +59 -0
  4. package/about.md +3 -0
  5. package/dist/cdn/js/kendo-react-barcodes.js +1 -0
  6. package/dist/es/Barcode.d.ts +49 -0
  7. package/dist/es/Barcode.js +146 -0
  8. package/dist/es/BarcodeContext.d.ts +12 -0
  9. package/dist/es/BarcodeContext.js +6 -0
  10. package/dist/es/BarcodeProps.d.ts +61 -0
  11. package/dist/es/BarcodeProps.js +0 -0
  12. package/dist/es/BaseBarcode.d.ts +75 -0
  13. package/dist/es/BaseBarcode.js +179 -0
  14. package/dist/es/BaseBarcodeProps.d.ts +41 -0
  15. package/dist/es/BaseBarcodeProps.js +0 -0
  16. package/dist/es/QRCode.d.ts +49 -0
  17. package/dist/es/QRCode.js +149 -0
  18. package/dist/es/QRCodeProps.d.ts +73 -0
  19. package/dist/es/QRCodeProps.js +0 -0
  20. package/dist/es/common/barcodes.d.ts +4 -0
  21. package/dist/es/common/barcodes.js +0 -0
  22. package/dist/es/main.d.ts +6 -0
  23. package/dist/es/main.js +3 -0
  24. package/dist/es/package-metadata.d.ts +5 -0
  25. package/dist/es/package-metadata.js +11 -0
  26. package/dist/es/store/reducer.d.ts +10 -0
  27. package/dist/es/store/reducer.js +41 -0
  28. package/dist/es/store/store.d.ts +25 -0
  29. package/dist/es/store/store.js +28 -0
  30. package/dist/es/types/barcode-text.d.ts +32 -0
  31. package/dist/es/types/barcode-text.js +0 -0
  32. package/dist/es/types/barcode-type.d.ts +4 -0
  33. package/dist/es/types/barcode-type.js +0 -0
  34. package/dist/es/types/border.interface.d.ts +18 -0
  35. package/dist/es/types/border.interface.js +0 -0
  36. package/dist/es/types/dash-type.interface.d.ts +4 -0
  37. package/dist/es/types/dash-type.interface.js +0 -0
  38. package/dist/es/types/margin.interface.d.ts +21 -0
  39. package/dist/es/types/margin.interface.js +0 -0
  40. package/dist/es/types/padding.interface.d.ts +21 -0
  41. package/dist/es/types/padding.interface.js +0 -0
  42. package/dist/es/types/qrcode-encoding.d.ts +4 -0
  43. package/dist/es/types/qrcode-encoding.js +0 -0
  44. package/dist/es/types/qrcode-error-correction.d.ts +9 -0
  45. package/dist/es/types/qrcode-error-correction.js +0 -0
  46. package/dist/es/types/qrcode-overlay.d.ts +25 -0
  47. package/dist/es/types/qrcode-overlay.js +0 -0
  48. package/dist/es/types/render-mode.d.ts +8 -0
  49. package/dist/es/types/render-mode.js +0 -0
  50. package/dist/es/types.d.ts +10 -0
  51. package/dist/es/types.js +0 -0
  52. package/dist/es/utils/common.d.ts +4 -0
  53. package/dist/es/utils/common.js +39 -0
  54. package/dist/npm/Barcode.d.ts +49 -0
  55. package/dist/npm/Barcode.js +148 -0
  56. package/dist/npm/BarcodeContext.d.ts +12 -0
  57. package/dist/npm/BarcodeContext.js +8 -0
  58. package/dist/npm/BarcodeProps.d.ts +61 -0
  59. package/dist/npm/BarcodeProps.js +2 -0
  60. package/dist/npm/BaseBarcode.d.ts +75 -0
  61. package/dist/npm/BaseBarcode.js +181 -0
  62. package/dist/npm/BaseBarcodeProps.d.ts +41 -0
  63. package/dist/npm/BaseBarcodeProps.js +2 -0
  64. package/dist/npm/QRCode.d.ts +49 -0
  65. package/dist/npm/QRCode.js +151 -0
  66. package/dist/npm/QRCodeProps.d.ts +73 -0
  67. package/dist/npm/QRCodeProps.js +2 -0
  68. package/dist/npm/common/barcodes.d.ts +4 -0
  69. package/dist/npm/common/barcodes.js +2 -0
  70. package/dist/npm/main.d.ts +6 -0
  71. package/dist/npm/main.js +6 -0
  72. package/dist/npm/package-metadata.d.ts +5 -0
  73. package/dist/npm/package-metadata.js +13 -0
  74. package/dist/npm/store/reducer.d.ts +10 -0
  75. package/dist/npm/store/reducer.js +44 -0
  76. package/dist/npm/store/store.d.ts +25 -0
  77. package/dist/npm/store/store.js +30 -0
  78. package/dist/npm/types/barcode-text.d.ts +32 -0
  79. package/dist/npm/types/barcode-text.js +2 -0
  80. package/dist/npm/types/barcode-type.d.ts +4 -0
  81. package/dist/npm/types/barcode-type.js +2 -0
  82. package/dist/npm/types/border.interface.d.ts +18 -0
  83. package/dist/npm/types/border.interface.js +2 -0
  84. package/dist/npm/types/dash-type.interface.d.ts +4 -0
  85. package/dist/npm/types/dash-type.interface.js +2 -0
  86. package/dist/npm/types/margin.interface.d.ts +21 -0
  87. package/dist/npm/types/margin.interface.js +2 -0
  88. package/dist/npm/types/padding.interface.d.ts +21 -0
  89. package/dist/npm/types/padding.interface.js +2 -0
  90. package/dist/npm/types/qrcode-encoding.d.ts +4 -0
  91. package/dist/npm/types/qrcode-encoding.js +2 -0
  92. package/dist/npm/types/qrcode-error-correction.d.ts +9 -0
  93. package/dist/npm/types/qrcode-error-correction.js +2 -0
  94. package/dist/npm/types/qrcode-overlay.d.ts +25 -0
  95. package/dist/npm/types/qrcode-overlay.js +2 -0
  96. package/dist/npm/types/render-mode.d.ts +8 -0
  97. package/dist/npm/types/render-mode.js +2 -0
  98. package/dist/npm/types.d.ts +10 -0
  99. package/dist/npm/types.js +2 -0
  100. package/dist/npm/utils/common.d.ts +4 -0
  101. package/dist/npm/utils/common.js +41 -0
  102. package/dist/systemjs/kendo-react-barcodes.js +1 -0
  103. package/package.json +71 -0
@@ -0,0 +1,149 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ var __assign = (this && this.__assign) || function () {
15
+ __assign = Object.assign || function(t) {
16
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
17
+ s = arguments[i];
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19
+ t[p] = s[p];
20
+ }
21
+ return t;
22
+ };
23
+ return __assign.apply(this, arguments);
24
+ };
25
+ var __rest = (this && this.__rest) || function (s, e) {
26
+ var t = {};
27
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
+ t[p] = s[p];
29
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
31
+ t[p[i]] = s[p[i]];
32
+ return t;
33
+ };
34
+ import * as React from 'react';
35
+ import { BaseBarcode } from './BaseBarcode';
36
+ import { QRCode as KendoQRCode } from '@progress/kendo-charts';
37
+ import { exportImage, exportSVG, Group } from '@progress/kendo-drawing';
38
+ import { classNames } from '@progress/kendo-react-common';
39
+ var DEFAULT_COLOR = '#000';
40
+ var DEFAULT_BACKGROUND = '#fff';
41
+ var DEFAULT_ERROR_CORRECTION = 'L';
42
+ /**
43
+ * Represents the KendoReact QRCode component.
44
+ */
45
+ var QRCode = /** @class */ (function (_super) {
46
+ __extends(QRCode, _super);
47
+ function QRCode() {
48
+ var _this = _super !== null && _super.apply(this, arguments) || this;
49
+ _this.getTarget = function () {
50
+ return _this;
51
+ };
52
+ _this.deriveOptionsFromParent = function (options) {
53
+ return Object.assign({}, options, {
54
+ background: _this.props.background || DEFAULT_BACKGROUND,
55
+ border: _this.props.border,
56
+ color: _this.props.color || DEFAULT_COLOR,
57
+ encoding: _this.props.encoding,
58
+ errorCorrection: _this.props.errorCorrection || DEFAULT_ERROR_CORRECTION,
59
+ overlay: _this.props.overlay || {},
60
+ padding: _this.props.padding,
61
+ renderAs: _this.props.renderAs,
62
+ size: _this.props.size,
63
+ value: _this.props.value
64
+ });
65
+ };
66
+ return _this;
67
+ }
68
+ Object.defineProperty(QRCode.prototype, "barcodeInstance", {
69
+ /**
70
+ * @hidden
71
+ */
72
+ get: function () {
73
+ if (this._baseBarcode !== null) {
74
+ return this._baseBarcode.barcodeInstance;
75
+ }
76
+ return null;
77
+ },
78
+ enumerable: true,
79
+ configurable: true
80
+ });
81
+ Object.defineProperty(QRCode.prototype, "surface", {
82
+ /**
83
+ * The Drawing `Surface` of the Barcode.
84
+ */
85
+ get: function () {
86
+ if (this._baseBarcode !== null) {
87
+ return this._baseBarcode.surface;
88
+ }
89
+ return null;
90
+ },
91
+ enumerable: true,
92
+ configurable: true
93
+ });
94
+ Object.defineProperty(QRCode.prototype, "element", {
95
+ /**
96
+ * The DOM element of the Barcode.
97
+ */
98
+ get: function () {
99
+ if (this._baseBarcode !== null) {
100
+ return this._baseBarcode.element;
101
+ }
102
+ return null;
103
+ },
104
+ enumerable: true,
105
+ configurable: true
106
+ });
107
+ /**
108
+ * @hidden
109
+ */
110
+ QRCode.prototype.render = function () {
111
+ var _this = this;
112
+ var _a = this.props, children = _a.children, className = _a.className, baseBarcodeProps = __rest(_a, ["children", "className"]);
113
+ return (React.createElement(BaseBarcode, __assign({}, baseBarcodeProps, { deriveOptionsFromParent: this.deriveOptionsFromParent, ref: function (baseBarcode) { return _this._baseBarcode = baseBarcode; }, barcodeConstructor: KendoQRCode, getTarget: this.getTarget, className: classNames('k-qrcode', className) }), children));
114
+ };
115
+ /**
116
+ * Exports the component as an image. The export operation is asynchronous and returns a promise.
117
+ *
118
+ * @param {ImageExportOptions} options - The parameters for the exported image.
119
+ * @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
120
+ */
121
+ QRCode.prototype.exportImage = function (options) {
122
+ if (options === void 0) { options = {}; }
123
+ return exportImage(this.exportVisual(), options);
124
+ };
125
+ /**
126
+ * Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
127
+ *
128
+ * @param options - The parameters for the exported file.
129
+ * @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
130
+ */
131
+ QRCode.prototype.exportSVG = function (options) {
132
+ if (options === void 0) { options = {}; }
133
+ return exportSVG(this.exportVisual(), options);
134
+ };
135
+ /**
136
+ * Exports a Barcode component as a Drawing `Scene`.
137
+ *
138
+ * @param {any} options - The parameters for the export operation.
139
+ * @returns {Group} - A promise that returns the root `Group` of the scene.
140
+ */
141
+ QRCode.prototype.exportVisual = function (options) {
142
+ if (this.barcodeInstance !== null) {
143
+ return this.barcodeInstance.exportVisual(options);
144
+ }
145
+ return new Group();
146
+ };
147
+ return QRCode;
148
+ }(React.Component));
149
+ export { QRCode };
@@ -0,0 +1,73 @@
1
+ import { BaseBarcodeProps } from './BaseBarcodeProps';
2
+ import { Border, QRCodeEncoding, QRCodeErrorCorrection, QRCodeOverlay } from './types';
3
+ /**
4
+ * Represents the props of the [KendoReact QRCode component]({% slug overview_qrcode_barcodes %}).
5
+ */
6
+ export interface QRCodeProps extends BaseBarcodeProps {
7
+ /**
8
+ * The background color of the QR Code. Accepts a valid CSS color string, including hex and rgb.
9
+ *
10
+ * @default "white"
11
+ */
12
+ background?: string;
13
+ /**
14
+ * The border of the QR Code.
15
+ */
16
+ border?: Border;
17
+ /**
18
+ * The color of the QR Code. Accepts a valid CSS color string, including hex and rgb.
19
+ *
20
+ * @default "black"
21
+ */
22
+ color?: string;
23
+ /**
24
+ * The encoding mode used to encode the value.
25
+ *
26
+ * > **Important** The UTF-8 encoding is not included in the specifications and is not supported by all readers.
27
+ *
28
+ * The possible values are:
29
+ * * `"ISO_8859_1"`&mdash;Supports all characters from the [ISO/IEC 8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1) character set.
30
+ * * `"UTF_8"`&mdash;Supports all [Unicode](https://en.wikipedia.org/wiki/List_of_Unicode_characters) characters.
31
+ *
32
+ * @default "ISO_8859_1"
33
+ */
34
+ encoding?: QRCodeEncoding;
35
+ /**
36
+ * The error correction level to use.
37
+ *
38
+ * The possible values are:
39
+ * * `"L"`&mdash;Approximately 7% of the codewords can be restored.
40
+ * * `"M"`&mdash;Approximately 15% of the codewords can be restored.
41
+ * * `"Q"`&mdash;Approximately 25% of the codewords can be restored.
42
+ * * `"H"`&mdash;Approximately 30% of the codewords can be restored.
43
+ *
44
+ * @default "L"
45
+ */
46
+ errorCorrection?: QRCodeErrorCorrection;
47
+ /**
48
+ * An optional image overlay that will placed over the QR Code.
49
+ *
50
+ * > **Note** Always test if the code reads correctly with the applied overlay.
51
+ * > 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"`.
52
+ */
53
+ overlay?: QRCodeOverlay;
54
+ /**
55
+ * The padding of the QR Code. A numeric value sets all paddings.
56
+ *
57
+ * @default 0
58
+ */
59
+ padding?: number;
60
+ /**
61
+ * Specifies the size of a QR Code. Numeric values are treated as pixels.
62
+ *
63
+ * If no size is specified, the size will be determined from the element width and height.
64
+ * If the element has width or height of zero, a default value of 200 pixels will be used.
65
+ *
66
+ * @default "200px"
67
+ */
68
+ size?: number | string;
69
+ /**
70
+ * The value of the QR Code.
71
+ */
72
+ value: number | string;
73
+ }
File without changes
@@ -0,0 +1,4 @@
1
+ import { Barcode } from './../Barcode';
2
+ import { QRCode } from './../QRCode';
3
+ declare type Barcodes = Barcode | QRCode;
4
+ export { Barcodes };
File without changes
@@ -0,0 +1,6 @@
1
+ import { Barcode } from './Barcode';
2
+ import { BarcodeProps } from './BarcodeProps';
3
+ import { QRCode } from './QRCode';
4
+ import { QRCodeProps } from './QRCodeProps';
5
+ export * from './types';
6
+ export { Barcode, BarcodeProps, QRCode, QRCodeProps };
@@ -0,0 +1,3 @@
1
+ import { Barcode } from './Barcode';
2
+ import { QRCode } from './QRCode';
3
+ export { Barcode, QRCode };
@@ -0,0 +1,5 @@
1
+ import { PackageMetadata } from '@progress/kendo-licensing';
2
+ /**
3
+ * @hidden
4
+ */
5
+ export declare const packageMetadata: PackageMetadata;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export var packageMetadata = {
5
+ name: '@progress/kendo-react-barcodes',
6
+ productName: 'KendoReact',
7
+ productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
+ publishDate: 1639486389,
9
+ version: '',
10
+ licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
11
+ };
@@ -0,0 +1,10 @@
1
+ import { StoreAction } from './store';
2
+ /**
3
+ * @hidden
4
+ */
5
+ declare const optionsReducer: (currentState: any, action: StoreAction) => object;
6
+ /**
7
+ * @hidden
8
+ */
9
+ declare const observersReducer: (currentState: any, action: StoreAction) => any;
10
+ export { optionsReducer, observersReducer };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ var optionsReducer = function (currentState, action) {
5
+ if (action.barcodeKey) {
6
+ return reducers.configurationItem(currentState, action);
7
+ }
8
+ else {
9
+ return {};
10
+ }
11
+ };
12
+ /**
13
+ * @hidden
14
+ */
15
+ var observersReducer = function (currentState, action) {
16
+ if (action.type) {
17
+ switch (action.type) {
18
+ case 'add':
19
+ return currentState.concat([action.payload]);
20
+ case 'remove':
21
+ return currentState.filter(function (element) { return element !== action.payload; });
22
+ default:
23
+ return currentState;
24
+ }
25
+ }
26
+ else {
27
+ return [];
28
+ }
29
+ };
30
+ /**
31
+ * @hidden
32
+ */
33
+ var reducers = {
34
+ configurationItem: function (currentState, action) {
35
+ var _a;
36
+ return Object.assign(currentState, (_a = {},
37
+ _a[action.barcodeKey] = action.payload,
38
+ _a));
39
+ }
40
+ };
41
+ export { optionsReducer, observersReducer };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export declare const THROTTLE_MS: number;
5
+ /**
6
+ * @hidden
7
+ */
8
+ export interface StoreAction {
9
+ barcodeKey?: string;
10
+ type?: string;
11
+ payload: any;
12
+ }
13
+ /**
14
+ * @hidden
15
+ */
16
+ export interface Store {
17
+ getState(): any;
18
+ dispatch(action: StoreAction | object): void;
19
+ subscribe(f: Function): Function;
20
+ }
21
+ /**
22
+ * @hidden
23
+ */
24
+ declare const createStore: (reducer: any) => Store;
25
+ export default createStore;
@@ -0,0 +1,28 @@
1
+ import { canUseDOM } from '@progress/kendo-react-common';
2
+ /**
3
+ * @hidden
4
+ */
5
+ export var THROTTLE_MS = 1000 / 60;
6
+ /**
7
+ * @hidden
8
+ */
9
+ var createStore = function (reducer) {
10
+ var state;
11
+ var timerId;
12
+ var listeners = [];
13
+ var getState = function () { return state; };
14
+ var dispatch = function (action) {
15
+ state = reducer(state, action);
16
+ if (canUseDOM) {
17
+ window.clearTimeout(timerId);
18
+ timerId = window.setTimeout(function () { return listeners.forEach(function (l) { return l(); }); }, THROTTLE_MS);
19
+ }
20
+ };
21
+ var subscribe = function (listener) {
22
+ listeners.push(listener);
23
+ return function () { return listeners = listeners.filter(function (l) { return l !== listener; }); };
24
+ };
25
+ dispatch({});
26
+ return { getState: getState, dispatch: dispatch, subscribe: subscribe };
27
+ };
28
+ export default createStore;
@@ -0,0 +1,32 @@
1
+ import { Margin } from './margin.interface';
2
+ /**
3
+ * The Barcode text label configuration.
4
+ */
5
+ export interface BarcodeText {
6
+ /**
7
+ * The color of the text. Any valid CSS color string will work here, including hex and rgb.
8
+ *
9
+ * @default "black"
10
+ */
11
+ color?: string;
12
+ /**
13
+ * The font of the text.
14
+ *
15
+ * @default "16px Consolas, Monaco, Sans Mono, monospace, sans-serif"
16
+ */
17
+ font?: string;
18
+ /**
19
+ * The margin of the text. A numeric value sets all margins.
20
+ *
21
+ * @default 0
22
+ */
23
+ margin?: Margin | number;
24
+ /**
25
+ * A flag indicating that the Barcode text label is visible.
26
+ *
27
+ * If set to `false`, the Barcode will not display the value as a text below the barcode lines.
28
+ *
29
+ * @default true
30
+ */
31
+ visible?: boolean;
32
+ }
File without changes
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Supported symbologies (encodings) for the Barcode component.
3
+ */
4
+ export declare type BarcodeType = 'EAN8' | 'EAN13' | 'UPCE' | 'UPCA' | 'Code11' | 'Code39' | 'Code39Extended' | 'Code93' | 'Code93Extended' | 'Code128' | 'Code128A' | 'Code128B' | 'Code128C' | 'GS1-128' | 'MSImod10' | 'MSImod11' | 'MSImod1010' | 'MSImod1110' | 'POSTNET' | 'ean8' | 'ean13' | 'upce' | 'upca' | 'code11' | 'code39' | 'code39extended' | 'code93' | 'code93extended' | 'code128' | 'code128a' | 'code128b' | 'code128c' | 'gs1-128' | 'msimod10' | 'msimod11' | 'msimod1010' | 'msimod1110' | 'postnet';
File without changes
@@ -0,0 +1,18 @@
1
+ import { DashType } from './dash-type.interface';
2
+ /**
3
+ * The appearance settings for the border lines.
4
+ */
5
+ export interface Border {
6
+ /**
7
+ * The color of the border line. Accepts valid CSS color strings, including hex and rgb.
8
+ */
9
+ color?: string;
10
+ /**
11
+ * The dash type of the border line.
12
+ */
13
+ dashType?: DashType;
14
+ /**
15
+ * The width of the border line in pixels.
16
+ */
17
+ width?: number;
18
+ }
File without changes
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The dash line type.
3
+ */
4
+ export declare type DashType = 'dash' | 'dashDot' | 'dot' | 'longDash' | 'longDashDot' | 'longDashDotDot' | 'solid';
File without changes
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The margin size for each side.
3
+ */
4
+ export interface Margin {
5
+ /**
6
+ * The top margin in pixels.
7
+ */
8
+ top?: number;
9
+ /**
10
+ * The right margin in pixels.
11
+ */
12
+ right?: number;
13
+ /**
14
+ * The bottom margin in pixels.
15
+ */
16
+ bottom?: number;
17
+ /**
18
+ * The left margin in pixels.
19
+ */
20
+ left?: number;
21
+ }
File without changes
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The padding size for each side.
3
+ */
4
+ export interface Padding {
5
+ /**
6
+ * The top padding in pixels.
7
+ */
8
+ top?: number;
9
+ /**
10
+ * The right padding in pixels.
11
+ */
12
+ right?: number;
13
+ /**
14
+ * The bottom padding in pixels.
15
+ */
16
+ bottom?: number;
17
+ /**
18
+ * The left padding in pixels.
19
+ */
20
+ left?: number;
21
+ }
File without changes
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The QR Code encoding modes.
3
+ */
4
+ export declare type QRCodeEncoding = 'ISO_8859_1' | 'UTF_8' | 'iso_8859_1' | 'utf_8';
File without changes
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The QR Code error correction levels.
3
+ *
4
+ * * `"L"`&mdash;Approximately 7% of the codewords can be restored.
5
+ * * `"M"`&mdash;Approximately 15% of the codewords can be restored.
6
+ * * `"Q"`&mdash;Approximately 25% of the codewords can be restored.
7
+ * * `"H"`&mdash;Approximately 30% of the codewords can be restored.
8
+ */
9
+ export declare type QRCodeErrorCorrection = 'L' | 'M' | 'Q' | 'H' | 'l' | 'm' | 'q' | 'h';
File without changes
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The image overlay configuration of the QR Code.
3
+ */
4
+ export interface QRCodeOverlay {
5
+ /**
6
+ * The overlay height in pixels.
7
+ */
8
+ height?: number;
9
+ /**
10
+ * The source image for the overlay.
11
+ *
12
+ * Required only when `type` is set to `'image'`.
13
+ */
14
+ imageUrl?: string;
15
+ /**
16
+ * The overlay type.
17
+ *
18
+ * @default 'image'
19
+ */
20
+ type?: 'image' | 'swiss';
21
+ /**
22
+ * The overlay width in pixels.
23
+ */
24
+ width?: number;
25
+ }
File without changes
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Sets the rendering mode of the component.
3
+ *
4
+ * The supported values are:
5
+ * * `"canvas"`&mdash;Renders the component as a Canvas element.
6
+ * * `"svg"`&mdash;Renders the component as an inline SVG document.
7
+ */
8
+ export declare type RenderMode = 'svg' | 'canvas';
File without changes
@@ -0,0 +1,10 @@
1
+ export { Margin } from './types/margin.interface';
2
+ export { Padding } from './types/padding.interface';
3
+ export { Border } from './types/border.interface';
4
+ export { DashType } from './types/dash-type.interface';
5
+ export { BarcodeText } from './types/barcode-text';
6
+ export { BarcodeType } from './types/barcode-type';
7
+ export { QRCodeEncoding } from './types/qrcode-encoding';
8
+ export { QRCodeErrorCorrection } from './types/qrcode-error-correction';
9
+ export { QRCodeOverlay } from './types/qrcode-overlay';
10
+ export { RenderMode } from './types/render-mode';
File without changes
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export declare const isOptionsChanged: (original: any, current: any) => boolean;
@@ -0,0 +1,39 @@
1
+ var isObject = function (value) {
2
+ return typeof value === 'object';
3
+ };
4
+ var diffOptions = function (original, current) {
5
+ if (Object.keys(original).length !== Object.keys(current).length) {
6
+ return true;
7
+ }
8
+ for (var field in original) {
9
+ if (original.hasOwnProperty(field)) {
10
+ var originalValue = original[field];
11
+ var currentValue = current[field];
12
+ var diff = isObject(originalValue) && isObject(currentValue) ?
13
+ diffOptions(originalValue, currentValue) : originalValue !== currentValue;
14
+ if (diff) {
15
+ return true;
16
+ }
17
+ }
18
+ }
19
+ return false;
20
+ };
21
+ /**
22
+ * @hidden
23
+ */
24
+ export var isOptionsChanged = function (original, current) {
25
+ if (!original || !current) {
26
+ return true;
27
+ }
28
+ original = [].concat(original);
29
+ current = [].concat(current);
30
+ if (original.length !== current.length) {
31
+ return true;
32
+ }
33
+ for (var idx = 0; idx < original.length; idx++) {
34
+ if (diffOptions(original[idx], current[idx])) {
35
+ return true;
36
+ }
37
+ }
38
+ return false;
39
+ };
@@ -0,0 +1,49 @@
1
+ import * as React from 'react';
2
+ import { BarcodeProps } from './BarcodeProps';
3
+ import { Surface } from '@progress/kendo-drawing';
4
+ import { Group, ImageExportOptions, SVGExportOptions } from '@progress/kendo-drawing';
5
+ /**
6
+ * Represents the KendoReact Barcode component.
7
+ */
8
+ export declare class Barcode extends React.Component<BarcodeProps, {}> {
9
+ private _baseBarcode;
10
+ /**
11
+ * @hidden
12
+ */
13
+ readonly barcodeInstance: any;
14
+ /**
15
+ * The Drawing `Surface` of the Barcode.
16
+ */
17
+ readonly surface: Surface | null;
18
+ /**
19
+ * The DOM element of the Barcode.
20
+ */
21
+ readonly element: HTMLDivElement | null;
22
+ /**
23
+ * @hidden
24
+ */
25
+ render(): any;
26
+ /**
27
+ * Exports the component as an image. The export operation is asynchronous and returns a promise.
28
+ *
29
+ * @param {ImageExportOptions} options - The parameters for the exported image.
30
+ * @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
31
+ */
32
+ exportImage(options?: ImageExportOptions): Promise<string>;
33
+ /**
34
+ * Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
35
+ *
36
+ * @param options - The parameters for the exported file.
37
+ * @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
38
+ */
39
+ exportSVG(options?: SVGExportOptions): Promise<string>;
40
+ /**
41
+ * Exports a Barcode component as a Drawing `Scene`.
42
+ *
43
+ * @param {any} options - The parameters for the export operation.
44
+ * @returns {Group} - A promise that returns the root `Group` of the scene.
45
+ */
46
+ exportVisual(options?: any): Group;
47
+ private getTarget;
48
+ private deriveOptionsFromParent;
49
+ }