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

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/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Barcode } from './Barcode';
6
+ import { type BarcodeProps } from './BarcodeProps';
7
+ import { QRCode } from './QRCode';
8
+ import { type QRCodeProps } from './QRCodeProps';
9
+ export * from './types';
10
+ export { Barcode, BarcodeProps, QRCode, QRCodeProps };
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),I=require("prop-types"),l=require("@progress/kendo-react-common"),g=require("@progress/kendo-charts"),i=require("@progress/kendo-drawing");function f(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const o=f(_),h=f(I),x=1e3/60,w=r=>{let e,t,s=[];const n=()=>e,d=a=>{e=r(e,a),l.canUseDOM&&(window.clearTimeout(t),t=window.setTimeout(()=>s.forEach(c=>c()),x))},u=a=>(s.push(a),()=>s=s.filter(c=>c!==a));return d({}),{getState:n,dispatch:d,subscribe:u}},y=w,T=(r,e)=>{if(e.type)switch(e.type){case"add":return[...r,e.payload];case"remove":return r.filter(t=>t!==e.payload);default:return r}else return[]},b=r=>typeof r=="object",m=(r,e)=>{if(Object.keys(r).length!==Object.keys(e).length)return!0;for(let t in r)if(r.hasOwnProperty(t)){const s=r[t],n=e[t];if(b(s)&&b(n)?m(s,n):s!==n)return!0}return!1},P=(r,e)=>{if(!r||!e||(r=[].concat(r),e=[].concat(e),r.length!==e.length))return!0;for(let t=0;t<r.length;t++)if(m(r[t],e[t]))return!0;return!1},v=o.createContext(null);v.displayName="BarcodeContext";const R={name:"@progress/kendo-react-barcodes",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};class p extends o.Component{constructor(e){super(e),this.barcodeInstance=null,this.surface=null,this._element=null,this.observersStore={},this.onWindowResize=()=>{this.barcodeInstance!==null&&(this.barcodeInstance.redraw(),this.trigger("render",{sender:this}))},l.validatePackage(R),this.observersStore=y(T),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:s,getTarget:n,barcodeConstructor:d,className:u,renderAs:a,...c}=this.props,{children:S,deriveOptionsFromParent:A,getTarget:F,barcodeConstructor:j,className:U,renderAs:O,...B}=e;if(this.barcodeInstance!==null){const C=P(B,c);(a||"svg")!==(O||"svg")?(this.barcodeInstance!==null&&(this.barcodeInstance.destroy(),this.barcodeInstance=null),this.instantiateCoreBarcode()):C&&this.refresh(),this.trigger("render",{sender:this})}}componentWillUnmount(){this.barcodeInstance!==null&&(this.barcodeInstance.destroy(),this.barcodeInstance=null),window.removeEventListener("resize",this.onWindowResize)}render(){const{style:e={},className:t,children:s}=this.props;return o.createElement(v.Provider,{value:this.contextValue},o.createElement("div",{style:e,ref:n=>this._element=n,className:t},s))}instantiateCoreBarcode(){const{barcodeConstructor:e}=this.props,t=this.getBarcodeOptions();this.barcodeInstance=new e(this.element,t,s=>{if(process.env.NODE_ENV!=="production")throw s;console.warn(s)})}refresh(){if(this.barcodeInstance!==null){const e=this.getBarcodeOptions();this.barcodeInstance.setOptions(e)}}getBarcodeOptions(){const{renderAs:e,deriveOptionsFromParent:t}=this.props;let s={renderAs:e};return t&&(s=t(s)),s}trigger(e,t){const s=this.observersStore.getState();for(let n=0;n<s.length;n++)s[n].trigger(e,t)}}p.propTypes={dir:h.string,renderAs:h.oneOf(["svg","canvas"])};p.defaultProps={renderAs:"svg"};class E extends o.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 this._baseBarcode!==null?this._baseBarcode.barcodeInstance:null}get surface(){return this._baseBarcode!==null?this._baseBarcode.surface:null}get element(){return this._baseBarcode!==null?this._baseBarcode.element:null}render(){const{children:e,className:t,...s}=this.props;return o.createElement(p,{...s,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:n=>this._baseBarcode=n,barcodeConstructor:g.Barcode,getTarget:this.getTarget,className:l.classNames("k-barcode",t)},e)}exportImage(e={}){return i.exportImage(this.exportVisual(),e)}exportSVG(e={}){return i.exportSVG(this.exportVisual(),e)}exportVisual(e){return this.barcodeInstance!==null?this.barcodeInstance.exportVisual(e):new i.Group}}const k="#000",N="#fff",V="L";class D extends o.Component{constructor(){super(...arguments),this._baseBarcode=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>Object.assign({},e,{background:this.props.background||N,border:this.props.border,color:this.props.color||k,encoding:this.props.encoding,errorCorrection:this.props.errorCorrection||V,overlay:this.props.overlay||{},padding:this.props.padding,renderAs:this.props.renderAs,size:this.props.size,value:this.props.value})}get barcodeInstance(){return this._baseBarcode!==null?this._baseBarcode.barcodeInstance:null}get surface(){return this._baseBarcode!==null?this._baseBarcode.surface:null}get element(){return this._baseBarcode!==null?this._baseBarcode.element:null}render(){const{children:e,className:t,...s}=this.props;return o.createElement(p,{...s,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:n=>this._baseBarcode=n,barcodeConstructor:g.QRCode,getTarget:this.getTarget,className:l.classNames("k-qrcode",t)},e)}exportImage(e={}){return i.exportImage(this.exportVisual(),e)}exportSVG(e={}){return i.exportSVG(this.exportVisual(),e)}exportVisual(e){return this.barcodeInstance!==null?this.barcodeInstance.exportVisual(e):new i.Group}}exports.Barcode=E;exports.QRCode=D;
package/index.mjs ADDED
@@ -0,0 +1,335 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as n from "react";
6
+ import * as l from "prop-types";
7
+ import { canUseDOM as I, validatePackage as x, classNames as u } from "@progress/kendo-react-common";
8
+ import { Barcode as _, QRCode as w } from "@progress/kendo-charts";
9
+ import { exportImage as b, exportSVG as g, Group as m } from "@progress/kendo-drawing";
10
+ const T = 1e3 / 60, E = (s) => {
11
+ let e, t, r = [];
12
+ const o = () => e, c = (a) => {
13
+ e = s(e, a), I && (window.clearTimeout(t), t = window.setTimeout(() => r.forEach((i) => i()), T));
14
+ }, p = (a) => (r.push(a), () => r = r.filter((i) => i !== a));
15
+ return c({}), { getState: o, dispatch: c, subscribe: p };
16
+ }, y = E, R = (s, e) => {
17
+ if (e.type)
18
+ switch (e.type) {
19
+ case "add":
20
+ return [...s, e.payload];
21
+ case "remove":
22
+ return s.filter((t) => t !== e.payload);
23
+ default:
24
+ return s;
25
+ }
26
+ else
27
+ return [];
28
+ }, h = (s) => typeof s == "object", f = (s, e) => {
29
+ if (Object.keys(s).length !== Object.keys(e).length)
30
+ return !0;
31
+ for (let t in s)
32
+ if (s.hasOwnProperty(t)) {
33
+ const r = s[t], o = e[t];
34
+ if (h(r) && h(o) ? f(r, o) : r !== o)
35
+ return !0;
36
+ }
37
+ return !1;
38
+ }, P = (s, e) => {
39
+ if (!s || !e || (s = [].concat(s), e = [].concat(e), s.length !== e.length))
40
+ return !0;
41
+ for (let t = 0; t < s.length; t++)
42
+ if (f(s[t], e[t]))
43
+ return !0;
44
+ return !1;
45
+ }, v = n.createContext(null);
46
+ v.displayName = "BarcodeContext";
47
+ const N = {
48
+ name: "@progress/kendo-react-barcodes",
49
+ productName: "KendoReact",
50
+ productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
51
+ publishDate: 1701439803,
52
+ version: "",
53
+ licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
54
+ };
55
+ class d extends n.Component {
56
+ constructor(e) {
57
+ super(e), this.barcodeInstance = null, this.surface = null, this._element = null, this.observersStore = {}, this.onWindowResize = () => {
58
+ this.barcodeInstance !== null && (this.barcodeInstance.redraw(), this.trigger("render", { sender: this }));
59
+ }, x(N), this.observersStore = y(R), this.contextValue = {
60
+ observersStore: this.observersStore
61
+ };
62
+ }
63
+ /**
64
+ * @hidden
65
+ */
66
+ get element() {
67
+ return this._element;
68
+ }
69
+ /**
70
+ * @hidden
71
+ */
72
+ componentDidMount() {
73
+ this.instantiateCoreBarcode(), window.addEventListener("resize", this.onWindowResize), this.trigger("render", { sender: this });
74
+ }
75
+ /**
76
+ * @hidden
77
+ */
78
+ componentDidUpdate(e) {
79
+ const {
80
+ children: t,
81
+ deriveOptionsFromParent: r,
82
+ getTarget: o,
83
+ barcodeConstructor: c,
84
+ className: p,
85
+ renderAs: a,
86
+ ...i
87
+ } = this.props, {
88
+ children: D,
89
+ deriveOptionsFromParent: F,
90
+ getTarget: S,
91
+ barcodeConstructor: U,
92
+ className: L,
93
+ renderAs: O,
94
+ ...B
95
+ } = e;
96
+ if (this.barcodeInstance !== null) {
97
+ const C = P(B, i);
98
+ (a || "svg") !== (O || "svg") ? (this.barcodeInstance !== null && (this.barcodeInstance.destroy(), this.barcodeInstance = null), this.instantiateCoreBarcode()) : C && this.refresh(), this.trigger("render", { sender: this });
99
+ }
100
+ }
101
+ /**
102
+ * @hidden
103
+ */
104
+ componentWillUnmount() {
105
+ this.barcodeInstance !== null && (this.barcodeInstance.destroy(), this.barcodeInstance = null), window.removeEventListener("resize", this.onWindowResize);
106
+ }
107
+ /**
108
+ * @hidden
109
+ */
110
+ render() {
111
+ const { style: e = {}, className: t, children: r } = this.props;
112
+ return /* @__PURE__ */ n.createElement(v.Provider, { value: this.contextValue }, /* @__PURE__ */ n.createElement(
113
+ "div",
114
+ {
115
+ style: e,
116
+ ref: (o) => this._element = o,
117
+ className: t
118
+ },
119
+ r
120
+ ));
121
+ }
122
+ /**
123
+ * @hidden
124
+ */
125
+ instantiateCoreBarcode() {
126
+ const { barcodeConstructor: e } = this.props, t = this.getBarcodeOptions();
127
+ this.barcodeInstance = new e(
128
+ this.element,
129
+ t,
130
+ (r) => {
131
+ if (process.env.NODE_ENV !== "production")
132
+ throw r;
133
+ console.warn(r);
134
+ }
135
+ );
136
+ }
137
+ /**
138
+ * @hidden
139
+ */
140
+ refresh() {
141
+ if (this.barcodeInstance !== null) {
142
+ const e = this.getBarcodeOptions();
143
+ this.barcodeInstance.setOptions(e);
144
+ }
145
+ }
146
+ /**
147
+ * @hidden
148
+ */
149
+ getBarcodeOptions() {
150
+ const {
151
+ renderAs: e,
152
+ deriveOptionsFromParent: t
153
+ } = this.props;
154
+ let r = { renderAs: e };
155
+ return t && (r = t(r)), r;
156
+ }
157
+ /**
158
+ * @hidden
159
+ */
160
+ trigger(e, t) {
161
+ const r = this.observersStore.getState();
162
+ for (let o = 0; o < r.length; o++)
163
+ r[o].trigger(e, t);
164
+ }
165
+ }
166
+ d.propTypes = {
167
+ dir: l.string,
168
+ renderAs: l.oneOf(["svg", "canvas"])
169
+ };
170
+ d.defaultProps = {
171
+ renderAs: "svg"
172
+ };
173
+ class M extends n.Component {
174
+ constructor() {
175
+ super(...arguments), this._baseBarcode = null, this.getTarget = () => this, this.deriveOptionsFromParent = (e) => Object.assign({}, e, {
176
+ background: this.props.background,
177
+ border: this.props.border,
178
+ checksum: this.props.checksum,
179
+ color: this.props.color,
180
+ height: this.props.height,
181
+ padding: this.props.padding,
182
+ text: this.props.text,
183
+ type: this.props.type,
184
+ value: this.props.value,
185
+ width: this.props.width
186
+ });
187
+ }
188
+ /**
189
+ * @hidden
190
+ */
191
+ get barcodeInstance() {
192
+ return this._baseBarcode !== null ? this._baseBarcode.barcodeInstance : null;
193
+ }
194
+ /**
195
+ * The Drawing `Surface` of the Barcode.
196
+ */
197
+ get surface() {
198
+ return this._baseBarcode !== null ? this._baseBarcode.surface : null;
199
+ }
200
+ /**
201
+ * The DOM element of the Barcode.
202
+ */
203
+ get element() {
204
+ return this._baseBarcode !== null ? this._baseBarcode.element : null;
205
+ }
206
+ /**
207
+ * @hidden
208
+ */
209
+ render() {
210
+ const { children: e, className: t, ...r } = this.props;
211
+ return /* @__PURE__ */ n.createElement(
212
+ d,
213
+ {
214
+ ...r,
215
+ deriveOptionsFromParent: this.deriveOptionsFromParent,
216
+ ref: (o) => this._baseBarcode = o,
217
+ barcodeConstructor: _,
218
+ getTarget: this.getTarget,
219
+ className: u("k-barcode", t)
220
+ },
221
+ e
222
+ );
223
+ }
224
+ /**
225
+ * Exports the component as an image. The export operation is asynchronous and returns a promise.
226
+ *
227
+ * @param {ImageExportOptions} options - The parameters for the exported image.
228
+ * @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
229
+ */
230
+ exportImage(e = {}) {
231
+ return b(this.exportVisual(), e);
232
+ }
233
+ /**
234
+ * Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
235
+ *
236
+ * @param options - The parameters for the exported file.
237
+ * @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
238
+ */
239
+ exportSVG(e = {}) {
240
+ return g(this.exportVisual(), e);
241
+ }
242
+ /**
243
+ * Exports a Barcode component as a Drawing `Scene`.
244
+ *
245
+ * @param {any} options - The parameters for the export operation.
246
+ * @returns {Group} - A promise that returns the root `Group` of the scene.
247
+ */
248
+ exportVisual(e) {
249
+ return this.barcodeInstance !== null ? this.barcodeInstance.exportVisual(e) : new m();
250
+ }
251
+ }
252
+ const V = "#000", k = "#fff", A = "L";
253
+ class K extends n.Component {
254
+ constructor() {
255
+ super(...arguments), this._baseBarcode = null, this.getTarget = () => this, this.deriveOptionsFromParent = (e) => Object.assign({}, e, {
256
+ background: this.props.background || k,
257
+ border: this.props.border,
258
+ color: this.props.color || V,
259
+ encoding: this.props.encoding,
260
+ errorCorrection: this.props.errorCorrection || A,
261
+ overlay: this.props.overlay || {},
262
+ padding: this.props.padding,
263
+ renderAs: this.props.renderAs,
264
+ size: this.props.size,
265
+ value: this.props.value
266
+ });
267
+ }
268
+ /**
269
+ * @hidden
270
+ */
271
+ get barcodeInstance() {
272
+ return this._baseBarcode !== null ? this._baseBarcode.barcodeInstance : null;
273
+ }
274
+ /**
275
+ * The Drawing `Surface` of the Barcode.
276
+ */
277
+ get surface() {
278
+ return this._baseBarcode !== null ? this._baseBarcode.surface : null;
279
+ }
280
+ /**
281
+ * The DOM element of the Barcode.
282
+ */
283
+ get element() {
284
+ return this._baseBarcode !== null ? this._baseBarcode.element : null;
285
+ }
286
+ /**
287
+ * @hidden
288
+ */
289
+ render() {
290
+ const { children: e, className: t, ...r } = this.props;
291
+ return /* @__PURE__ */ n.createElement(
292
+ d,
293
+ {
294
+ ...r,
295
+ deriveOptionsFromParent: this.deriveOptionsFromParent,
296
+ ref: (o) => this._baseBarcode = o,
297
+ barcodeConstructor: w,
298
+ getTarget: this.getTarget,
299
+ className: u("k-qrcode", t)
300
+ },
301
+ e
302
+ );
303
+ }
304
+ /**
305
+ * Exports the component as an image. The export operation is asynchronous and returns a promise.
306
+ *
307
+ * @param {ImageExportOptions} options - The parameters for the exported image.
308
+ * @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
309
+ */
310
+ exportImage(e = {}) {
311
+ return b(this.exportVisual(), e);
312
+ }
313
+ /**
314
+ * Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
315
+ *
316
+ * @param options - The parameters for the exported file.
317
+ * @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
318
+ */
319
+ exportSVG(e = {}) {
320
+ return g(this.exportVisual(), e);
321
+ }
322
+ /**
323
+ * Exports a Barcode component as a Drawing `Scene`.
324
+ *
325
+ * @param {any} options - The parameters for the export operation.
326
+ * @returns {Group} - A promise that returns the root `Group` of the scene.
327
+ */
328
+ exportVisual(e) {
329
+ return this.barcodeInstance !== null ? this.barcodeInstance.exportVisual(e) : new m();
330
+ }
331
+ }
332
+ export {
333
+ M as Barcode,
334
+ K as QRCode
335
+ };
@@ -0,0 +1,9 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { PackageMetadata } from '@progress/kendo-licensing';
6
+ /**
7
+ * @hidden
8
+ */
9
+ export declare const packageMetadata: PackageMetadata;
package/package.json CHANGED
@@ -1,20 +1,32 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-barcodes",
3
+ "version": "7.0.0-develop.10",
3
4
  "description": "React Barcodes provide a set of React components to build beautiful and customizable barcodes. KendoReact Barcodes package",
