@progress/kendo-react-barcodes 7.0.1 → 7.0.2-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/BaseBarcode.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as React from 'react';
6
- import * as PropTypes from 'prop-types';
6
+ import PropTypes from 'prop-types';
7
7
  import { Surface } from '@progress/kendo-drawing';
8
8
  import { BaseBarcodePrivateProps } from './BaseBarcodeProps';
9
9
  import { BarcodeContextType } from './BarcodeContext';
@@ -2,4 +2,4 @@
2
2
  * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- (function(o,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-charts"),require("@progress/kendo-drawing")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-charts","@progress/kendo-drawing"],d):(o=typeof globalThis<"u"?globalThis:o||self,d(o.KendoReactBarcodes={},o.React,o.PropTypes,o.KendoReactCommon,o.KendoCharts,o.KendoDrawing))})(this,function(o,d,_,u,f,a){"use strict";"use client";function b(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 i=b(d),g=b(_),x=1e3/60,y=r=>{let e,t,s=[];const n=()=>e,h=c=>{e=r(e,c),u.canUseDOM&&(window.clearTimeout(t),t=window.setTimeout(()=>s.forEach(p=>p()),x))},B=c=>(s.push(c),()=>s=s.filter(p=>p!==c));return h({}),{getState:n,dispatch:h,subscribe:B}},C=(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[]},m=r=>typeof r=="object",v=(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(m(s)&&m(n)?v(s,n):s!==n)return!0}return!1},I=(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(v(r[t],e[t]))return!0;return!1},O=i.createContext(null);O.displayName="BarcodeContext";const T={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 l extends i.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}))},u.validatePackage(T),this.observersStore=y(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:s,getTarget:n,barcodeConstructor:h,className:B,renderAs:c,...p}=this.props,{children:F,deriveOptionsFromParent:j,getTarget:D,barcodeConstructor:U,className:L,renderAs:S,...V}=e;if(this.barcodeInstance!==null){const k=I(V,p);(c||"svg")!==(S||"svg")?(this.barcodeInstance!==null&&(this.barcodeInstance.destroy(),this.barcodeInstance=null),this.instantiateCoreBarcode()):k&&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 i.createElement(O.Provider,{value:this.contextValue},i.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)}}l.propTypes={dir:g.string,renderAs:g.oneOf(["svg","canvas"])},l.defaultProps={renderAs:"svg"};class w 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 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 i.createElement(l,{...s,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:n=>this._baseBarcode=n,barcodeConstructor:f.Barcode,getTarget:this.getTarget,className:u.classNames("k-barcode",t)},e)}exportImage(e={}){return a.exportImage(this.exportVisual(),e)}exportSVG(e={}){return a.exportSVG(this.exportVisual(),e)}exportVisual(e){return this.barcodeInstance!==null?this.barcodeInstance.exportVisual(e):new a.Group}}const P="#000",E="#fff",N="L";class R extends i.Component{constructor(){super(...arguments),this._baseBarcode=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>Object.assign({},e,{background:this.props.background||E,border:this.props.border,color:this.props.color||P,encoding:this.props.encoding,errorCorrection:this.props.errorCorrection||N,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 i.createElement(l,{...s,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:n=>this._baseBarcode=n,barcodeConstructor:f.QRCode,getTarget:this.getTarget,className:u.classNames("k-qrcode",t)},e)}exportImage(e={}){return a.exportImage(this.exportVisual(),e)}exportSVG(e={}){return a.exportSVG(this.exportVisual(),e)}exportVisual(e){return this.barcodeInstance!==null?this.barcodeInstance.exportVisual(e):new a.Group}}o.Barcode=w,o.QRCode=R,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
5
+ (function(o,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-charts"),require("@progress/kendo-drawing")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-charts","@progress/kendo-drawing"],d):(o=typeof globalThis<"u"?globalThis:o||self,d(o.KendoReactBarcodes={},o.React,o.PropTypes,o.KendoReactCommon,o.KendoCharts,o.KendoDrawing))})(this,function(o,d,f,u,b,a){"use strict";"use client";function B(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 i=B(d),x=1e3/60,C=r=>{let e,t,s=[];const n=()=>e,h=c=>{e=r(e,c),u.canUseDOM&&(window.clearTimeout(t),t=window.setTimeout(()=>s.forEach(p=>p()),x))},O=c=>(s.push(c),()=>s=s.filter(p=>p!==c));return h({}),{getState:n,dispatch:h,subscribe:O}},I=(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[]},g=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(g(s)&&g(n)?m(s,n):s!==n)return!0}return!1},_=(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=i.createContext(null);v.displayName="BarcodeContext";const y={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 l extends i.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}))},u.validatePackage(y),this.observersStore=C(I),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:h,className:O,renderAs:c,...p}=this.props,{children:A,deriveOptionsFromParent:F,getTarget:j,barcodeConstructor:D,className:U,renderAs:R,...S}=e;if(this.barcodeInstance!==null){const V=_(S,p);(c||"svg")!==(R||"svg")?(this.barcodeInstance!==null&&(this.barcodeInstance.destroy(),this.barcodeInstance=null),this.instantiateCoreBarcode()):V&&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 i.createElement(v.Provider,{value:this.contextValue},i.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)}}l.propTypes={dir:f.string,renderAs:f.oneOf(["svg","canvas"])},l.defaultProps={renderAs:"svg"};class T 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 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 i.createElement(l,{...s,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:n=>this._baseBarcode=n,barcodeConstructor:b.Barcode,getTarget:this.getTarget,className:u.classNames("k-barcode",t)},e)}exportImage(e={}){return a.exportImage(this.exportVisual(),e)}exportSVG(e={}){return a.exportSVG(this.exportVisual(),e)}exportVisual(e){return this.barcodeInstance!==null?this.barcodeInstance.exportVisual(e):new a.Group}}const w="#000",E="#fff",P="L";class N extends i.Component{constructor(){super(...arguments),this._baseBarcode=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>Object.assign({},e,{background:this.props.background||E,border:this.props.border,color:this.props.color||w,encoding:this.props.encoding,errorCorrection:this.props.errorCorrection||P,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 i.createElement(l,{...s,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:n=>this._baseBarcode=n,barcodeConstructor:b.QRCode,getTarget:this.getTarget,className:u.classNames("k-qrcode",t)},e)}exportImage(e={}){return a.exportImage(this.exportVisual(),e)}exportSVG(e={}){return a.exportSVG(this.exportVisual(),e)}exportVisual(e){return this.barcodeInstance!==null?this.barcodeInstance.exportVisual(e):new a.Group}}o.Barcode=T,o.QRCode=N,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
package/index.d.mts 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
+ export * from './index';
package/index.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- "use client";"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;
5
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),h=require("prop-types"),l=require("@progress/kendo-react-common"),g=require("@progress/kendo-charts"),i=require("@progress/kendo-drawing");function I(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=I(C),x=1e3/60,_=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))},p=a=>(s.push(a),()=>s=s.filter(c=>c!==a));return d({}),{getState:n,dispatch:d,subscribe:p}},w=_,y=(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",f=(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)?f(s,n):s!==n)return!0}return!1},T=(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(f(r[t],e[t]))return!0;return!1},m=o.createContext(null);m.displayName="BarcodeContext";const P={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 u 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(P),this.observersStore=w(y),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:p,renderAs:a,...c}=this.props,{children:D,deriveOptionsFromParent:S,getTarget:A,barcodeConstructor:F,className:j,renderAs:v,...O}=e;if(this.barcodeInstance!==null){const B=T(O,c);(a||"svg")!==(v||"svg")?(this.barcodeInstance!==null&&(this.barcodeInstance.destroy(),this.barcodeInstance=null),this.instantiateCoreBarcode()):B&&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(m.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)}}u.propTypes={dir:h.string,renderAs:h.oneOf(["svg","canvas"])};u.defaultProps={renderAs:"svg"};class R 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(u,{...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 E="#000",k="#fff",N="L";class V extends o.Component{constructor(){super(...arguments),this._baseBarcode=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>Object.assign({},e,{background:this.props.background||k,border:this.props.border,color:this.props.color||E,encoding:this.props.encoding,errorCorrection:this.props.errorCorrection||N,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(u,{...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=R;exports.QRCode=V;
package/index.mjs CHANGED
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  "use client";
6
6
  import * as n from "react";
7
- import * as l from "prop-types";
7
+ import l from "prop-types";
8
8
  import { canUseDOM as I, validatePackage as x, classNames as u } from "@progress/kendo-react-common";
9
9
  import { Barcode as _, QRCode as w } from "@progress/kendo-charts";
10
10
  import { exportImage as b, exportSVG as g, Group as m } from "@progress/kendo-drawing";
@@ -49,7 +49,7 @@ const N = {
49
49
  name: "@progress/kendo-react-barcodes",
50
50
  productName: "KendoReact",
51
51
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
52
- publishDate: 1702377202,
52
+ publishDate: 1702631840,
53
53
  version: "",
54
54
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
55
55
  };
@@ -171,7 +171,7 @@ d.propTypes = {
171
171
  d.defaultProps = {
172
172
  renderAs: "svg"
173
173
  };
174
- class M extends n.Component {
174
+ class K extends n.Component {
175
175
  constructor() {
176
176
  super(...arguments), this._baseBarcode = null, this.getTarget = () => this, this.deriveOptionsFromParent = (e) => Object.assign({}, e, {
177
177
  background: this.props.background,
@@ -251,7 +251,7 @@ class M extends n.Component {
251
251
  }
252
252
  }
253
253
  const V = "#000", k = "#fff", A = "L";
254
- class K extends n.Component {
254
+ class W extends n.Component {
255
255
  constructor() {
256
256
  super(...arguments), this._baseBarcode = null, this.getTarget = () => this, this.deriveOptionsFromParent = (e) => Object.assign({}, e, {
257
257
  background: this.props.background || k,
@@ -331,6 +331,6 @@ class K extends n.Component {
331
331
  }
332
332
  }
333
333
  export {
334
- M as Barcode,
335
- K as QRCode
334
+ K as Barcode,
335
+ W as QRCode
336
336
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-barcodes",
3
- "version": "7.0.1",
3
+ "version": "7.0.2-develop.2",
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",
@@ -10,17 +10,23 @@
10
10
  "types": "./index.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
- "import": "./index.mjs",
14
- "require": "./index.js"
13
+ "import": {
14
+ "types": "./index.d.mts",
15
+ "default": "./index.mjs"
16
+ },
17
+ "require": {
18
+ "types": "./index.d.ts",
19
+ "default": "./index.js"
20
+ }
15
21
  }
16
22
  },
17
23
  "sideEffects": false,
18
24
  "peerDependencies": {
19
25
  "@progress/kendo-charts": "^1.32.0",
20
26
  "@progress/kendo-drawing": "^1.17.2",
21
- "@progress/kendo-licensing": "^1.3.0",
22
- "@progress/kendo-react-common": "7.0.1",
23
- "@progress/kendo-react-intl": "7.0.1",
27
+ "@progress/kendo-licensing": "^1.3.4",
28
+ "@progress/kendo-react-common": "7.0.2-develop.2",
29
+ "@progress/kendo-react-intl": "7.0.2-develop.2",
24
30
  "hammerjs": "^2.0.0",
25
31
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
26
32
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"