react-jsbarcode
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -5,2 +5,8 @@ # Changelog | ||
### [0.2.2](https://github.com/iamchathu/react-jsbarcode/compare/v0.2.1...v0.2.2) (2021-10-08) | ||
### Features | ||
- add className and style support ([cd4d63a](https://github.com/iamchathu/react-jsbarcode/commit/cd4d63ac6a42ba2401f95898c548c318aed7dca3)) | ||
### [0.2.1](https://github.com/iamchathu/react-jsbarcode/compare/v0.2.0...v0.2.1) (2021-10-07) | ||
@@ -7,0 +13,0 @@ |
@@ -1,2 +0,2 @@ | ||
/// <reference types="react" /> | ||
import * as React from 'react'; | ||
import { Options } from 'jsbarcode'; | ||
@@ -12,6 +12,8 @@ export declare const enum Renderer { | ||
options?: Options; | ||
style?: React.CSSProperties; | ||
className?: string; | ||
} | ||
export { Options }; | ||
declare const ReactBarcode: ({ value, options, renderer }: ReactBarcodeProps) => JSX.Element; | ||
declare const ReactBarcode: ({ style, className, value, options, renderer }: ReactBarcodeProps) => JSX.Element; | ||
export default ReactBarcode; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -28,3 +28,3 @@ "use strict"; | ||
const jsbarcode_1 = __importDefault(require("jsbarcode")); | ||
const ReactBarcode = ({ value, options, renderer = "svg" /* svg */ }) => { | ||
const ReactBarcode = ({ style, className, value, options, renderer = "svg" /* svg */ }) => { | ||
const containerRef = React.useRef(null); | ||
@@ -36,7 +36,7 @@ React.useEffect(() => { | ||
case 'canvas': | ||
return (0, jsx_runtime_1.jsx)("canvas", { ref: containerRef }, void 0); | ||
return (0, jsx_runtime_1.jsx)("canvas", { ref: containerRef, style: style, className: className }, void 0); | ||
case 'image': | ||
return (0, jsx_runtime_1.jsx)("img", { ref: containerRef, alt: "barcode" }, void 0); | ||
return (0, jsx_runtime_1.jsx)("img", { ref: containerRef, alt: "barcode", style: style, className: className }, void 0); | ||
default: | ||
return (0, jsx_runtime_1.jsx)("svg", { ref: containerRef }, void 0); | ||
return (0, jsx_runtime_1.jsx)("svg", { ref: containerRef, style: style, className: className }, void 0); | ||
} | ||
@@ -43,0 +43,0 @@ }; |
{ | ||
"name": "react-jsbarcode", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "JSBarcode component for React", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/iamchathu/react-jsbarcode", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
10437
59