UNPKG

@syncfusion/ej2-barcode-generator

Version:

Barcode generator component is a pure JavaScript library which will convert a string to Barcode and show it to the user. This supports major 1D and 2D barcodes including coda bar, code 128, QR Code.

63 lines (62 loc) 2.08 kB
/** * svg renderer */ import { createHtmlElement } from '../utility/dom-util'; /** @private */ var BarcodeSVGRenderer = /** @class */ (function () { function BarcodeSVGRenderer() { } /** * Draw the root element for the barcode.\ * * @returns {HTMLElement} Draw the barcode SVG . * @param {Object} attribute - Provide the canvas element . * @private */ // eslint-disable-next-line BarcodeSVGRenderer.prototype.renderRootElement = function (attribute) { var canvasObj = createHtmlElement('canvase', attribute); return canvasObj; }; /** * Draw the rect for the barcode.\ * * @returns {HTMLElement} Draw the barcode SVG . * @param {Object} canvas - Provide the canvas element . * @param {Object} attribute - Provide the canvas element . * @private */ // eslint-disable-next-line BarcodeSVGRenderer.prototype.renderRect = function (canvas, attribute) { var canvasObj = createHtmlElement('canvase', attribute); return canvasObj; }; /** * Draw the horizontal line for the barcode.\ * * @returns {HTMLElement} Draw the barcode SVG . * @param {Object} canvas - Provide the canvas element . * @param {Object} attribute - Provide the canvas element . * @private */ // eslint-disable-next-line BarcodeSVGRenderer.prototype.renderLine = function (canvas, attribute) { var canvasObj = createHtmlElement('canvase', attribute); return canvasObj; }; /** * Draw the text for the barcode.\ * * @returns {HTMLElement} Draw the barcode SVG . * @param {Object} canvas - Provide the canvas element . * @param {Object} attribute - Provide the canvas element . * @private */ // eslint-disable-next-line BarcodeSVGRenderer.prototype.renderText = function (canvas, attribute) { var canvasObj = createHtmlElement('canvase', attribute); return canvasObj; }; return BarcodeSVGRenderer; }()); export { BarcodeSVGRenderer };