@progress/kendo-angular-barcodes
Version:
Kendo UI Angular Barcodes
110 lines (109 loc) • 3.13 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Border, Margin, Padding, RenderMode } from './field-types';
/**
* Supported symbologies (encodings) for the Barcode component.
*/
export type BarcodeType = 'EAN8' | 'EAN13' | 'UPCE' | 'UPCA' | 'Code11' | 'Code39' | 'Code39Extended' | 'Code93' | 'Code93Extended' | 'Code128' | 'Code128A' | 'Code128B' | 'Code128C' | 'GS1-128' | 'MSImod10' | 'MSImod11' | 'MSImod1010' | 'MSImod1110' | 'POSTNET';
/**
* The Barcode text label configuration.
*/
export interface BarcodeText {
/**
* The color of the text. Any valid CSS color string will work here, including hex and rgb.
*
* @default "black"
*/
color?: string;
/**
* The font of the text.
*
* @default "16px Consolas, Monaco, Sans Mono, monospace, sans-serif"
*/
font?: string;
/**
* The margin of the text. A numeric value sets all margins.
*
* @default 0
*/
margin?: Margin | number;
/**
* A flag indicating that the Barcode text label is visible.
*
* If set to `false`, the Barcode will not display the value as a text below the barcode lines.
*
* @default true
*/
visible?: boolean;
}
/**
* The Barcode configuration options.
*/
export interface BarcodeOptions {
/**
* The background color of the Barcode. Accepts a valid CSS color string, including hex and rgb.
*
* @default "white"
*/
background?: string;
/**
* The border of the Barcode.
*/
border?: Border;
/**
* If set to `true`, the Barcode will display the checksum digit next to the value in the text area.
*
* @default true
*/
checksum?: boolean;
/**
* The color of the Barcode. Accepts a valid CSS color string, including hex and rgb.
*
* @default "black"
*/
color?: string;
/**
* The height of the Barcode in pixels.
*
* @default 100
*/
height?: number;
/**
* The padding of the Barcode. A numeric value sets all paddings.
*
* @default 0
*/
padding?: Padding | number;
/**
* Sets the preferred rendering mode of the Barcode.
*
* The supported values are:
* * `"canvas"`—Renders the component as a Canvas element.
* * `"svg"`—Renders the component as an inline SVG document.
*
* @default "svg"
*/
renderAs?: RenderMode;
/**
* The Barcode text label configuration.
*/
text?: BarcodeText;
/**
* The symbology (encoding) the Barcode will use.
*
* @default "Code39"
*/
type: BarcodeType;
/**
* The value of the Barcode.
*/
value: number | string;
/**
* The width of the Barcode in pixels.
*
* @default 300
*/
width?: number;
}