react-jsbarcode 1.1.2 → 1.1.4
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/lib/chunk-KBOMTZTD.js +2 -0
- package/lib/chunk-KBOMTZTD.js.map +1 -0
- package/lib/core/react-barcode.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +21 -18
- package/lib/chunk-PFBADHMX.js +0 -2
- package/lib/chunk-PFBADHMX.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import n from'jsbarcode';import {useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function u({style:r,className:t,value:o,options:s,renderer:c="svg"}){let e=useRef(null);switch(useEffect(()=>{e.current&&n(e.current,o,s);},[o,s,c]),c){case "canvas":return jsx("canvas",{ref:e,style:r,className:t});case "image":return jsx("img",{ref:e,alt:"barcode",style:r,className:t});default:return jsx("svg",{ref:e,style:r,className:t})}}export{u as a};//# sourceMappingURL=chunk-KBOMTZTD.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-KBOMTZTD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/react-barcode.tsx"],"names":["ReactBarcode","style","className","value","options","renderer","containerRef","useRef","useEffect","JsBarcode","jsx"],"mappings":"kGAsBO,SAASA,EAAa,CAC3B,KAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,MAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,OACF,CAAA,CAAmD,CACjD,IAAMC,CAAAA,CAAeC,MAAAA,CAAc,IAAI,CAAA,CAQvC,OANAC,UAAU,IAAM,CACVF,EAAa,OAAA,EACfG,CAAAA,CAAUH,EAAa,OAAA,CAASH,CAAAA,CAAOC,CAAO,EAElD,CAAA,CAAG,CAACD,CAAAA,CAAOC,EAASC,CAAQ,CAAC,EAErBA,CAAAA,EACN,KAAK,QAAA,CACH,OAAOK,IAAC,QAAA,CAAA,CAAO,GAAA,CAAKJ,EAAc,KAAA,CAAOL,CAAAA,CAAO,UAAWC,CAAAA,CAAW,CAAA,CACxE,KAAK,OAAA,CACH,OAAOQ,IAAC,KAAA,CAAA,CAAI,GAAA,CAAKJ,EAAc,GAAA,CAAI,SAAA,CAAU,MAAOL,CAAAA,CAAO,SAAA,CAAWC,EAAW,CAAA,CACnF,QACE,OAAOQ,GAAAA,CAAC,KAAA,CAAA,CAAI,IAAKJ,CAAAA,CAAc,KAAA,CAAOL,EAAO,SAAA,CAAWC,CAAAA,CAAW,CACvE,CACF","file":"chunk-KBOMTZTD.js","sourcesContent":["import JsBarcode, { type Options } from 'jsbarcode';\nimport { useEffect, useRef, type CSSProperties } from 'react';\nimport { Renderer } from '../types/index.js';\n\nexport interface ReactBarcodeProps {\n /**\n * JSBarcode renderer type\n * @enum\n */\n renderer?: Renderer;\n /**\n * Value to be rendered as barcode\n */\n value: string;\n /**\n * JSBarcode options\n */\n options?: Options;\n style?: CSSProperties;\n className?: string;\n}\n\nexport function ReactBarcode({\n style,\n className,\n value,\n options,\n renderer = Renderer.SVG,\n}: Readonly<ReactBarcodeProps>): React.JSX.Element {\n const containerRef = useRef<never>(null);\n\n useEffect(() => {\n if (containerRef.current) {\n JsBarcode(containerRef.current, value, options);\n }\n }, [value, options, renderer]);\n\n switch (renderer) {\n case 'canvas':\n return <canvas ref={containerRef} style={style} className={className} />;\n case 'image':\n return <img ref={containerRef} alt=\"barcode\" style={style} className={className} />;\n default:\n return <svg ref={containerRef} style={style} className={className} />;\n }\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as ReactBarcode}from'../chunk-
|
|
1
|
+
export{a as ReactBarcode}from'../chunk-KBOMTZTD.js';import'../chunk-K2TCKD5G.js';//# sourceMappingURL=react-barcode.js.map
|
|
2
2
|
//# sourceMappingURL=react-barcode.js.map
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as ReactBarcode}from'./chunk-
|
|
1
|
+
export{a as ReactBarcode}from'./chunk-KBOMTZTD.js';export{a as Renderer}from'./chunk-K2TCKD5G.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-jsbarcode",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JSBarcode component for React",
|
|
6
6
|
"homepage": "http://github.com/iamchathu/react-jsbarcode",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/iamchathu/react-jsbarcode.git"
|
|
9
|
+
"url": "git+https://github.com/iamchathu/react-jsbarcode.git"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./lib/index.d.ts",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"import": "./lib/index.js",
|
|
15
|
+
"default": "./lib/index.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
@@ -31,30 +31,33 @@
|
|
|
31
31
|
"build-storybook": "storybook build"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"jsbarcode": "^3.
|
|
34
|
+
"jsbarcode": "^3.12.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@commitlint/cli": "^20.4.
|
|
38
|
-
"@commitlint/config-conventional": "^20.4.
|
|
37
|
+
"@commitlint/cli": "^20.4.3",
|
|
38
|
+
"@commitlint/config-conventional": "^20.4.3",
|
|
39
|
+
"@eslint/compat": "^2.0.2",
|
|
40
|
+
"@eslint/eslintrc": "^3.3.4",
|
|
41
|
+
"@eslint/js": "^10.0.1",
|
|
39
42
|
"@semantic-release/changelog": "^6.0.3",
|
|
40
43
|
"@semantic-release/git": "^10.0.1",
|
|
41
44
|
"@storybook/addon-docs": "^10.2.13",
|
|
42
45
|
"@storybook/addon-links": "^10.2.13",
|
|
43
|
-
"@storybook/react": "^10.2.13",
|
|
44
46
|
"@storybook/react-vite": "^10.2.13",
|
|
45
|
-
"@types/react": "^
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
47
|
-
"@typescript-eslint/parser": "^
|
|
48
|
-
"eslint": "^
|
|
49
|
-
"eslint-config-prettier": "^
|
|
50
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
51
|
-
"eslint-plugin-react": "^7.
|
|
52
|
-
"eslint-plugin-react-hooks": "^
|
|
47
|
+
"@types/react": "^19.2.14",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
49
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
50
|
+
"eslint": "^10.0.2",
|
|
51
|
+
"eslint-config-prettier": "^10.1.8",
|
|
52
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
53
|
+
"eslint-plugin-react": "^7.37.5",
|
|
54
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
53
55
|
"eslint-plugin-storybook": "^10.2.13",
|
|
54
56
|
"husky": "^9.1.7",
|
|
55
|
-
"lint-staged": "^16.2
|
|
57
|
+
"lint-staged": "^16.3.2",
|
|
56
58
|
"prettier": "^3.8.1",
|
|
57
|
-
"react": "^
|
|
59
|
+
"react": "^19.2.4",
|
|
60
|
+
"react-dom": "^19.2.4",
|
|
58
61
|
"rimraf": "^6.1.3",
|
|
59
62
|
"semantic-release": "^25.0.3",
|
|
60
63
|
"storybook": "^10.2.13",
|
package/lib/chunk-PFBADHMX.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import f from'jsbarcode';import {useRef,useCallback,useEffect}from'react';import {jsx}from'react/jsx-runtime';function S({style:r,className:t,value:a,options:c,renderer:n="svg"}){let e=useRef(null),o=useCallback(f,[a,e.current,c]);switch(useEffect(()=>{o(e.current,a,c);},[o,a,c,n]),n){case "canvas":return jsx("canvas",{ref:e,style:r,className:t});case "image":return jsx("img",{ref:e,alt:"barcode",style:r,className:t});default:return jsx("svg",{ref:e,style:r,className:t})}}export{S as a};//# sourceMappingURL=chunk-PFBADHMX.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-PFBADHMX.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/react-barcode.tsx"],"names":["ReactBarcode","style","className","value","options","renderer","containerRef","useRef","renderBarcode","useCallback","JsBarcode","useEffect","jsx"],"mappings":"8GAsBO,SAASA,EAAa,CAC3B,KAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,SAAAC,CAAAA,CAAAA,KACF,CAAA,CAAmD,CACjD,IAAMC,CAAAA,CAAeC,OAAc,IAAI,CAAA,CAEjCC,CAAAA,CAAgBC,WAAAA,CAAYC,CAAAA,CAAW,CAACP,EAAOG,CAAAA,CAAa,OAAA,CAASF,CAAO,CAAC,CAAA,CAMnF,OAJAO,SAAAA,CAAU,IAAM,CACdH,CAAAA,CAAcF,CAAAA,CAAa,OAAA,CAASH,EAAOC,CAAO,EACpD,EAAG,CAACI,CAAAA,CAAeL,EAAOC,CAAAA,CAASC,CAAQ,CAAC,CAAA,CAEpCA,CAAAA,EACN,KAAK,QAAA,CACH,OAAOO,IAAC,QAAA,CAAA,CAAO,GAAA,CAAKN,EAAc,KAAA,CAAOL,CAAAA,CAAO,SAAA,CAAWC,CAAAA,CAAW,CAAA,CACxE,KAAK,QACH,OAAOU,GAAAA,CAAC,OAAI,GAAA,CAAKN,CAAAA,CAAc,IAAI,SAAA,CAAU,KAAA,CAAOL,CAAAA,CAAO,SAAA,CAAWC,CAAAA,CAAW,CAAA,CACnF,QACE,OAAOU,GAAAA,CAAC,OAAI,GAAA,CAAKN,CAAAA,CAAc,MAAOL,CAAAA,CAAO,SAAA,CAAWC,CAAAA,CAAW,CACvE,CACF","file":"chunk-PFBADHMX.js","sourcesContent":["import JsBarcode, { type Options } from 'jsbarcode';\nimport { useCallback, useEffect, useRef, type CSSProperties } from 'react';\nimport { Renderer } from '../types/index.js';\n\nexport interface ReactBarcodeProps {\n /**\n * JSBarcode renderer type\n * @enum\n */\n renderer?: Renderer;\n /**\n * Value to be rendered as barcode\n */\n value: string;\n /**\n * JSBarcode options\n */\n options?: Options;\n style?: CSSProperties;\n className?: string;\n}\n\nexport function ReactBarcode({\n style,\n className,\n value,\n options,\n renderer = Renderer.SVG,\n}: Readonly<ReactBarcodeProps>): React.JSX.Element {\n const containerRef = useRef<never>(null);\n\n const renderBarcode = useCallback(JsBarcode, [value, containerRef.current, options]);\n\n useEffect(() => {\n renderBarcode(containerRef.current, value, options);\n }, [renderBarcode, value, options, renderer]);\n\n switch (renderer) {\n case 'canvas':\n return <canvas ref={containerRef} style={style} className={className} />;\n case 'image':\n return <img ref={containerRef} alt=\"barcode\" style={style} className={className} />;\n default:\n return <svg ref={containerRef} style={style} className={className} />;\n }\n}\n"]}
|