@progress/kendo-react-barcodes 6.1.1 → 7.0.0-develop.2

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 (118) hide show
  1. package/{dist/npm/Barcode.d.ts → Barcode.d.ts} +4 -0
  2. package/BarcodeContext.d.ts +16 -0
  3. package/{dist/es/BarcodeProps.d.ts → BarcodeProps.d.ts} +4 -0
  4. package/{dist/npm/BaseBarcode.d.ts → BaseBarcode.d.ts} +4 -0
  5. package/{dist/npm/BaseBarcodeProps.d.ts → BaseBarcodeProps.d.ts} +4 -1
  6. package/LICENSE.md +1 -1
  7. package/{dist/npm/QRCode.d.ts → QRCode.d.ts} +4 -0
  8. package/{dist/es/QRCodeProps.d.ts → QRCodeProps.d.ts} +4 -0
  9. package/common/barcodes.d.ts +8 -0
  10. package/dist/cdn/js/kendo-react-barcodes.js +5 -1
  11. package/index.d.ts +10 -0
  12. package/index.js +5 -0
  13. package/index.mjs +335 -0
  14. package/package-metadata.d.ts +9 -0
  15. package/package.json +30 -45
  16. package/store/reducer.d.ts +14 -0
  17. package/{dist/es/store → store}/store.d.ts +4 -0
  18. package/{dist/es/types → types}/barcode-text.d.ts +4 -0
  19. package/types/barcode-type.d.ts +8 -0
  20. package/{dist/npm/types → types}/border.interface.d.ts +4 -0
  21. package/types/dash-type.interface.d.ts +8 -0
  22. package/types/margin.interface.d.ts +25 -0
  23. package/{dist/npm/types → types}/padding.interface.d.ts +4 -0
  24. package/types/qrcode-encoding.d.ts +8 -0
  25. package/types/qrcode-error-correction.d.ts +13 -0
  26. package/{dist/npm/types → types}/qrcode-overlay.d.ts +4 -0
  27. package/types/render-mode.d.ts +12 -0
  28. package/types.d.ts +14 -0
  29. package/utils/common.d.ts +8 -0
  30. package/about.md +0 -3
  31. package/dist/es/Barcode.d.ts +0 -49
  32. package/dist/es/Barcode.js +0 -151
  33. package/dist/es/BarcodeContext.d.ts +0 -12
  34. package/dist/es/BarcodeContext.js +0 -6
  35. package/dist/es/BarcodeProps.js +0 -1
  36. package/dist/es/BaseBarcode.d.ts +0 -75
  37. package/dist/es/BaseBarcode.js +0 -187
  38. package/dist/es/BaseBarcodeProps.d.ts +0 -45
  39. package/dist/es/BaseBarcodeProps.js +0 -1
  40. package/dist/es/QRCode.d.ts +0 -49
  41. package/dist/es/QRCode.js +0 -154
  42. package/dist/es/QRCodeProps.js +0 -1
  43. package/dist/es/common/barcodes.d.ts +0 -4
  44. package/dist/es/common/barcodes.js +0 -1
  45. package/dist/es/main.d.ts +0 -6
  46. package/dist/es/main.js +0 -4
  47. package/dist/es/package-metadata.d.ts +0 -5
  48. package/dist/es/package-metadata.js +0 -11
  49. package/dist/es/store/reducer.d.ts +0 -10
  50. package/dist/es/store/reducer.js +0 -50
  51. package/dist/es/store/store.js +0 -28
  52. package/dist/es/types/barcode-text.js +0 -1
  53. package/dist/es/types/barcode-type.d.ts +0 -4
  54. package/dist/es/types/barcode-type.js +0 -1
  55. package/dist/es/types/border.interface.d.ts +0 -18
  56. package/dist/es/types/border.interface.js +0 -1
  57. package/dist/es/types/dash-type.interface.d.ts +0 -4
  58. package/dist/es/types/dash-type.interface.js +0 -1
  59. package/dist/es/types/margin.interface.d.ts +0 -21
  60. package/dist/es/types/margin.interface.js +0 -1
  61. package/dist/es/types/padding.interface.d.ts +0 -21
  62. package/dist/es/types/padding.interface.js +0 -1
  63. package/dist/es/types/qrcode-encoding.d.ts +0 -4
  64. package/dist/es/types/qrcode-encoding.js +0 -1
  65. package/dist/es/types/qrcode-error-correction.d.ts +0 -9
  66. package/dist/es/types/qrcode-error-correction.js +0 -1
  67. package/dist/es/types/qrcode-overlay.d.ts +0 -25
  68. package/dist/es/types/qrcode-overlay.js +0 -1
  69. package/dist/es/types/render-mode.d.ts +0 -8
  70. package/dist/es/types/render-mode.js +0 -1
  71. package/dist/es/types.d.ts +0 -10
  72. package/dist/es/types.js +0 -1
  73. package/dist/es/utils/common.d.ts +0 -4
  74. package/dist/es/utils/common.js +0 -39
  75. package/dist/npm/Barcode.js +0 -154
  76. package/dist/npm/BarcodeContext.d.ts +0 -12
  77. package/dist/npm/BarcodeContext.js +0 -9
  78. package/dist/npm/BarcodeProps.d.ts +0 -61
  79. package/dist/npm/BarcodeProps.js +0 -2
  80. package/dist/npm/BaseBarcode.js +0 -190
  81. package/dist/npm/BaseBarcodeProps.js +0 -2
  82. package/dist/npm/QRCode.js +0 -157
  83. package/dist/npm/QRCodeProps.d.ts +0 -73
  84. package/dist/npm/QRCodeProps.js +0 -2
  85. package/dist/npm/common/barcodes.d.ts +0 -4
  86. package/dist/npm/common/barcodes.js +0 -2
  87. package/dist/npm/main.d.ts +0 -6
  88. package/dist/npm/main.js +0 -22
  89. package/dist/npm/package-metadata.d.ts +0 -5
  90. package/dist/npm/package-metadata.js +0 -14
  91. package/dist/npm/store/reducer.d.ts +0 -10
  92. package/dist/npm/store/reducer.js +0 -54
  93. package/dist/npm/store/store.d.ts +0 -25
  94. package/dist/npm/store/store.js +0 -31
  95. package/dist/npm/types/barcode-text.d.ts +0 -32
  96. package/dist/npm/types/barcode-text.js +0 -2
  97. package/dist/npm/types/barcode-type.d.ts +0 -4
  98. package/dist/npm/types/barcode-type.js +0 -2
  99. package/dist/npm/types/border.interface.js +0 -2
  100. package/dist/npm/types/dash-type.interface.d.ts +0 -4
  101. package/dist/npm/types/dash-type.interface.js +0 -2
  102. package/dist/npm/types/margin.interface.d.ts +0 -21
  103. package/dist/npm/types/margin.interface.js +0 -2
  104. package/dist/npm/types/padding.interface.js +0 -2
  105. package/dist/npm/types/qrcode-encoding.d.ts +0 -4
  106. package/dist/npm/types/qrcode-encoding.js +0 -2
  107. package/dist/npm/types/qrcode-error-correction.d.ts +0 -9
  108. package/dist/npm/types/qrcode-error-correction.js +0 -2
  109. package/dist/npm/types/qrcode-overlay.js +0 -2
  110. package/dist/npm/types/render-mode.d.ts +0 -8
  111. package/dist/npm/types/render-mode.js +0 -2
  112. package/dist/npm/types.d.ts +0 -10
  113. package/dist/npm/types.js +0 -2
  114. package/dist/npm/utils/common.d.ts +0 -4
  115. package/dist/npm/utils/common.js +0 -43
  116. package/dist/systemjs/kendo-react-barcodes.js +0 -1
  117. package/e2e-next/barcode.basic.tests.ts +0 -24
  118. package/e2e-next/qrcode.basic.tests.ts +0 -24