4
- "version": "6.1.1",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/telerik/kendo-react.git"
5
+ "author": "Progress",
6
+ "license": "SEE LICENSE IN LICENSE.md",
7
+ "homepage": "https://www.telerik.com/kendo-react-ui",
8
+ "main": "./index.js",
9
+ "types": "./index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./index.mjs",
13
+ "require": "./index.js"
14
+ }
15
+ },
16
+ "sideEffects": false,
17
+ "peerDependencies": {
18
+ "@progress/kendo-charts": "^1.32.0",
19
+ "@progress/kendo-drawing": "^1.17.2",
20
+ "@progress/kendo-licensing": "^1.3.0",
21
+ "@progress/kendo-react-common": "7.0.0-develop.10",
22
+ "@progress/kendo-react-intl": "7.0.0-develop.10",
23
+ "hammerjs": "^2.0.0",
24
+ "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
25
+ "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
8
26
  },
9
- "main": "dist/npm/main.js",
10
- "types": "dist/npm/main.d.ts",
11
- "module": "dist/es/main.js",
12
- "jsnext:main": "dist/es/main.js",
13
- "scripts": {
14
- "test": "cd ../../ && npm run test -- --testPathPattern=/packages/barcodes/.*",
15
- "build-package": "gulp build-package"
27
+ "dependencies": {
28
+ "prop-types": "^15.6.0"
16
29
  },
17
- "homepage": "https://www.telerik.com/kendo-react-ui",
18
30
  "keywords": [
19
31
  "Kendo UI",
20
32
  "React",
@@ -29,42 +41,15 @@
29
41
  "React component",
30
42
  "Telerik"
31
43
  ],
32
- "peerDependencies": {
33
- "@progress/kendo-drawing": "^1.17.2",
34
- "@progress/kendo-licensing": "^1.3.0",
35
- "@progress/kendo-react-intl": "^6.0.0",
36
- "hammerjs": "^2.0.0",
37
- "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
38
- "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
39
- },
40
- "dependencies": {
41
- "@progress/kendo-charts": "^1.32.0",
42
- "@progress/kendo-react-common": "6.1.1",
43
- "prop-types": "^15.6.0"
44
- },
45
- "devDependencies": {
46
- "@progress/kendo-data-query": "^1.0.0",
47
- "@progress/kendo-drawing": "^1.17.2",
48
- "@progress/kendo-file-saver": "^1.0.1",
49
- "@progress/kendo-licensing": "^1.3.0",
50
- "@progress/kendo-react-buttons": "6.1.1",
51
- "@progress/kendo-react-dropdowns": "6.1.1",
52
- "@progress/kendo-react-inputs": "6.1.1",
53
- "@progress/kendo-react-intl": "6.1.1",
54
- "@progress/kendo-react-pdf": "6.1.1",
55
- "cldr-core": "^41.0.0",
56
- "cldr-dates-full": "^41.0.0",
57
- "cldr-numbers-full": "^41.0.0",
58
- "hammerjs": "^2.0.0"
59
- },
60
44
  "@progress": {
61
45
  "friendlyName": "Barcodes",
62
46
  "framework": "KendoReact"
63
47
  },
64
- "author": "Progress",
65
- "license": "SEE LICENSE IN LICENSE.md",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/telerik/kendo-react.git"
51
+ },
66
52
  "publishConfig": {
67
53
  "access": "public"
68
- },
69
- "sideEffects": false
70
- }
54
+ }
55
+ }
@@ -0,0 +1,14 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { StoreAction } from './store';
6
+ /**
7
+ * @hidden
8
+ */
9
+ declare const optionsReducer: (currentState: any, action: StoreAction) => object;
10
+ /**
11
+ * @hidden
12
+ */
13
+ declare const observersReducer: (currentState: any, action: StoreAction) => any;
14
+ export { optionsReducer, observersReducer };
@@ -1,3 +1,7 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
1
5
  /**
2
6
  * @hidden
3
7
  */
