@progress/kendo-react-barcodes 13.3.0 → 13.4.0-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Barcode.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { BarcodeProps } from './BarcodeProps.js';
9
+ import { Surface, Group, ImageExportOptions, SVGExportOptions } from '@progress/kendo-drawing';
10
+ import * as React from 'react';
11
+ /**
12
+ * Represents the KendoReact Barcode component.
13
+ */
14
+ export declare class Barcode extends React.Component<BarcodeProps, {}> {
15
+ private _baseBarcode;
16
+ /**
17
+ * @hidden
18
+ */
19
+ get barcodeInstance(): any;
20
+ /**
21
+ * Gets the Drawing `Surface` of the Barcode.
22
+ */
23
+ get surface(): Surface | null;
24
+ /**
25
+ * Gets the DOM element of the Barcode.
26
+ */
27
+ get element(): HTMLDivElement | null;
28
+ /**
29
+ * @hidden
30
+ */
31
+ render(): any;
32
+ /**
33
+ * Exports the component as an image. The export operation runs asynchronously and returns a promise.
34
+ *
35
+ * @param {ImageExportOptions} options - The parameters for the exported image.
36
+ * @returns {Promise<string>} - A promise that resolves with a PNG image encoded as a Data URI.
37
+ */
38
+ exportImage(options?: ImageExportOptions): Promise<string>;
39
+ /**
40
+ * Exports the component as an SVG document. The export operation runs asynchronously and returns a promise.
41
+ *
42
+ * @param options - The parameters for the exported file.
43
+ * @returns A promise that resolves with an SVG document that is encoded as a Data URI.
44
+ */
45
+ exportSVG(options?: SVGExportOptions): Promise<string>;
46
+ /**
47
+ * Exports a Barcode component as a Drawing `Scene`.
48
+ *
49
+ * @param {any} options - The parameters for the export operation.
50
+ * @returns {Group} A promise that returns the root `Group` of the scene.
51
+ */
52
+ exportVisual(options?: any): Group;
53
+ private getTarget;
54
+ private deriveOptionsFromParent;
55
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { Store } from './store/store.js';
9
+ import * as React from 'react';
10
+ /**
11
+ * @hidden
12
+ */
13
+ export interface BarcodeContextType {
14
+ observersStore: Store;
15
+ }
16
+ /**
17
+ * @hidden
18
+ */
19
+ export declare const BarcodeContext: React.Context<BarcodeContextType | null>;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { BaseBarcodeProps } from './BaseBarcodeProps.js';
9
+ import { BarcodeText, BarcodeType, Border, Padding } from './types.js';
10
+ /**
11
+ * Represents the props of the [KendoReact Barcode component](https://www.telerik.com/kendo-react-ui/components/barcodes/barcode).
12
+ */
13
+ export interface BarcodeProps extends BaseBarcodeProps {
14
+ /**
15
+ * Sets the background color of the Barcode. Accepts a valid CSS color string, including hex and rgb.
16
+ *
17
+ * @default "white"
18
+ * @example
19
+ * <Barcode background="#ffffff" />
20
+ */
21
+ background?: string;
22
+ /**
23
+ * Sets the border of the Barcode. Accepts an object implementing the `Border` interface.
24
+ *
25
+ * @example
26
+ * <Barcode border={{ color: "black", width: 2 }} />
27
+ */
28
+ border?: Border;
29
+ /**
30
+ * Shows or hides the checksum digit next to the value in the text area.
31
+ *
32
+ * @default false
33
+ * @example
34
+ * <Barcode checksum={true} />
35
+ */
36
+ checksum?: boolean;
37
+ /**
38
+ * Sets the color of the Barcode. Accepts a valid CSS color string, including hex and rgb.
39
+ *
40
+ * @default "black"
41
+ * @example
42
+ * <Barcode color="#000000" />
43
+ */
44
+ color?: string;
45
+ /**
46
+ * Sets the height of the Barcode in pixels.
47
+ * You can also set the Barcode dimensions through regular CSS styling.
48
+ *
49
+ * @example
50
+ * <Barcode height={100} />
51
+ */
52
+ height?: number;
53
+ /**
54
+ * Sets the padding of the Barcode. Accepts a numeric value or an object implementing the `Padding` interface.
55
+ *
56
+ * @default 0
57
+ * @example
58
+ * <Barcode padding={{ top: 10, bottom: 10, left: 5, right: 5 }} />
59
+ */
60
+ padding?: Padding | number;
61
+ /**
62
+ * Sets the text label configuration of the Barcode. Accepts an object implementing the `BarcodeText` interface.
63
+ *
64
+ * @example
65
+ * <Barcode text={{ visible: true, position: "bottom", color: "black" }} />
66
+ */
67
+ text?: BarcodeText;
68
+ /**
69
+ * Sets the symbology (encoding) that the Barcode will use. Accepts a value of type `BarcodeType` or a custom string.
70
+ *
71
+ * @default "Code39"
72
+ * @example
73
+ * <Barcode type="Code128" />
74
+ */
75
+ type: BarcodeType | string;
76
+ /**
77
+ * Sets the value of the Barcode. Accepts a string or a number.
78
+ *
79
+ * @example
80
+ * <Barcode value="123456789" />
81
+ */
82
+ value: number | string;
83
+ /**
84
+ * Sets the width of the Barcode in pixels.
85
+ * You can also set the Barcode dimensions through regular CSS styling.
86
+ *
87
+ * @example
88
+ * <Barcode width={200} />
89
+ */
90
+ width?: number;
91
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { default as PropTypes } from 'prop-types';
9
+ import { Surface } from '@progress/kendo-drawing';
10
+ import { BaseBarcodePrivateProps } from './BaseBarcodeProps.js';
11
+ import { BarcodeContextType } from './BarcodeContext.js';
12
+ import * as React from 'react';
13
+ /**
14
+ * @hidden
15
+ */
16
+ export declare class BaseBarcode extends React.Component<BaseBarcodePrivateProps, {}> {
17
+ /**
18
+ * @hidden
19
+ */
20
+ static propTypes: {
21
+ dir: PropTypes.Requireable<string>;
22
+ renderAs: PropTypes.Requireable<string>;
23
+ };
24
+ /**
25
+ * @hidden
26
+ */
27
+ static defaultProps: {
28
+ renderAs: string;
29
+ };
30
+ /**
31
+ * @hidden
32
+ */
33
+ barcodeInstance: any | null;
34
+ /**
35
+ * @hidden
36
+ */
37
+ surface: Surface | null;
38
+ /**
39
+ * @hidden
40
+ */
41
+ get element(): HTMLDivElement;
42
+ protected _element: HTMLDivElement | null;
43
+ protected contextValue: BarcodeContextType;
44
+ protected observersStore: any;
45
+ private readonly showLicenseWatermark;
46
+ private readonly licenseMessage?;
47
+ constructor(props: BaseBarcodePrivateProps);
48
+ /**
49
+ * @hidden
50
+ */
51
+ componentDidMount(): void;
52
+ /**
53
+ * @hidden
54
+ */
55
+ componentDidUpdate(prevProps: any): void;
56
+ /**
57
+ * @hidden
58
+ */
59
+ componentWillUnmount(): void;
60
+ /**
61
+ * @hidden
62
+ */
63
+ render(): any;
64
+ /**
65
+ * @hidden
66
+ */
67
+ instantiateCoreBarcode(): void;
68
+ /**
69
+ * @hidden
70
+ */
71
+ refresh(): void;
72
+ /**
73
+ * @hidden
74
+ */
75
+ getBarcodeOptions(): any;
76
+ /**
77
+ * @hidden
78
+ */
79
+ trigger(name: string, e: any): void;
80
+ /**
81
+ * @hidden
82
+ */
83
+ onWindowResize: () => void;
84
+ }
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { Barcodes } from './common/barcodes.js';
9
+ import { RenderMode } from './types.js';
10
+ /**
11
+ * @hidden
12
+ */
13
+ export interface BaseBarcodePrivateProps extends BaseBarcodeProps {
14
+ /**
15
+ * @hidden
16
+ */
17
+ deriveOptionsFromParent?: (options: any) => any;
18
+ /**
19
+ * @hidden
20
+ */
21
+ barcodeConstructor: any;
22
+ /**
23
+ * @hidden
24
+ */
25
+ getTarget: () => Barcodes;
26
+ }
27
+ /**
28
+ * @hidden
29
+ */
30
+ export interface BaseBarcodeProps {
31
+ /**
32
+ * @hidden
33
+ */
34
+ children?: React.ReactNode;
35
+ /**
36
+ * Sets the styles that the component applies.
37
+ *
38
+ * @example
39
+ * <Barcode style={{ backgroundColor: "lightgray" }} />
40
+ */
41
+ style?: React.CSSProperties;
42
+ /**
43
+ * Sets additional CSS classes to the component.
44
+ *
45
+ * @example
46
+ * <Barcode className="custom-barcode-class" />
47
+ */
48
+ className?: string;
49
+ /**
50
+ * Sets the preferred rendering engine.
51
+ *
52
+ * The supported values are:
53
+ * - `"svg"`&mdash;If available, renders the component as an inline `svg` element.
54
+ * - `"canvas"`&mdash;If available, renders the component as a `canvas` element.
55
+ *
56
+ * @example
57
+ * <Barcode renderAs="svg" />
58
+ */
59
+ renderAs?: RenderMode;
60
+ }
package/QRCode.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { QRCodeProps } from './QRCodeProps.js';
9
+ import { Surface, Group, ImageExportOptions, SVGExportOptions } from '@progress/kendo-drawing';
10
+ import * as React from 'react';
11
+ /**
12
+ * Represents the KendoReact QRCode component.
13
+ */
14
+ export declare class QRCode extends React.Component<QRCodeProps, {}> {
15
+ private _baseBarcode;
16
+ /**
17
+ * @hidden
18
+ */
19
+ get barcodeInstance(): any;
20
+ /**
21
+ * Gets the Drawing `Surface` of the Barcode.
22
+ */
23
+ get surface(): Surface | null;
24
+ /**
25
+ * Gets the DOM element of the Barcode.
26
+ */
27
+ get element(): HTMLDivElement | null;
28
+ /**
29
+ * @hidden
30
+ */
31
+ render(): any;
32
+ /**
33
+ * Exports the component as an image. The export operation runs asynchronously and returns a promise.
34
+ *
35
+ * @param {ImageExportOptions} options - The parameters for the exported image.
36
+ * @returns {Promise<string>} - A promise that resolves with a PNG image encoded as a Data URI.
37
+ */
38
+ exportImage(options?: ImageExportOptions): Promise<string>;
39
+ /**
40
+ * Exports the component as an SVG document. The export operation runs asynchronously and returns a promise.
41
+ *
42
+ * @param options - The parameters for the exported file.
43
+ * @returns A promise that resolves with an SVG document that is encoded as a Data URI.
44
+ */
45
+ exportSVG(options?: SVGExportOptions): Promise<string>;
46
+ /**
47
+ * Exports a Barcode component as a Drawing `Scene`.
48
+ *
49
+ * @param {any} options - The parameters for the export operation.
50
+ * @returns {Group} A promise that returns the root `Group` of the scene.
51
+ */
52
+ exportVisual(options?: any): Group;
53
+ private getTarget;
54
+ private deriveOptionsFromParent;
55
+ }
@@ -0,0 +1,101 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { BaseBarcodeProps } from './BaseBarcodeProps.js';
9
+ import { Border, QRCodeEncoding, QRCodeErrorCorrection, QRCodeOverlay } from './types.js';
10
+ /**
11
+ * Represents the props of the [KendoReact QRCode component](https://www.telerik.com/kendo-react-ui/components/barcodes/qrcode).
12
+ */
13
+ export interface QRCodeProps extends BaseBarcodeProps {
14
+ /**
15
+ * Sets the background color of the QR Code. Accepts a valid CSS color string, including hex and rgb.
16
+ *
17
+ * @default "white"
18
+ * @example
19
+ * <QRCode background="#ffffff" />
20
+ */
21
+ background?: string;
22
+ /**
23
+ * Sets the border of the QR Code. Accepts an object implementing the `Border` interface.
24
+ *
25
+ * @example
26
+ * <QRCode border={{ color: "black", width: 2 }} />
27
+ */
28
+ border?: Border;
29
+ /**
30
+ * Sets the color of the QR Code. Accepts a valid CSS color string, including hex and rgb.
31
+ *
32
+ * @default "black"
33
+ * @example
34
+ * <QRCode color="#000000" />
35
+ */
36
+ color?: string;
37
+ /**
38
+ * Sets the encoding mode used to encode the value.
39
+ *
40
+ * > **Important** The UTF-8 encoding is not included in the specifications and some readers do not support it.
41
+ *
42
+ * The possible values are:
43
+ * * `"ISO_8859_1"`&mdash;Supports all characters from the [ISO/IEC 8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1) character set.
44
+ * * `"UTF_8"`&mdash;Supports all [Unicode](https://en.wikipedia.org/wiki/List_of_Unicode_characters) characters.
45
+ *
46
+ * @default "ISO_8859_1"
47
+ * @example
48
+ * <QRCode encoding="UTF_8" />
49
+ */
50
+ encoding?: QRCodeEncoding;
51
+ /**
52
+ * Sets the error correction level to use.
53
+ *
54
+ * The possible values are:
55
+ * * `"L"`&mdash;Approximately 7% of the codewords can be restored.
56
+ * * `"M"`&mdash;Approximately 15% of the codewords can be restored.
57
+ * * `"Q"`&mdash;Approximately 25% of the codewords can be restored.
58
+ * * `"H"`&mdash;Approximately 30% of the codewords can be restored.
59
+ *
60
+ * @default "L"
61
+ * @example
62
+ * <QRCode errorCorrection="H" />
63
+ */
64
+ errorCorrection?: QRCodeErrorCorrection;
65
+ /**
66
+ * An optional image overlay that displays over the QR Code.
67
+ *
68
+ * > **Note** Always test if the code reads correctly with the applied overlay.
69
+ * > 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"`.
70
+ *
71
+ * @example
72
+ * <QRCode overlay={{ imageUrl: "https://example.com/logo.png", size: 50 }} />
73
+ */
74
+ overlay?: QRCodeOverlay;
75
+ /**
76
+ * Sets the padding of the QR Code. A numeric value sets all paddings.
77
+ *
78
+ * @default 0
79
+ * @example
80
+ * <QRCode padding={10} />
81
+ */
82
+ padding?: number;
83
+ /**
84
+ * Determines the size of a QR Code. Numeric values represent pixels.
85
+ *
86
+ * If you do not specify a size, the size will be determined from the element width and height.
87
+ * If the element has width or height of zero, a default value of 200 pixels will be used.
88
+ *
89
+ * @default "200px"
90
+ * @example
91
+ * <QRCode size={300} />
92
+ */
93
+ size?: number | string;
94
+ /**
95
+ * Sets the value of the QR Code. Accepts a string or a number.
96
+ *
97
+ * @example
98
+ * <QRCode value="https://example.com" />
99
+ */
100
+ value: number | string;
101
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { Barcode } from './../Barcode.js';
9
+ import { QRCode } from './../QRCode.js';
10
+ type Barcodes = Barcode | QRCode;
11
+ export { Barcodes };
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-charts"),require("@progress/kendo-drawing")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-charts","@progress/kendo-drawing"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactBarcodes={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoCharts,e.KendoDrawing)}(this,(function(e,t,r,s,n,o){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=a(t);const c=(e,t)=>{if(!t.type)return[];switch(t.type){case"add":return[...e,t.payload];case"remove":return e.filter((e=>e!==t.payload));default:return e}},d=e=>"object"==typeof e,l=(e,t)=>{if(Object.keys(e).length!==Object.keys(t).length)return!0;for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],n=t[r];if(d(s)&&d(n)?l(s,n):s!==n)return!0}return!1},p=(e,t)=>{if(!e||!t||(e=[].concat(e),t=[].concat(t),e.length!==t.length))return!0;for(let r=0;r<e.length;r++)if(l(e[r],t[r]))return!0;return!1},h=i.createContext(null);h.displayName="BarcodeContext";const u=Object.freeze({name:"@progress/kendo-react-barcodes",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"13.3.0",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),g=class extends i.Component{constructor(e){super(e),this.barcodeInstance=null,this.surface=null,this._element=null,this.observersStore={},this.showLicenseWatermark=!1,this.onWindowResize=()=>{null!==this.barcodeInstance&&(this.barcodeInstance.redraw(),this.trigger("render",{sender:this}))},this.showLicenseWatermark=!s.validatePackage(u,{component:"Barcode"}),this.licenseMessage=s.getLicenseMessage(u),this.observersStore=(e=>{let t,r,n=[];const o=o=>{t=e(t,o),s.canUseDOM&&(window.clearTimeout(r),r=window.setTimeout((()=>n.forEach((e=>e()))),16.666666666666668))};return o({}),{getState:()=>t,dispatch:o,subscribe:e=>(n.push(e),()=>n=n.filter((t=>t!==e)))}})(c),this.contextValue={observersStore:this.observersStore}}get element(){return this._element}componentDidMount(){this.instantiateCoreBarcode(),window.addEventListener("resize",this.onWindowResize),this.trigger("render",{sender:this})}componentDidUpdate(e){const{children:t,deriveOptionsFromParent:r,getTarget:s,barcodeConstructor:n,className:o,renderAs:a,...i}=this.props,{children:c,deriveOptionsFromParent:d,getTarget:l,barcodeConstructor:h,className:u,renderAs:g,...b}=e;if(null!==this.barcodeInstance){const e=p(b,i);(a||"svg")!==(g||"svg")?(null!==this.barcodeInstance&&(this.barcodeInstance.destroy(),this.barcodeInstance=null),this.instantiateCoreBarcode()):e&&this.refresh(),this.trigger("render",{sender:this})}}componentWillUnmount(){null!==this.barcodeInstance&&(this.barcodeInstance.destroy(),this.barcodeInstance=null),window.removeEventListener("resize",this.onWindowResize)}render(){const{style:e={},className:t,children:r}=this.props;return i.createElement(h.Provider,{value:this.contextValue},i.createElement("div",{style:e,ref:e=>{this._element=e},className:t},r,this.showLicenseWatermark&&i.createElement(s.WatermarkOverlay,{message:this.licenseMessage})))}instantiateCoreBarcode(){const{barcodeConstructor:e}=this.props,t=this.getBarcodeOptions();this.barcodeInstance=new e(this.element,t,(e=>{if("production"!==process.env.NODE_ENV)throw e;console.warn(e)}))}refresh(){if(null!==this.barcodeInstance){const e=this.getBarcodeOptions();this.barcodeInstance.setOptions(e)}}getBarcodeOptions(){const{renderAs:e,deriveOptionsFromParent:t}=this.props;let r={renderAs:e};return t&&(r=t(r)),r}trigger(e,t){const r=this.observersStore.getState();for(let s=0;s<r.length;s++)r[s].trigger(e,t)}};g.propTypes={dir:r.string,renderAs:r.oneOf(["svg","canvas"])},g.defaultProps={renderAs:"svg"};let b=g;class m extends i.Component{constructor(){super(...arguments),this._baseBarcode=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>Object.assign({},e,{background:this.props.background,border:this.props.border,checksum:this.props.checksum,color:this.props.color,height:this.props.height,padding:this.props.padding,text:this.props.text,type:this.props.type,value:this.props.value,width:this.props.width})}get barcodeInstance(){return null!==this._baseBarcode?this._baseBarcode.barcodeInstance:null}get surface(){return null!==this._baseBarcode?this._baseBarcode.surface:null}get element(){return null!==this._baseBarcode?this._baseBarcode.element:null}render(){const{children:e,className:t,...r}=this.props;return i.createElement(b,{...r,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:e=>{this._baseBarcode=e},barcodeConstructor:n.Barcode,getTarget:this.getTarget,className:s.classNames("k-barcode",t)},e)}exportImage(e={}){return o.exportImage(this.exportVisual(),e)}exportSVG(e={}){return o.exportSVG(this.exportVisual(),e)}exportVisual(e){return null!==this.barcodeInstance?this.barcodeInstance.exportVisual(e):new o.Group}}class f extends i.Component{constructor(){super(...arguments),this._baseBarcode=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>Object.assign({},e,{background:this.props.background||"#fff",border:this.props.border,color:this.props.color||"#000",encoding:this.props.encoding,errorCorrection:this.props.errorCorrection||"L",overlay:this.props.overlay||{},padding:this.props.padding,renderAs:this.props.renderAs,size:this.props.size,value:this.props.value})}get barcodeInstance(){return null!==this._baseBarcode?this._baseBarcode.barcodeInstance:null}get surface(){return null!==this._baseBarcode?this._baseBarcode.surface:null}get element(){return null!==this._baseBarcode?this._baseBarcode.element:null}render(){const{children:e,className:t,...r}=this.props;return i.createElement(b,{...r,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:e=>{this._baseBarcode=e},barcodeConstructor:n.QRCode,getTarget:this.getTarget,className:s.classNames("k-qrcode",t)},e)}exportImage(e={}){return o.exportImage(this.exportVisual(),e)}exportSVG(e={}){return o.exportSVG(this.exportVisual(),e)}exportVisual(e){return null!==this.barcodeInstance?this.barcodeInstance.exportVisual(e):new o.Group}}e.Barcode=m,e.QRCode=f}));
15
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-charts"),require("@progress/kendo-drawing")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-charts","@progress/kendo-drawing"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactBarcodes={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoCharts,e.KendoDrawing)}(this,function(e,t,r,s,n,o){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var i=a(t);const c=1e3/60,d=(e,t)=>{if(!t.type)return[];switch(t.type){case"add":return[...e,t.payload];case"remove":return e.filter(e=>e!==t.payload);default:return e}},l=e=>"object"==typeof e,p=(e,t)=>{if(Object.keys(e).length!==Object.keys(t).length)return!0;for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],n=t[r];if(l(s)&&l(n)?p(s,n):s!==n)return!0}return!1},h=(e,t)=>{if(!e||!t||(e=[].concat(e),t=[].concat(t),e.length!==t.length))return!0;for(let r=0;r<e.length;r++)if(p(e[r],t[r]))return!0;return!1},u=i.createContext(null);u.displayName="BarcodeContext";const g=Object.freeze({name:"@progress/kendo-react-barcodes",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"13.4.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),b=class extends i.Component{constructor(e){super(e),this.barcodeInstance=null,this.surface=null,this._element=null,this.observersStore={},this.showLicenseWatermark=!1,this.onWindowResize=()=>{null!==this.barcodeInstance&&(this.barcodeInstance.redraw(),this.trigger("render",{sender:this}))},this.showLicenseWatermark=!s.validatePackage(g,{component:"Barcode"}),this.licenseMessage=s.getLicenseMessage(g),this.observersStore=(e=>{let t,r,n=[];const o=o=>{t=e(t,o),s.canUseDOM&&(window.clearTimeout(r),r=window.setTimeout(()=>n.forEach(e=>e()),c))};return o({}),{getState:()=>t,dispatch:o,subscribe:e=>(n.push(e),()=>n=n.filter(t=>t!==e))}})(d),this.contextValue={observersStore:this.observersStore}}get element(){return this._element}componentDidMount(){this.instantiateCoreBarcode(),window.addEventListener("resize",this.onWindowResize),this.trigger("render",{sender:this})}componentDidUpdate(e){const{children:t,deriveOptionsFromParent:r,getTarget:s,barcodeConstructor:n,className:o,renderAs:a,...i}=this.props,{children:c,deriveOptionsFromParent:d,getTarget:l,barcodeConstructor:p,className:u,renderAs:g,...b}=e;if(null!==this.barcodeInstance){const e=h(b,i);(a||"svg")!==(g||"svg")?(null!==this.barcodeInstance&&(this.barcodeInstance.destroy(),this.barcodeInstance=null),this.instantiateCoreBarcode()):e&&this.refresh(),this.trigger("render",{sender:this})}}componentWillUnmount(){null!==this.barcodeInstance&&(this.barcodeInstance.destroy(),this.barcodeInstance=null),window.removeEventListener("resize",this.onWindowResize)}render(){const{style:e={},className:t,children:r}=this.props;return i.createElement(u.Provider,{value:this.contextValue},i.createElement("div",{style:e,ref:e=>{this._element=e},className:t},r,this.showLicenseWatermark&&i.createElement(s.WatermarkOverlay,{message:this.licenseMessage})))}instantiateCoreBarcode(){const{barcodeConstructor:e}=this.props,t=this.getBarcodeOptions();this.barcodeInstance=new e(this.element,t,e=>{if("production"!==process.env.NODE_ENV)throw e;console.warn(e)})}refresh(){if(null!==this.barcodeInstance){const e=this.getBarcodeOptions();this.barcodeInstance.setOptions(e)}}getBarcodeOptions(){const{renderAs:e,deriveOptionsFromParent:t}=this.props;let r={renderAs:e};return t&&(r=t(r)),r}trigger(e,t){const r=this.observersStore.getState();for(let s=0;s<r.length;s++)r[s].trigger(e,t)}};b.propTypes={dir:r.string,renderAs:r.oneOf(["svg","canvas"])},b.defaultProps={renderAs:"svg"};let m=b;class f extends i.Component{constructor(){super(...arguments),this._baseBarcode=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>Object.assign({},e,{background:this.props.background,border:this.props.border,checksum:this.props.checksum,color:this.props.color,height:this.props.height,padding:this.props.padding,text:this.props.text,type:this.props.type,value:this.props.value,width:this.props.width})}get barcodeInstance(){return null!==this._baseBarcode?this._baseBarcode.barcodeInstance:null}get surface(){return null!==this._baseBarcode?this._baseBarcode.surface:null}get element(){return null!==this._baseBarcode?this._baseBarcode.element:null}render(){const{children:e,className:t,...r}=this.props;return i.createElement(m,{...r,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:e=>{this._baseBarcode=e},barcodeConstructor:n.Barcode,getTarget:this.getTarget,className:s.classNames("k-barcode",t)},e)}exportImage(e={}){return o.exportImage(this.exportVisual(),e)}exportSVG(e={}){return o.exportSVG(this.exportVisual(),e)}exportVisual(e){return null!==this.barcodeInstance?this.barcodeInstance.exportVisual(e):new o.Group}}class v extends i.Component{constructor(){super(...arguments),this._baseBarcode=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>Object.assign({},e,{background:this.props.background||"#fff",border:this.props.border,color:this.props.color||"#000",encoding:this.props.encoding,errorCorrection:this.props.errorCorrection||"L",overlay:this.props.overlay||{},padding:this.props.padding,renderAs:this.props.renderAs,size:this.props.size,value:this.props.value})}get barcodeInstance(){return null!==this._baseBarcode?this._baseBarcode.barcodeInstance:null}get surface(){return null!==this._baseBarcode?this._baseBarcode.surface:null}get element(){return null!==this._baseBarcode?this._baseBarcode.element:null}render(){const{children:e,className:t,...r}=this.props;return i.createElement(m,{...r,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:e=>{this._baseBarcode=e},barcodeConstructor:n.QRCode,getTarget:this.getTarget,className:s.classNames("k-qrcode",t)},e)}exportImage(e={}){return o.exportImage(this.exportVisual(),e)}exportSVG(e={}){return o.exportSVG(this.exportVisual(),e)}exportVisual(e){return null!==this.barcodeInstance?this.barcodeInstance.exportVisual(e):new o.Group}}e.Barcode=f,e.QRCode=v});