🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

react-code39-barcode

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-code39-barcode - npm Package Compare versions

Comparing version

to
0.1.5

@@ -1,1 +0,1 @@

import e from"react";const t={0:"101001101101",1:"110100101011",2:"101100101011",3:"110110010101",4:"101001101011",5:"110100110101",6:"101100110101",7:"101001011011",8:"110100101101",9:"101100101101",A:"110101001011",B:"101101001011",C:"110110100101",D:"101011001011",E:"110101100101",F:"101101100101",G:"101010011011",H:"110101001101",I:"101101001101",J:"101011001101",K:"110101010011",L:"101101010011",M:"110110101001",N:"101011010011",O:"110101101001",P:"101101101001",Q:"101010110011",R:"110101011001",S:"101101011001",T:"101011011001",U:"110010101011",V:"100110101011",W:"110011010101",X:"100101101011",Y:"110010110101",Z:"100110110101","-":"100101011011",".":"110010101101"," ":"100110101101",$:"100100100101","/":"100100101001","+":"100101001001","%":"101001001001","*":"100101101101"};function o(e,o,r,i,n,l,a,s,c,h){const d="*"+e.toUpperCase()+"*";let f="";for(let e of d){if(!t[e])throw new Error(`Invalid character for Code39 barcode: ${e}`);f+=t[e]+"0"}const g=[];let p=0;for(let e of f)"1"===e?p+=1:(g.push(p),p=0);let $=0,w="";for(let e of g){const t=2===e?2*r:0;0!==e&&(w+=`<rect x="${$}" y="0" width="${r+t}" height="${o}" />`,$+=r+t),$+=r}s||(s="black"),c||(c=s);return`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" version="1.1" height="${o}"><g style="fill:${s};">${w}</g></svg>${i?`<div style="font: ${n}px ${l}; text-align:center; width: ${$}px; color: ${c}; line-height: ${h}px; font-weight: ${a}" >${e.toUpperCase()}</div>`:""}`}function r({value:t="",height:r=60,width:i=1,showValue:n=!0,fontSize:l=16,fontFamily:a="monospace",fontWeight:s="500",padding:c=10,color:h="black",textColor:d="",lineSpacing:f=10,className:g="",id:p=""}){if(!t)throw new Error("Barcode39Svg: value prop is required");return e.createElement("div",{id:p,className:g,style:{padding:c},dangerouslySetInnerHTML:{__html:o(t,r,i,n,l,a,s,h,d,f)}})}export{r as Barcode39Svg};
import e from"react";const t={0:"101001101101",1:"110100101011",2:"101100101011",3:"110110010101",4:"101001101011",5:"110100110101",6:"101100110101",7:"101001011011",8:"110100101101",9:"101100101101",A:"110101001011",B:"101101001011",C:"110110100101",D:"101011001011",E:"110101100101",F:"101101100101",G:"101010011011",H:"110101001101",I:"101101001101",J:"101011001101",K:"110101010011",L:"101101010011",M:"110110101001",N:"101011010011",O:"110101101001",P:"101101101001",Q:"101010110011",R:"110101011001",S:"101101011001",T:"101011011001",U:"110010101011",V:"100110101011",W:"110011010101",X:"100101101011",Y:"110010110101",Z:"100110110101","-":"100101011011",".":"110010101101"," ":"100110101101",$:"100100100101","/":"100100101001","+":"100101001001","%":"101001001001","*":"100101101101"};function o(e,o,r,i,n,l,a,s,c,h){const d="*"+e.toUpperCase()+"*";let f="";for(let e of d){if(!t[e])throw new Error(`Invalid character for Code39 barcode: ${e}`);f+=t[e]+"0"}const g=[];let p=0;for(let e of f)"1"===e?p+=1:(g.push(p),p=0);let $=0,w="";for(let e of g){const t=2===e?2*r:0;0!==e&&(w+=`<rect x="${$}" y="0" width="${r+t}" height="${o}" />`,$+=r+t),$+=r}s||(s="black"),c||(c=s);return`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" version="1.1" height="${o}"><g style="fill:${s};">${w}</g></svg>${i?`<div style="font: ${n}px ${l}; text-align:center; width: ${$}px; color: ${c}; ${h?"line-height:"+h+"px":""}; font-weight: ${a}" >${e.toUpperCase()}</div>`:""}`}function r({value:t="",height:r=60,width:i=1,showValue:n=!0,fontSize:l=16,fontFamily:a="monospace",fontWeight:s="500",padding:c=10,color:h="black",textColor:d="",lineSpacing:f,className:g="",id:p=""}){if(!t)throw new Error("Barcode39Svg: value prop is required");return e.createElement("div",{id:p,className:g,style:{padding:c},dangerouslySetInnerHTML:{__html:o(t,r,i,n,l,a,s,h,d,f)}})}export{r as Barcode39Svg};
{
"name": "react-code39-barcode",
"version": "0.1.4",
"version": "0.1.5",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.es.js",

@@ -29,2 +29,3 @@ # React Code39 Barcode

## Output
![Code39 Barcode Example](image.png)

@@ -45,5 +46,5 @@

| showText | boolean | true | Whether to display the text below the barcode. |
| lineSpacing | number | 10 | The spacing between the display text and the barcode. |
| className | string | "" | Any valid css class that will be applied to the barcode container |
| id | string | "" | HTML id for the barcode container |
| lineSpacing | number | - | The spacing between the display text and the barcode. |
| className | string | - | Any valid css class that will be applied to the barcode container |
| id | string | - | HTML id for the barcode container |

@@ -50,0 +51,0 @@ ## License