@@ -1,3 +1,7 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
1
5
  import { Margin } from './margin.interface';
2
6
  /**
3
7
  * The Barcode text label configuration.
@@ -0,0 +1,8 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * Supported symbologies (encodings) for the Barcode component.
7
+ */
8
+ export type BarcodeType = 'EAN8' | 'EAN13' | 'UPCE' | 'UPCA' | 'Code11' | 'Code39' | 'Code39Extended' | 'Code93' | 'Code93Extended' | 'Code128' | 'Code128A' | 'Code128B' | 'Code128C' | 'GS1-128' | 'MSImod10' | 'MSImod11' | 'MSImod1010' | 'MSImod1110' | 'POSTNET';
@@ -1,3 +1,7 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
1
5
  import { DashType } from './dash-type.interface';
2
6
  /**
3
7
  * The appearance settings for the border lines.
@@ -0,0 +1,8 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * The dash line type.
7
+ */
8
+ export type DashType = 'dash' | 'dashDot' | 'dot' | 'longDash' | 'longDashDot' | 'longDashDotDot' | 'solid';
@@ -0,0 +1,25 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * The margin size for each side.
7
+ */
8
+ export interface Margin {
9
+ /**
10
+ * The top margin in pixels.
11
+ */
12
+ top?: number;
13
+ /**
14
+ * The right margin in pixels.
15
+ */
16
+ right?: number;
17
+ /**
18
+ * The bottom margin in pixels.
19
+ */
20
+ bottom?: number;
21
+ /**
22
+ * The left margin in pixels.
23
+ */
24
+ left?: number;
25
+ }
@@ -1,3 +1,7 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
1
5
  /**
2
6
  * The padding size for each side.
3
7
  */
