@progress/kendo-react-barcodes 7.0.0-develop.9 → 7.0.1-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-barcodes.js +1 -1
- package/index.js +1 -1
- package/index.mjs +2 -1
- package/package.json +4 -3
|
@@ -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";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,_,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"})});
|
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 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 _=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
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
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";
|
|
5
6
|
import * as n from "react";
|
|
6
7
|
import * as l from "prop-types";
|
|
7
8
|
import { canUseDOM as I, validatePackage as x, classNames as u } from "@progress/kendo-react-common";
|
|
@@ -48,7 +49,7 @@ const N = {
|
|
|
48
49
|
name: "@progress/kendo-react-barcodes",
|
|
49
50
|
productName: "KendoReact",
|
|
50
51
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
51
|
-
publishDate:
|
|
52
|
+
publishDate: 1702314356,
|
|
52
53
|
version: "",
|
|
53
54
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
54
55
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-barcodes",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1-develop.1",
|
|
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",
|
|
7
7
|
"homepage": "https://www.telerik.com/kendo-react-ui",
|
|
8
8
|
"main": "./index.js",
|
|
9
|
+
"module": "./index.mjs",
|
|
9
10
|
"types": "./index.d.ts",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
@@ -18,8 +19,8 @@
|
|
|
18
19
|
"@progress/kendo-charts": "^1.32.0",
|
|
19
20
|
"@progress/kendo-drawing": "^1.17.2",
|
|
20
21
|
"@progress/kendo-licensing": "^1.3.0",
|
|
21
|
-
"@progress/kendo-react-common": "7.0.
|
|
22
|
-
"@progress/kendo-react-intl": "7.0.
|
|
22
|
+
"@progress/kendo-react-common": "7.0.1-develop.1",
|
|
23
|
+
"@progress/kendo-react-intl": "7.0.1-develop.1",
|
|
23
24
|
"hammerjs": "^2.0.0",
|
|
24
25
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
25
26
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|