@progress/kendo-react-barcodes 15.2.0-develop.1 → 15.2.0-develop.3
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 +2 -43
- package/Barcode.js +1 -1
- package/Barcode.mjs +70 -86
- package/BarcodeHandle.d.ts +47 -0
- package/BaseBarcode.d.ts +2 -72
- package/BaseBarcode.js +1 -1
- package/BaseBarcode.mjs +88 -119
- package/BaseBarcodeHandle.d.ts +19 -0
- package/QRCode.d.ts +2 -43
- package/QRCode.js +1 -1
- package/QRCode.mjs +70 -87
- package/QRCodeHandle.d.ts +47 -0
- package/common/barcodes.d.ts +3 -3
- package/dist/cdn/js/kendo-react-barcodes.js +1 -1
- package/index.d.mts +3 -1
- package/index.d.ts +3 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +5 -5
package/Barcode.d.ts
CHANGED
|
@@ -6,50 +6,9 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { BarcodeProps } from './BarcodeProps';
|
|
9
|
-
import {
|
|
9
|
+
import { BarcodeHandle } from './BarcodeHandle';
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
/**
|
|
12
12
|
* Represents the KendoReact Barcode component.
|
|
13
13
|
*/
|
|
14
|
-
export declare
|
|
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
|
-
}
|
|
14
|
+
export declare const Barcode: React.ForwardRefExoticComponent<BarcodeProps & React.RefAttributes<BarcodeHandle>>;
|
package/Barcode.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),B=require("./BaseBarcode.js"),v=require("@progress/kendo-charts"),d=require("@progress/kendo-drawing"),y=require("@progress/kendo-react-common");function I(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const s=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(o,c,s.get?s:{enumerable:!0,get:()=>e[c]})}}return o.default=e,Object.freeze(o)}const n=I(h),m=n.forwardRef((e,o)=>{const{children:c,className:s,...k}=e,u=n.useRef(null),i=n.useRef(e);i.current=e;const a=n.useCallback(t=>{var f;const r=(f=u.current)==null?void 0:f.barcodeInstance;return r!=null?r.exportVisual(t):new d.Group},[]),g=n.useCallback((t={})=>d.exportImage(a(),t),[a]),b=n.useCallback((t={})=>d.exportSVG(a(),t),[a]),l=n.useRef(null);n.useImperativeHandle(l,()=>({get element(){var t,r;return(r=(t=u.current)==null?void 0:t.element)!=null?r:null},get props(){return i.current},get barcodeInstance(){var t,r;return(r=(t=u.current)==null?void 0:t.barcodeInstance)!=null?r:null},get surface(){var t,r;return(r=(t=u.current)==null?void 0:t.surface)!=null?r:null},exportImage:g,exportSVG:b,exportVisual:a}),[g,b,a]),n.useImperativeHandle(o,()=>l.current,[]);const x=()=>l.current,R=t=>({...t,background:e.background,border:e.border,checksum:e.checksum,color:e.color,height:e.height,padding:e.padding,text:e.text,type:e.type,value:e.value,width:e.width});return n.createElement(B.BaseBarcode,{...k,deriveOptionsFromParent:R,ref:u,barcodeConstructor:v.Barcode,getTarget:x,className:y.classNames("k-barcode",s)},c)});m.displayName="KendoReactBarcode";exports.Barcode=m;
|
package/Barcode.mjs
CHANGED
|
@@ -5,92 +5,76 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { BaseBarcode as
|
|
10
|
-
import { Barcode as
|
|
11
|
-
import {
|
|
12
|
-
import { classNames as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Gets the Drawing `Surface` of the Barcode.
|
|
36
|
-
*/
|
|
37
|
-
get surface() {
|
|
38
|
-
return this._baseBarcode !== null ? this._baseBarcode.surface : null;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Gets the DOM element of the Barcode.
|
|
42
|
-
*/
|
|
43
|
-
get element() {
|
|
44
|
-
return this._baseBarcode !== null ? this._baseBarcode.element : null;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* @hidden
|
|
48
|
-
*/
|
|
49
|
-
render() {
|
|
50
|
-
const { children: e, className: t, ...s } = this.props;
|
|
51
|
-
return /* @__PURE__ */ r.createElement(
|
|
52
|
-
a,
|
|
53
|
-
{
|
|
54
|
-
...s,
|
|
55
|
-
deriveOptionsFromParent: this.deriveOptionsFromParent,
|
|
56
|
-
ref: (o) => {
|
|
57
|
-
this._baseBarcode = o;
|
|
58
|
-
},
|
|
59
|
-
barcodeConstructor: i,
|
|
60
|
-
getTarget: this.getTarget,
|
|
61
|
-
className: u("k-barcode", t)
|
|
8
|
+
import * as a from "react";
|
|
9
|
+
import { BaseBarcode as h } from "./BaseBarcode.mjs";
|
|
10
|
+
import { Barcode as R } from "@progress/kendo-charts";
|
|
11
|
+
import { Group as k, exportImage as B, exportSVG as I } from "@progress/kendo-drawing";
|
|
12
|
+
import { classNames as v } from "@progress/kendo-react-common";
|
|
13
|
+
const V = a.forwardRef((r, m) => {
|
|
14
|
+
const { children: i, className: g, ...f } = r, c = a.useRef(null), u = a.useRef(r);
|
|
15
|
+
u.current = r;
|
|
16
|
+
const n = a.useCallback((e) => {
|
|
17
|
+
var d;
|
|
18
|
+
const t = (d = c.current) == null ? void 0 : d.barcodeInstance;
|
|
19
|
+
return t != null ? t.exportVisual(e) : new k();
|
|
20
|
+
}, []), l = a.useCallback(
|
|
21
|
+
(e = {}) => B(n(), e),
|
|
22
|
+
[n]
|
|
23
|
+
), s = a.useCallback(
|
|
24
|
+
(e = {}) => I(n(), e),
|
|
25
|
+
[n]
|
|
26
|
+
), o = a.useRef(null);
|
|
27
|
+
a.useImperativeHandle(
|
|
28
|
+
o,
|
|
29
|
+
() => ({
|
|
30
|
+
get element() {
|
|
31
|
+
var e, t;
|
|
32
|
+
return (t = (e = c.current) == null ? void 0 : e.element) != null ? t : null;
|
|
62
33
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
34
|
+
get props() {
|
|
35
|
+
return u.current;
|
|
36
|
+
},
|
|
37
|
+
get barcodeInstance() {
|
|
38
|
+
var e, t;
|
|
39
|
+
return (t = (e = c.current) == null ? void 0 : e.barcodeInstance) != null ? t : null;
|
|
40
|
+
},
|
|
41
|
+
get surface() {
|
|
42
|
+
var e, t;
|
|
43
|
+
return (t = (e = c.current) == null ? void 0 : e.surface) != null ? t : null;
|
|
44
|
+
},
|
|
45
|
+
exportImage: l,
|
|
46
|
+
exportSVG: s,
|
|
47
|
+
exportVisual: n
|
|
48
|
+
}),
|
|
49
|
+
[l, s, n]
|
|
50
|
+
), a.useImperativeHandle(m, () => o.current, []);
|
|
51
|
+
const b = () => o.current, x = (e) => ({
|
|
52
|
+
...e,
|
|
53
|
+
background: r.background,
|
|
54
|
+
border: r.border,
|
|
55
|
+
checksum: r.checksum,
|
|
56
|
+
color: r.color,
|
|
57
|
+
height: r.height,
|
|
58
|
+
padding: r.padding,
|
|
59
|
+
text: r.text,
|
|
60
|
+
type: r.type,
|
|
61
|
+
value: r.value,
|
|
62
|
+
width: r.width
|
|
63
|
+
});
|
|
64
|
+
return /* @__PURE__ */ a.createElement(
|
|
65
|
+
h,
|
|
66
|
+
{
|
|
67
|
+
...f,
|
|
68
|
+
deriveOptionsFromParent: x,
|
|
69
|
+
ref: c,
|
|
70
|
+
barcodeConstructor: R,
|
|
71
|
+
getTarget: b,
|
|
72
|
+
className: v("k-barcode", g)
|
|
73
|
+
},
|
|
74
|
+
i
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
V.displayName = "KendoReactBarcode";
|
|
94
78
|
export {
|
|
95
|
-
|
|
79
|
+
V as Barcode
|
|
96
80
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { Surface, Group, ImageExportOptions, SVGExportOptions } from '@progress/kendo-drawing';
|
|
9
|
+
import { BarcodeProps } from './BarcodeProps';
|
|
10
|
+
/**
|
|
11
|
+
* Represents the `ref` of the Barcode component.
|
|
12
|
+
*/
|
|
13
|
+
export interface BarcodeHandle {
|
|
14
|
+
/** The current root DOM element or `null`. */
|
|
15
|
+
element: HTMLDivElement | null;
|
|
16
|
+
/** The props of the Barcode component. */
|
|
17
|
+
readonly props: Readonly<BarcodeProps>;
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
barcodeInstance: any;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the Drawing `Surface` of the Barcode.
|
|
24
|
+
*/
|
|
25
|
+
surface: Surface | null;
|
|
26
|
+
/**
|
|
27
|
+
* Exports the component as an image. The export operation runs asynchronously and returns a promise.
|
|
28
|
+
*
|
|
29
|
+
* @param options - The parameters for the exported image.
|
|
30
|
+
* @returns A promise that resolves 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 runs asynchronously and returns a promise.
|
|
35
|
+
*
|
|
36
|
+
* @param options - The parameters for the exported file.
|
|
37
|
+
* @returns A promise that resolves 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 options - The parameters for the export operation.
|
|
44
|
+
* @returns The root `Group` of the scene.
|
|
45
|
+
*/
|
|
46
|
+
exportVisual: (options?: any) => Group;
|
|
47
|
+
}
|
package/BaseBarcode.d.ts
CHANGED
|
@@ -5,80 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as PropTypes } from 'prop-types';
|
|
9
|
-
import { Surface } from '@progress/kendo-drawing';
|
|
10
8
|
import { BaseBarcodePrivateProps } from './BaseBarcodeProps';
|
|
11
|
-
import {
|
|
9
|
+
import { BaseBarcodeHandle } from './BaseBarcodeHandle';
|
|
12
10
|
import * as React from 'react';
|
|
13
11
|
/**
|
|
14
12
|
* @hidden
|
|
15
13
|
*/
|
|
16
|
-
export declare
|
|
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
|
-
}
|
|
14
|
+
export declare const BaseBarcode: React.ForwardRefExoticComponent<BaseBarcodePrivateProps & React.RefAttributes<BaseBarcodeHandle>>;
|
package/BaseBarcode.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),h=require("prop-types"),x=require("./store/store.js"),z=require("./store/reducer.js"),I=require("./utils/common.js"),L=require("./BarcodeContext.js"),m=require("@progress/kendo-react-common"),P=require("./package-metadata.js");function _(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(o,s,a.get?a:{enumerable:!0,get:()=>t[s]})}}return o.default=t,Object.freeze(o)}const e=_(F),H={renderAs:"svg"},v=e.forwardRef((t,o)=>{const{renderAs:s=H.renderAs,style:a={},className:w,children:y,barcodeConstructor:M,deriveOptionsFromParent:O,getTarget:i}=t,l=e.useRef(null),r=e.useRef(null),u=e.useRef(null),E=e.useMemo(()=>!m.validatePackage(P.packageMetadata,{component:"Barcode"}),[]),N=e.useMemo(()=>m.getLicenseMessage(P.packageMetadata),[]),f=e.useMemo(()=>x.createStore(z.observersReducer),[]),T=e.useMemo(()=>({observersStore:f}),[f]),b=()=>{let n={renderAs:s};return O&&(n=O(n)),n},R=()=>{const n=b();r.current=new M(l.current,n,c=>{if(process.env.NODE_ENV!=="production")throw c;console.warn(c)})},k=()=>{if(r.current!==null){const n=b();r.current.setOptions(n)}},g=(n,c)=>{const p=f.getState();for(let d=0;d<p.length;d++)p[d].trigger(n,c)},B=()=>{r.current!==null&&(r.current.redraw(),g("render",{sender:i()}))},C=e.useRef(null);return e.useImperativeHandle(C,()=>({get barcodeInstance(){return r.current},get surface(){return null},get element(){return l.current}}),[]),e.useImperativeHandle(o,()=>C.current,[]),e.useEffect(()=>(R(),window.addEventListener("resize",B),g("render",{sender:i()}),()=>{r.current!==null&&(r.current.destroy(),r.current=null),window.removeEventListener("resize",B)}),[]),e.useEffect(()=>{if(u.current===null){u.current=t;return}const{children:n,deriveOptionsFromParent:c,getTarget:p,barcodeConstructor:d,className:W,renderAs:q,...A}=t,{children:G,deriveOptionsFromParent:V,getTarget:K,barcodeConstructor:J,className:Q,renderAs:S,...D}=u.current;if(r.current!==null){const j=I.isOptionsChanged(D,A);(q||"svg")!==(S||"svg")?(r.current!==null&&(r.current.destroy(),r.current=null),R()):j&&k(),g("render",{sender:i()})}u.current=t}),e.createElement(L.BarcodeContext.Provider,{value:T},e.createElement("div",{style:a,ref:l,className:w},y,E&&e.createElement(m.WatermarkOverlay,{message:N})))});v.propTypes={dir:h.string,renderAs:h.oneOf(["svg","canvas"])};v.displayName="KendoReactBaseBarcode";exports.BaseBarcode=v;
|
package/BaseBarcode.mjs
CHANGED
|
@@ -5,128 +5,97 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import { createStore as
|
|
11
|
-
import { observersReducer as
|
|
12
|
-
import { isOptionsChanged as
|
|
13
|
-
import { BarcodeContext as
|
|
14
|
-
import { validatePackage as
|
|
15
|
-
import { packageMetadata as
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
componentDidMount() {
|
|
34
|
-
this.instantiateCoreBarcode(), window.addEventListener("resize", this.onWindowResize), this.trigger("render", { sender: this });
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* @hidden
|
|
38
|
-
*/
|
|
39
|
-
componentDidUpdate(e) {
|
|
40
|
-
const {
|
|
41
|
-
children: r,
|
|
42
|
-
deriveOptionsFromParent: t,
|
|
43
|
-
getTarget: s,
|
|
44
|
-
barcodeConstructor: C,
|
|
45
|
-
className: I,
|
|
46
|
-
renderAs: d,
|
|
47
|
-
...h
|
|
48
|
-
} = this.props, {
|
|
49
|
-
children: P,
|
|
50
|
-
deriveOptionsFromParent: W,
|
|
51
|
-
getTarget: E,
|
|
52
|
-
barcodeConstructor: S,
|
|
53
|
-
className: k,
|
|
54
|
-
renderAs: l,
|
|
55
|
-
...p
|
|
56
|
-
} = e;
|
|
57
|
-
if (this.barcodeInstance !== null) {
|
|
58
|
-
const m = u(p, h);
|
|
59
|
-
(d || "svg") !== (l || "svg") ? (this.barcodeInstance !== null && (this.barcodeInstance.destroy(), this.barcodeInstance = null), this.instantiateCoreBarcode()) : m && this.refresh(), this.trigger("render", { sender: this });
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* @hidden
|
|
64
|
-
*/
|
|
65
|
-
componentWillUnmount() {
|
|
66
|
-
this.barcodeInstance !== null && (this.barcodeInstance.destroy(), this.barcodeInstance = null), window.removeEventListener("resize", this.onWindowResize);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* @hidden
|
|
70
|
-
*/
|
|
71
|
-
render() {
|
|
72
|
-
const { style: e = {}, className: r, children: t } = this.props;
|
|
73
|
-
return /* @__PURE__ */ n.createElement(b.Provider, { value: this.contextValue }, /* @__PURE__ */ n.createElement(
|
|
74
|
-
"div",
|
|
75
|
-
{
|
|
76
|
-
style: e,
|
|
77
|
-
ref: (s) => {
|
|
78
|
-
this._element = s;
|
|
79
|
-
},
|
|
80
|
-
className: r
|
|
81
|
-
},
|
|
82
|
-
t,
|
|
83
|
-
this.showLicenseWatermark && /* @__PURE__ */ n.createElement(w, { message: this.licenseMessage })
|
|
84
|
-
));
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* @hidden
|
|
88
|
-
*/
|
|
89
|
-
instantiateCoreBarcode() {
|
|
90
|
-
const { barcodeConstructor: e } = this.props, r = this.getBarcodeOptions();
|
|
91
|
-
this.barcodeInstance = new e(this.element, r, (t) => {
|
|
8
|
+
import * as e from "react";
|
|
9
|
+
import O from "prop-types";
|
|
10
|
+
import { createStore as I } from "./store/store.mjs";
|
|
11
|
+
import { observersReducer as L } from "./store/reducer.mjs";
|
|
12
|
+
import { isOptionsChanged as z } from "./utils/common.mjs";
|
|
13
|
+
import { BarcodeContext as H } from "./BarcodeContext.mjs";
|
|
14
|
+
import { validatePackage as S, getLicenseMessage as W, WatermarkOverlay as G } from "@progress/kendo-react-common";
|
|
15
|
+
import { packageMetadata as R } from "./package-metadata.mjs";
|
|
16
|
+
const V = {
|
|
17
|
+
renderAs: "svg"
|
|
18
|
+
}, b = e.forwardRef((s, h) => {
|
|
19
|
+
const {
|
|
20
|
+
renderAs: C = V.renderAs,
|
|
21
|
+
style: B = {},
|
|
22
|
+
className: w,
|
|
23
|
+
children: P,
|
|
24
|
+
barcodeConstructor: E,
|
|
25
|
+
deriveOptionsFromParent: m,
|
|
26
|
+
getTarget: a
|
|
27
|
+
} = s, u = e.useRef(null), r = e.useRef(null), o = e.useRef(null), A = e.useMemo(() => !S(R, { component: "Barcode" }), []), N = e.useMemo(() => W(R), []), i = e.useMemo(() => I(L), []), y = e.useMemo(() => ({ observersStore: i }), [i]), f = () => {
|
|
28
|
+
let t = { renderAs: C };
|
|
29
|
+
return m && (t = m(t)), t;
|
|
30
|
+
}, p = () => {
|
|
31
|
+
const t = f();
|
|
32
|
+
r.current = new E(u.current, t, (n) => {
|
|
92
33
|
if (process.env.NODE_ENV !== "production")
|
|
93
|
-
throw
|
|
94
|
-
console.warn(
|
|
34
|
+
throw n;
|
|
35
|
+
console.warn(n);
|
|
95
36
|
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
refresh() {
|
|
101
|
-
if (this.barcodeInstance !== null) {
|
|
102
|
-
const e = this.getBarcodeOptions();
|
|
103
|
-
this.barcodeInstance.setOptions(e);
|
|
37
|
+
}, M = () => {
|
|
38
|
+
if (r.current !== null) {
|
|
39
|
+
const t = f();
|
|
40
|
+
r.current.setOptions(t);
|
|
104
41
|
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
42
|
+
}, d = (t, n) => {
|
|
43
|
+
const l = i.getState();
|
|
44
|
+
for (let c = 0; c < l.length; c++)
|
|
45
|
+
l[c].trigger(t, n);
|
|
46
|
+
}, v = () => {
|
|
47
|
+
r.current !== null && (r.current.redraw(), d("render", { sender: a() }));
|
|
48
|
+
}, g = e.useRef(null);
|
|
49
|
+
return e.useImperativeHandle(
|
|
50
|
+
g,
|
|
51
|
+
() => ({
|
|
52
|
+
get barcodeInstance() {
|
|
53
|
+
return r.current;
|
|
54
|
+
},
|
|
55
|
+
get surface() {
|
|
56
|
+
return null;
|
|
57
|
+
},
|
|
58
|
+
get element() {
|
|
59
|
+
return u.current;
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
[]
|
|
63
|
+
), e.useImperativeHandle(h, () => g.current, []), e.useEffect(() => (p(), window.addEventListener("resize", v), d("render", { sender: a() }), () => {
|
|
64
|
+
r.current !== null && (r.current.destroy(), r.current = null), window.removeEventListener("resize", v);
|
|
65
|
+
}), []), e.useEffect(() => {
|
|
66
|
+
if (o.current === null) {
|
|
67
|
+
o.current = s;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const {
|
|
71
|
+
children: t,
|
|
72
|
+
deriveOptionsFromParent: n,
|
|
73
|
+
getTarget: l,
|
|
74
|
+
barcodeConstructor: c,
|
|
75
|
+
className: K,
|
|
76
|
+
renderAs: T,
|
|
77
|
+
...F
|
|
78
|
+
} = s, {
|
|
79
|
+
children: _,
|
|
80
|
+
deriveOptionsFromParent: j,
|
|
81
|
+
getTarget: q,
|
|
82
|
+
barcodeConstructor: J,
|
|
83
|
+
className: Q,
|
|
84
|
+
renderAs: k,
|
|
85
|
+
...x
|
|
86
|
+
} = o.current;
|
|
87
|
+
if (r.current !== null) {
|
|
88
|
+
const D = z(x, F);
|
|
89
|
+
(T || "svg") !== (k || "svg") ? (r.current !== null && (r.current.destroy(), r.current = null), p()) : D && M(), d("render", { sender: a() });
|
|
90
|
+
}
|
|
91
|
+
o.current = s;
|
|
92
|
+
}), /* @__PURE__ */ e.createElement(H.Provider, { value: y }, /* @__PURE__ */ e.createElement("div", { style: B, ref: u, className: w }, P, A && /* @__PURE__ */ e.createElement(G, { message: N })));
|
|
93
|
+
});
|
|
94
|
+
b.propTypes = {
|
|
95
|
+
dir: O.string,
|
|
96
|
+
renderAs: O.oneOf(["svg", "canvas"])
|
|
128
97
|
};
|
|
129
|
-
|
|
98
|
+
b.displayName = "KendoReactBaseBarcode";
|
|
130
99
|
export {
|
|
131
|
-
|
|
100
|
+
b as BaseBarcode
|
|
132
101
|
};
|
|
@@ -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 { Surface } from '@progress/kendo-drawing';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export interface BaseBarcodeHandle {
|
|
13
|
+
/** @hidden */
|
|
14
|
+
barcodeInstance: any;
|
|
15
|
+
/** @hidden */
|
|
16
|
+
surface: Surface | null;
|
|
17
|
+
/** @hidden */
|
|
18
|
+
element: HTMLDivElement | null;
|
|
19
|
+
}
|
package/QRCode.d.ts
CHANGED
|
@@ -6,50 +6,9 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { QRCodeProps } from './QRCodeProps';
|
|
9
|
-
import {
|
|
9
|
+
import { QRCodeHandle } from './QRCodeHandle';
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
/**
|
|
12
12
|
* Represents the KendoReact QRCode component.
|
|
13
13
|
*/
|
|
14
|
-
export declare
|
|
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
|
-
}
|
|
14
|
+
export declare const QRCode: React.ForwardRefExoticComponent<QRCodeProps & React.RefAttributes<QRCodeHandle>>;
|
package/QRCode.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),v=require("./BaseBarcode.js"),x=require("@progress/kendo-charts"),d=require("@progress/kendo-drawing"),E=require("@progress/kendo-react-common");function I(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(a,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return a.default=e,Object.freeze(a)}const n=I(k),y="#000",q="#fff",B="L",b=n.forwardRef((e,a)=>{const{children:o,className:s,...m}=e,u=n.useRef(null),i=n.useRef(e);i.current=e;const c=n.useCallback(r=>{var R;const t=(R=u.current)==null?void 0:R.barcodeInstance;return t!=null?t.exportVisual(r):new d.Group},[]),g=n.useCallback((r={})=>d.exportImage(c(),r),[c]),f=n.useCallback((r={})=>d.exportSVG(c(),r),[c]),l=n.useRef(null);n.useImperativeHandle(l,()=>({get element(){var r,t;return(t=(r=u.current)==null?void 0:r.element)!=null?t:null},get props(){return i.current},get barcodeInstance(){var r,t;return(t=(r=u.current)==null?void 0:r.barcodeInstance)!=null?t:null},get surface(){var r,t;return(t=(r=u.current)==null?void 0:r.surface)!=null?t:null},exportImage:g,exportSVG:f,exportVisual:c}),[g,f,c]),n.useImperativeHandle(a,()=>l.current,[]);const C=()=>l.current,O=r=>({...r,background:e.background||q,border:e.border,color:e.color||y,encoding:e.encoding,errorCorrection:e.errorCorrection||B,overlay:e.overlay||{},padding:e.padding,renderAs:e.renderAs,size:e.size,value:e.value});return n.createElement(v.BaseBarcode,{...m,deriveOptionsFromParent:O,ref:u,barcodeConstructor:x.QRCode,getTarget:C,className:E.classNames("k-qrcode",s)},o)});b.displayName="KendoReactQRCode";exports.QRCode=b;
|
package/QRCode.mjs
CHANGED
|
@@ -5,93 +5,76 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { BaseBarcode as
|
|
10
|
-
import { QRCode as
|
|
11
|
-
import {
|
|
12
|
-
import { classNames as
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return this._baseBarcode !== null ? this._baseBarcode.barcodeInstance : null;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Gets the Drawing `Surface` of the Barcode.
|
|
37
|
-
*/
|
|
38
|
-
get surface() {
|
|
39
|
-
return this._baseBarcode !== null ? this._baseBarcode.surface : null;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Gets the DOM element of the Barcode.
|
|
43
|
-
*/
|
|
44
|
-
get element() {
|
|
45
|
-
return this._baseBarcode !== null ? this._baseBarcode.element : null;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* @hidden
|
|
49
|
-
*/
|
|
50
|
-
render() {
|
|
51
|
-
const { children: r, className: t, ...s } = this.props;
|
|
52
|
-
return /* @__PURE__ */ e.createElement(
|
|
53
|
-
a,
|
|
54
|
-
{
|
|
55
|
-
...s,
|
|
56
|
-
deriveOptionsFromParent: this.deriveOptionsFromParent,
|
|
57
|
-
ref: (o) => {
|
|
58
|
-
this._baseBarcode = o;
|
|
59
|
-
},
|
|
60
|
-
barcodeConstructor: n,
|
|
61
|
-
getTarget: this.getTarget,
|
|
62
|
-
className: d("k-qrcode", t)
|
|
8
|
+
import * as n from "react";
|
|
9
|
+
import { BaseBarcode as b } from "./BaseBarcode.mjs";
|
|
10
|
+
import { QRCode as x } from "@progress/kendo-charts";
|
|
11
|
+
import { Group as E, exportImage as I, exportSVG as v } from "@progress/kendo-drawing";
|
|
12
|
+
import { classNames as O } from "@progress/kendo-react-common";
|
|
13
|
+
const k = "#000", A = "#fff", N = "L", V = n.forwardRef((r, i) => {
|
|
14
|
+
const { children: m, className: f, ...R } = r, a = n.useRef(null), u = n.useRef(r);
|
|
15
|
+
u.current = r;
|
|
16
|
+
const o = n.useCallback((e) => {
|
|
17
|
+
var d;
|
|
18
|
+
const t = (d = a.current) == null ? void 0 : d.barcodeInstance;
|
|
19
|
+
return t != null ? t.exportVisual(e) : new E();
|
|
20
|
+
}, []), s = n.useCallback(
|
|
21
|
+
(e = {}) => I(o(), e),
|
|
22
|
+
[o]
|
|
23
|
+
), l = n.useCallback(
|
|
24
|
+
(e = {}) => v(o(), e),
|
|
25
|
+
[o]
|
|
26
|
+
), c = n.useRef(null);
|
|
27
|
+
n.useImperativeHandle(
|
|
28
|
+
c,
|
|
29
|
+
() => ({
|
|
30
|
+
get element() {
|
|
31
|
+
var e, t;
|
|
32
|
+
return (t = (e = a.current) == null ? void 0 : e.element) != null ? t : null;
|
|
63
33
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
34
|
+
get props() {
|
|
35
|
+
return u.current;
|
|
36
|
+
},
|
|
37
|
+
get barcodeInstance() {
|
|
38
|
+
var e, t;
|
|
39
|
+
return (t = (e = a.current) == null ? void 0 : e.barcodeInstance) != null ? t : null;
|
|
40
|
+
},
|
|
41
|
+
get surface() {
|
|
42
|
+
var e, t;
|
|
43
|
+
return (t = (e = a.current) == null ? void 0 : e.surface) != null ? t : null;
|
|
44
|
+
},
|
|
45
|
+
exportImage: s,
|
|
46
|
+
exportSVG: l,
|
|
47
|
+
exportVisual: o
|
|
48
|
+
}),
|
|
49
|
+
[s, l, o]
|
|
50
|
+
), n.useImperativeHandle(i, () => c.current, []);
|
|
51
|
+
const g = () => c.current, C = (e) => ({
|
|
52
|
+
...e,
|
|
53
|
+
background: r.background || A,
|
|
54
|
+
border: r.border,
|
|
55
|
+
color: r.color || k,
|
|
56
|
+
encoding: r.encoding,
|
|
57
|
+
errorCorrection: r.errorCorrection || N,
|
|
58
|
+
overlay: r.overlay || {},
|
|
59
|
+
padding: r.padding,
|
|
60
|
+
renderAs: r.renderAs,
|
|
61
|
+
size: r.size,
|
|
62
|
+
value: r.value
|
|
63
|
+
});
|
|
64
|
+
return /* @__PURE__ */ n.createElement(
|
|
65
|
+
b,
|
|
66
|
+
{
|
|
67
|
+
...R,
|
|
68
|
+
deriveOptionsFromParent: C,
|
|
69
|
+
ref: a,
|
|
70
|
+
barcodeConstructor: x,
|
|
71
|
+
getTarget: g,
|
|
72
|
+
className: O("k-qrcode", f)
|
|
73
|
+
},
|
|
74
|
+
m
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
V.displayName = "KendoReactQRCode";
|
|
95
78
|
export {
|
|
96
|
-
|
|
79
|
+
V as QRCode
|
|
97
80
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { Surface, Group, ImageExportOptions, SVGExportOptions } from '@progress/kendo-drawing';
|
|
9
|
+
import { QRCodeProps } from './QRCodeProps';
|
|
10
|
+
/**
|
|
11
|
+
* Represents the `ref` of the QRCode component.
|
|
12
|
+
*/
|
|
13
|
+
export interface QRCodeHandle {
|
|
14
|
+
/** The current root DOM element or `null`. */
|
|
15
|
+
element: HTMLDivElement | null;
|
|
16
|
+
/** The props of the QRCode component. */
|
|
17
|
+
readonly props: Readonly<QRCodeProps>;
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
barcodeInstance: any;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the Drawing `Surface` of the QRCode.
|
|
24
|
+
*/
|
|
25
|
+
surface: Surface | null;
|
|
26
|
+
/**
|
|
27
|
+
* Exports the component as an image. The export operation runs asynchronously and returns a promise.
|
|
28
|
+
*
|
|
29
|
+
* @param options - The parameters for the exported image.
|
|
30
|
+
* @returns A promise that resolves 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 runs asynchronously and returns a promise.
|
|
35
|
+
*
|
|
36
|
+
* @param options - The parameters for the exported file.
|
|
37
|
+
* @returns A promise that resolves with an SVG document that is encoded as a Data URI.
|
|
38
|
+
*/
|
|
39
|
+
exportSVG: (options?: SVGExportOptions) => Promise<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Exports a QRCode component as a Drawing `Scene`.
|
|
42
|
+
*
|
|
43
|
+
* @param options - The parameters for the export operation.
|
|
44
|
+
* @returns The root `Group` of the scene.
|
|
45
|
+
*/
|
|
46
|
+
exportVisual: (options?: any) => Group;
|
|
47
|
+
}
|
package/common/barcodes.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
type Barcodes =
|
|
8
|
+
import { BarcodeHandle } from './../BarcodeHandle';
|
|
9
|
+
import { QRCodeHandle } from './../QRCodeHandle';
|
|
10
|
+
type Barcodes = BarcodeHandle | QRCodeHandle;
|
|
11
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,
|
|
15
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(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"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactBarcodes={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoCharts,e.KendoDrawing)}(this,function(e,r,t,n,o,c){"use strict";function a(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}var s=a(r);const u=1e3/60,l=(e,r)=>{if(!r.type)return[];switch(r.type){case"add":return[...e,r.payload];case"remove":return e.filter(e=>e!==r.payload);default:return e}},d=e=>"object"==typeof e,i=(e,r)=>{if(Object.keys(e).length!==Object.keys(r).length)return!0;for(const t in e)if(e.hasOwnProperty(t)){const n=e[t],o=r[t];if(d(n)&&d(o)?i(n,o):n!==o)return!0}return!1},p=(e,r)=>{if(!e||!r||(e=[].concat(e),r=[].concat(r),e.length!==r.length))return!0;for(let t=0;t<e.length;t++)if(i(e[t],r[t]))return!0;return!1},f=s.createContext(null);f.displayName="BarcodeContext";const g=Object.freeze({name:"@progress/kendo-react-barcodes",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"15.2.0-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),m={renderAs:"svg"},v=s.forwardRef((e,r)=>{const{renderAs:t=m.renderAs,style:o={},className:c,children:a,barcodeConstructor:d,deriveOptionsFromParent:i,getTarget:v}=e,b=s.useRef(null),h=s.useRef(null),y=s.useRef(null),k=s.useMemo(()=>!n.validatePackage(g,{component:"Barcode"}),[]),w=s.useMemo(()=>n.getLicenseMessage(g),[]),R=s.useMemo(()=>(e=>{let r,t,o=[];const c=c=>{r=e(r,c),n.canUseDOM&&(window.clearTimeout(t),t=window.setTimeout(()=>o.forEach(e=>e()),u))};return c({}),{getState:()=>r,dispatch:c,subscribe:e=>(o.push(e),()=>o=o.filter(r=>r!==e))}})(l),[]),C=s.useMemo(()=>({observersStore:R}),[R]),O=()=>{let e={renderAs:t};return i&&(e=i(e)),e},I=()=>{const e=O();h.current=new d(b.current,e,e=>{if("production"!==process.env.NODE_ENV)throw e;console.warn(e)})},N=(e,r)=>{const t=R.getState();for(let n=0;n<t.length;n++)t[n].trigger(e,r)},x=()=>{null!==h.current&&(h.current.redraw(),N("render",{sender:v()}))},E=s.useRef(null);return s.useImperativeHandle(E,()=>({get barcodeInstance(){return h.current},get surface(){return null},get element(){return b.current}}),[]),s.useImperativeHandle(r,()=>E.current,[]),s.useEffect(()=>(I(),window.addEventListener("resize",x),N("render",{sender:v()}),()=>{null!==h.current&&(h.current.destroy(),h.current=null),window.removeEventListener("resize",x)}),[]),s.useEffect(()=>{if(null===y.current)return void(y.current=e);const{children:r,deriveOptionsFromParent:t,getTarget:n,barcodeConstructor:o,className:c,renderAs:a,...s}=e,{children:u,deriveOptionsFromParent:l,getTarget:d,barcodeConstructor:i,className:f,renderAs:g,...m}=y.current;if(null!==h.current){const e=p(m,s);(a||"svg")!==(g||"svg")?(null!==h.current&&(h.current.destroy(),h.current=null),I()):e&&(()=>{if(null!==h.current){const e=O();h.current.setOptions(e)}})(),N("render",{sender:v()})}y.current=e}),s.createElement(f.Provider,{value:C},s.createElement("div",{style:o,ref:b,className:c},a,k&&s.createElement(n.WatermarkOverlay,{message:w})))});v.propTypes={dir:t.string,renderAs:t.oneOf(["svg","canvas"])},v.displayName="KendoReactBaseBarcode";const b=s.forwardRef((e,r)=>{const{children:t,className:a,...u}=e,l=s.useRef(null),d=s.useRef(e);d.current=e;const i=s.useCallback(e=>{var r;const t=null==(r=l.current)?void 0:r.barcodeInstance;return null!=t?t.exportVisual(e):new c.Group},[]),p=s.useCallback((e={})=>c.exportImage(i(),e),[i]),f=s.useCallback((e={})=>c.exportSVG(i(),e),[i]),g=s.useRef(null);s.useImperativeHandle(g,()=>({get element(){var e,r;return null!=(r=null==(e=l.current)?void 0:e.element)?r:null},get props(){return d.current},get barcodeInstance(){var e,r;return null!=(r=null==(e=l.current)?void 0:e.barcodeInstance)?r:null},get surface(){var e,r;return null!=(r=null==(e=l.current)?void 0:e.surface)?r:null},exportImage:p,exportSVG:f,exportVisual:i}),[p,f,i]),s.useImperativeHandle(r,()=>g.current,[]);return s.createElement(v,{...u,deriveOptionsFromParent:r=>({...r,background:e.background,border:e.border,checksum:e.checksum,color:e.color,height:e.height,padding:e.padding,text:e.text,type:e.type,value:e.value,width:e.width}),ref:l,barcodeConstructor:o.Barcode,getTarget:()=>g.current,className:n.classNames("k-barcode",a)},t)});b.displayName="KendoReactBarcode";const h=s.forwardRef((e,r)=>{const{children:t,className:a,...u}=e,l=s.useRef(null),d=s.useRef(e);d.current=e;const i=s.useCallback(e=>{var r;const t=null==(r=l.current)?void 0:r.barcodeInstance;return null!=t?t.exportVisual(e):new c.Group},[]),p=s.useCallback((e={})=>c.exportImage(i(),e),[i]),f=s.useCallback((e={})=>c.exportSVG(i(),e),[i]),g=s.useRef(null);s.useImperativeHandle(g,()=>({get element(){var e,r;return null!=(r=null==(e=l.current)?void 0:e.element)?r:null},get props(){return d.current},get barcodeInstance(){var e,r;return null!=(r=null==(e=l.current)?void 0:e.barcodeInstance)?r:null},get surface(){var e,r;return null!=(r=null==(e=l.current)?void 0:e.surface)?r:null},exportImage:p,exportSVG:f,exportVisual:i}),[p,f,i]),s.useImperativeHandle(r,()=>g.current,[]);return s.createElement(v,{...u,deriveOptionsFromParent:r=>({...r,background:e.background||"#fff",border:e.border,color:e.color||"#000",encoding:e.encoding,errorCorrection:e.errorCorrection||"L",overlay:e.overlay||{},padding:e.padding,renderAs:e.renderAs,size:e.size,value:e.value}),ref:l,barcodeConstructor:o.QRCode,getTarget:()=>g.current,className:n.classNames("k-qrcode",a)},t)});h.displayName="KendoReactQRCode",e.Barcode=b,e.QRCode=h});
|
package/index.d.mts
CHANGED
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { Barcode } from './Barcode.js';
|
|
9
|
+
import { BarcodeHandle } from './BarcodeHandle';
|
|
9
10
|
import { BarcodeProps } from './BarcodeProps';
|
|
10
11
|
import { QRCode } from './QRCode.js';
|
|
12
|
+
import { QRCodeHandle } from './QRCodeHandle';
|
|
11
13
|
import { QRCodeProps } from './QRCodeProps';
|
|
12
14
|
export * from './types';
|
|
13
|
-
export { Barcode, BarcodeProps, QRCode, QRCodeProps };
|
|
15
|
+
export { Barcode, BarcodeHandle, BarcodeProps, QRCode, QRCodeHandle, QRCodeProps };
|
package/index.d.ts
CHANGED
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { Barcode } from './Barcode.js';
|
|
9
|
+
import { BarcodeHandle } from './BarcodeHandle';
|
|
9
10
|
import { BarcodeProps } from './BarcodeProps';
|
|
10
11
|
import { QRCode } from './QRCode.js';
|
|
12
|
+
import { QRCodeHandle } from './QRCodeHandle';
|
|
11
13
|
import { QRCodeProps } from './QRCodeProps';
|
|
12
14
|
export * from './types';
|
|
13
|
-
export { Barcode, BarcodeProps, QRCode, QRCodeProps };
|
|
15
|
+
export { Barcode, BarcodeHandle, BarcodeProps, QRCode, QRCodeHandle, QRCodeProps };
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-barcodes",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-barcodes",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1785775471,version:"15.2.0-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
|
|
|
7
7
|
productName: 'KendoReact',
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
|
-
publishDate:
|
|
11
|
-
version: '15.2.0-develop.
|
|
10
|
+
publishDate: 1785775471,
|
|
11
|
+
version: '15.2.0-develop.3',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-barcodes",
|
|
3
|
-
"version": "15.2.0-develop.
|
|
3
|
+
"version": "15.2.0-develop.3",
|
|
4
4
|
"description": "React Barcodes provide a set of React components to build beautiful and customizable barcodes. KendoReact Barcodes package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@progress/kendo-charts": "2.
|
|
28
|
+
"@progress/kendo-charts": "2.13.0",
|
|
29
29
|
"@progress/kendo-drawing": "^1.21.2",
|
|
30
30
|
"@progress/kendo-licensing": "^1.7.2",
|
|
31
|
-
"@progress/kendo-react-common": "15.2.0-develop.
|
|
32
|
-
"@progress/kendo-react-intl": "15.2.0-develop.
|
|
31
|
+
"@progress/kendo-react-common": "15.2.0-develop.3",
|
|
32
|
+
"@progress/kendo-react-intl": "15.2.0-develop.3",
|
|
33
33
|
"react": "^18.0.0 || ^19.0.0",
|
|
34
34
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
35
35
|
},
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"package": {
|
|
57
57
|
"productName": "KendoReact",
|
|
58
58
|
"productCode": "KENDOUIREACT",
|
|
59
|
-
"publishDate":
|
|
59
|
+
"publishDate": 1785775471,
|
|
60
60
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
61
61
|
}
|
|
62
62
|
},
|