@@ -0,0 +1,8 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * The QR Code encoding modes.
7
+ */
8
+ export type QRCodeEncoding = 'ISO_8859_1' | 'UTF_8';
@@ -0,0 +1,13 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * The QR Code error correction levels.
7
+ *
8
+ * * `"L"`&mdash;Approximately 7% of the codewords can be restored.
9
+ * * `"M"`&mdash;Approximately 15% of the codewords can be restored.
10
+ * * `"Q"`&mdash;Approximately 25% of the codewords can be restored.
11
+ * * `"H"`&mdash;Approximately 30% of the codewords can be restored.
12
+ */
13
+ export type QRCodeErrorCorrection = 'L' | 'M' | 'Q' | 'H';
@@ -1,3 +1,7 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
1
5
  /**
2
6
  * The image overlay configuration of the QR Code.
3
7
  */
@@ -0,0 +1,12 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * Sets the rendering mode of the component.
7
+ *
8
+ * The supported values are:
9
+ * * `"canvas"`&mdash;Renders the component as a Canvas element.
10
+ * * `"svg"`&mdash;Renders the component as an inline SVG document.
11
+ */
12
+ export type RenderMode = 'svg' | 'canvas';
package/types.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ export type { Margin } from './types/margin.interface';
6
+ export type { Padding } from './types/padding.interface';
7
+ export type { Border } from './types/border.interface';
8
+ export type { DashType } from './types/dash-type.interface';
9
+ export type { BarcodeText } from './types/barcode-text';
10
+ export type { BarcodeType } from './types/barcode-type';
11
+ export type { QRCodeEncoding } from './types/qrcode-encoding';
12
+ export type { QRCodeErrorCorrection } from './types/qrcode-error-correction';
13
+ export type { QRCodeOverlay } from './types/qrcode-overlay';
14
+ export type { RenderMode } from './types/render-mode';
@@ -0,0 +1,8 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * @hidden
7
+ */
8
+ export declare const isOptionsChanged: (original: any, current: any) => boolean;
package/about.md DELETED
@@ -1,3 +0,0 @@
1
- <a href="https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-barcodes&utm_content=banner" target="_blank">
2
- <img src="https://www.telerik.com/kendo-react-ui/components/npm-banner.svg" alt="KendoReact NPM Banner">
3
- </a>