package/dist/es/QRCode.js DELETED
@@ -1,154 +0,0 @@
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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __assign = (this && this.__assign) || function () {
17
- __assign = Object.assign || function(t) {
18
- for (var s, i = 1, n = arguments.length; i < n; i++) {
19
- s = arguments[i];
20
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
- t[p] = s[p];
22
- }
23
- return t;
24
- };
25
- return __assign.apply(this, arguments);
26
- };
27
- var __rest = (this && this.__rest) || function (s, e) {
28
- var t = {};
29
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
30
- t[p] = s[p];
31
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
32
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
33
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
34
- t[p[i]] = s[p[i]];
35
- }
36
- return t;
37
- };
38
- import * as React from 'react';
39
- import { BaseBarcode } from './BaseBarcode';
40
- import { QRCode as KendoQRCode } from '@progress/kendo-charts';
41
- import { exportImage, exportSVG, Group } from '@progress/kendo-drawing';
42
- import { classNames } from '@progress/kendo-react-common';
43
- var DEFAULT_COLOR = '#000';
44
- var DEFAULT_BACKGROUND = '#fff';
45
- var DEFAULT_ERROR_CORRECTION = 'L';
46
- /**
47
- * Represents the KendoReact QRCode component.
48
- */
49
- var QRCode = /** @class */ (function (_super) {
50
- __extends(QRCode, _super);
51
- function QRCode() {
52
- var _this = _super !== null && _super.apply(this, arguments) || this;
53
- _this._baseBarcode = null;
54
- _this.getTarget = function () {
55
- return _this;
56
- };
57
- _this.deriveOptionsFromParent = function (options) {
58
- return Object.assign({}, options, {
59
- background: _this.props.background || DEFAULT_BACKGROUND,
60
- border: _this.props.border,
61
- color: _this.props.color || DEFAULT_COLOR,
62
- encoding: _this.props.encoding,
63
- errorCorrection: _this.props.errorCorrection || DEFAULT_ERROR_CORRECTION,
64
- overlay: _this.props.overlay || {},
65
- padding: _this.props.padding,
66
- renderAs: _this.props.renderAs,
67
- size: _this.props.size,
68
- value: _this.props.value
69
- });
70
- };
71
- return _this;
72
- }
73
- Object.defineProperty(QRCode.prototype, "barcodeInstance", {
74
- /**
75
- * @hidden
76
- */
77
- get: function () {
78
- if (this._baseBarcode !== null) {
79
- return this._baseBarcode.barcodeInstance;
80
- }
81
- return null;
82
- },
83
- enumerable: false,
84
- configurable: true
85
- });
86
- Object.defineProperty(QRCode.prototype, "surface", {
87
- /**
88
- * The Drawing `Surface` of the Barcode.
89
- */
90
- get: function () {
91
- if (this._baseBarcode !== null) {
92
- return this._baseBarcode.surface;
93
- }
94
- return null;
95
- },
96
- enumerable: false,
97
- configurable: true
98
- });
99
- Object.defineProperty(QRCode.prototype, "element", {
100
- /**
101
- * The DOM element of the Barcode.
102
- */
103
- get: function () {
104
- if (this._baseBarcode !== null) {
105
- return this._baseBarcode.element;
106
- }
107
- return null;
108
- },
109
- enumerable: false,
110
- configurable: true
111
- });
112
- /**
113
- * @hidden
114
- */
115
- QRCode.prototype.render = function () {
116
- var _this = this;
117
- var _a = this.props, children = _a.children, className = _a.className, baseBarcodeProps = __rest(_a, ["children", "className"]);
118
- 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));
119
- };
120
- /**
121
- * Exports the component as an image. The export operation is asynchronous and returns a promise.
122
- *
123
- * @param {ImageExportOptions} options - The parameters for the exported image.
124
- * @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
125
- */
126
- QRCode.prototype.exportImage = function (options) {
127
- if (options === void 0) { options = {}; }
128
- return exportImage(this.exportVisual(), options);
129
- };
130
- /**
131
- * Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
132
- *
133
- * @param options - The parameters for the exported file.
134
- * @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
135
- */
136
- QRCode.prototype.exportSVG = function (options) {
137
- if (options === void 0) { options = {}; }
138
- return exportSVG(this.exportVisual(), options);
139
- };
140
- /**
141
- * Exports a Barcode component as a Drawing `Scene`.
142
- *
143
- * @param {any} options - The parameters for the export operation.
144
- * @returns {Group} - A promise that returns the root `Group` of the scene.
145
- */
146
- QRCode.prototype.exportVisual = function (options) {
147
- if (this.barcodeInstance !== null) {
148
- return this.barcodeInstance.exportVisual(options);
149
- }
150
- return new Group();
151
- };
152
- return QRCode;
153
- }(React.Component));
154
- export { QRCode };
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { Barcode } from './../Barcode';
2
- import { QRCode } from './../QRCode';
3
- declare type Barcodes = Barcode | QRCode;
4
- export { Barcodes };
@@ -1 +0,0 @@
1
- export {};
package/dist/es/main.d.ts DELETED
@@ -1,6 +0,0 @@
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 };
package/dist/es/main.js DELETED
@@ -1,4 +0,0 @@
1
- import { Barcode } from './Barcode';
2
- import { QRCode } from './QRCode';
3
- export * from './types';
4
- export { Barcode, QRCode };
@@ -1,5 +0,0 @@
1
- import { PackageMetadata } from '@progress/kendo-licensing';
2
- /**
3
- * @hidden
4
- */
5
- export declare const packageMetadata: PackageMetadata;
@@ -1,11 +0,0 @@
1
- /**
2
- * @hidden
3
- */
4
- export var packageMetadata = {
5
- name: '@progress/kendo-react-barcodes',
6
- productName: 'KendoReact',
7
- productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1700063409,
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
- };
@@ -1,10 +0,0 @@
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 };
@@ -1,50 +0,0 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
- if (ar || !(i in from)) {
4
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
- ar[i] = from[i];
6
- }
7
- }
8
- return to.concat(ar || Array.prototype.slice.call(from));
9
- };
10
- /**
11
- * @hidden
12
- */
13
- var optionsReducer = function (currentState, action) {
14
- if (action.barcodeKey) {
15
- return reducers.configurationItem(currentState, action);
16
- }
17
- else {
18
- return {};
19
- }
20
- };
21
- /**
22
- * @hidden
23
- */
24
- var observersReducer = function (currentState, action) {
25
- if (action.type) {
26
- switch (action.type) {
27
- case 'add':
28
- return __spreadArray(__spreadArray([], currentState, true), [action.payload], false);
29
- case 'remove':
30
- return currentState.filter(function (element) { return element !== action.payload; });
31
- default:
32
- return currentState;
33
- }
34
- }
35
- else {
36
- return [];
37
- }
38
- };
39
- /**
40
- * @hidden
41
- */
42
- var reducers = {
43
- configurationItem: function (currentState, action) {
44
- var _a;
45
- return Object.assign(currentState, (_a = {},
46
- _a[action.barcodeKey] = action.payload,
47
- _a));
48
- }
49
- };
50
- export { optionsReducer, observersReducer };
@@ -1,28 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
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';
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * The dash line type.
3
- */
4
- export declare type DashType = 'dash' | 'dashDot' | 'dot' | 'longDash' | 'longDashDot' | 'longDashDotDot' | 'solid';
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * The QR Code encoding modes.
3
- */
4
- export declare type QRCodeEncoding = 'ISO_8859_1' | 'UTF_8';
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
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';
@@ -1 +0,0 @@
1
- export {};
@@ -1,25 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
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';
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
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';
package/dist/es/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * @hidden
3
- */
4
- export declare const isOptionsChanged: (original: any, current: any) => boolean;
@@ -1,39 +0,0 @@
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
- };
@@ -1,154 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- var __rest = (this && this.__rest) || function (s, e) {
29
- var t = {};
30
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
31
- t[p] = s[p];
32
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
33
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
34
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
35
- t[p[i]] = s[p[i]];
36
- }
37
- return t;
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.Barcode = void 0;
41
- var React = require("react");
42
- var BaseBarcode_1 = require("./BaseBarcode");
43
- var kendo_charts_1 = require("@progress/kendo-charts");
44
- var kendo_drawing_1 = require("@progress/kendo-drawing");
45
- var kendo_react_common_1 = require("@progress/kendo-react-common");
46
- /**
47
- * Represents the KendoReact Barcode component.
48
- */
49
- var Barcode = /** @class */ (function (_super) {
50
- __extends(Barcode, _super);
51
- function Barcode() {
52
- var _this = _super !== null && _super.apply(this, arguments) || this;
53
- _this._baseBarcode = null;
54
- _this.getTarget = function () {
55
- return _this;
56
- };
57
- _this.deriveOptionsFromParent = function (options) {
58
- return Object.assign({}, options, {
59
- background: _this.props.background,
60
- border: _this.props.border,
61
- checksum: _this.props.checksum,
62
- color: _this.props.color,
63
- height: _this.props.height,
64
- padding: _this.props.padding,
65
- text: _this.props.text,
66
- type: _this.props.type,
67
- value: _this.props.value,
68
- width: _this.props.width
69
- });
70
- };
71
- return _this;
72
- }
73
- Object.defineProperty(Barcode.prototype, "barcodeInstance", {
74
- /**
75
- * @hidden
76
- */
77
- get: function () {
78
- if (this._baseBarcode !== null) {
79
- return this._baseBarcode.barcodeInstance;
80
- }
81
- return null;
82
- },
83
- enumerable: false,
84
- configurable: true
85
- });
86
- Object.defineProperty(Barcode.prototype, "surface", {
87
- /**
88
- * The Drawing `Surface` of the Barcode.
89
- */
90
- get: function () {
91
- if (this._baseBarcode !== null) {
92
- return this._baseBarcode.surface;
93
- }
94
- return null;
95
- },
96
- enumerable: false,
97
- configurable: true
98
- });
99
- Object.defineProperty(Barcode.prototype, "element", {
100
- /**
101
- * The DOM element of the Barcode.
102
- */
103
- get: function () {
104
- if (this._baseBarcode !== null) {
105
- return this._baseBarcode.element;
106
- }
107
- return null;
108
- },
109
- enumerable: false,
110
- configurable: true
111
- });
112
- /**
113
- * @hidden
114
- */
115
- Barcode.prototype.render = function () {
116
- var _this = this;
117
- var _a = this.props, children = _a.children, className = _a.className, baseBarcodeProps = __rest(_a, ["children", "className"]);
118
- return (React.createElement(BaseBarcode_1.BaseBarcode, __assign({}, baseBarcodeProps, { deriveOptionsFromParent: this.deriveOptionsFromParent, ref: function (baseBarcode) { return _this._baseBarcode = baseBarcode; }, barcodeConstructor: kendo_charts_1.Barcode, getTarget: this.getTarget, className: (0, kendo_react_common_1.classNames)('k-barcode', className) }), children));
119
- };
120
- /**
121
- * Exports the component as an image. The export operation is asynchronous and returns a promise.
122
- *
123
- * @param {ImageExportOptions} options - The parameters for the exported image.
124
- * @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
125
- */
126
- Barcode.prototype.exportImage = function (options) {
127
- if (options === void 0) { options = {}; }
128
- return (0, kendo_drawing_1.exportImage)(this.exportVisual(), options);
129
- };
130
- /**
131
- * Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
132
- *
133
- * @param options - The parameters for the exported file.
134
- * @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
135
- */
136
- Barcode.prototype.exportSVG = function (options) {
137
- if (options === void 0) { options = {}; }
138
- return (0, kendo_drawing_1.exportSVG)(this.exportVisual(), options);
139
- };
140
- /**
141
- * Exports a Barcode component as a Drawing `Scene`.
142
- *
143
- * @param {any} options - The parameters for the export operation.
144
- * @returns {Group} - A promise that returns the root `Group` of the scene.
145
- */
146
- Barcode.prototype.exportVisual = function (options) {
147
- if (this.barcodeInstance !== null) {
148
- return this.barcodeInstance.exportVisual(options);
149
- }
150
- return new kendo_drawing_1.Group();
151
- };
152
- return Barcode;
153
- }(React.Component));
154
- exports.Barcode = Barcode;