Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-barcode

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-barcode - npm Package Compare versions

Comparing version 1.4.6 to 1.5.0

8

lib/index.d.ts

@@ -0,4 +1,7 @@

import React from "react";
export interface Options {
width?: number;
height?: number;
renderer?: "canvas" | "img" | "svg";
format?:

@@ -9,2 +12,3 @@ | "CODE39"

| "ITF14"
| "ITF"
| "MSI"

@@ -34,3 +38,5 @@ | "pharmacode"

export default class Barcode extends React.Component<BarcodeProps> {}
export default class Barcode extends React.Component<BarcodeProps> {
renderElementRef: React.RefObject<HTMLCanvasElement | SVGElement | HTMLImageElement>;
}

27

lib/react-barcode.js
"use strict";
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var _react = _interopRequireDefault(require("react"));

@@ -11,4 +13,2 @@

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -95,13 +95,23 @@

value: function render() {
var _this$props = this.props,
id = _this$props.id,
className = _this$props.className;
if (this.props.renderer === 'svg') {
return _react["default"].createElement("svg", {
ref: this.renderElementRef
ref: this.renderElementRef,
id: id,
className: className
});
} else if (this.props.renderer === 'canvas') {
return _react["default"].createElement("canvas", {
ref: this.renderElementRef
ref: this.renderElementRef,
id: id,
className: className
});
} else if (this.props.renderer === 'img') {
return _react["default"].createElement("img", {
ref: this.renderElementRef
ref: this.renderElementRef,
id: id,
className: className
});

@@ -134,3 +144,5 @@ }

marginLeft: _propTypes["default"].number,
marginRight: _propTypes["default"].number
marginRight: _propTypes["default"].number,
id: _propTypes["default"].string,
className: _propTypes["default"].string
};

@@ -151,4 +163,5 @@ Barcode.defaultProps = {

lineColor: '#000000',
margin: 10
margin: 10,
className: ''
};
module.exports = Barcode;
{
"name": "react-barcode",
"version": "1.4.6",
"version": "1.5.0",
"description": "React component to generate barcodes",

@@ -5,0 +5,0 @@ "keywords": [

# react-barcode
<img src="https://raw.githubusercontent.com/kciter/react-barcode/master/images/barcode.png" alt="barcode" width="600"><br>

@@ -56,3 +57,5 @@ Preview: http://kciter.github.io/react-barcode/

marginLeft: undefined,
marginRight: undefined
marginRight: undefined,
id: undefined,
className: undefined
}

@@ -59,0 +62,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc