UNPKG

smart-webcomponents-angular

Version:

[![Price](https://img.shields.io/badge/price-COMMERCIAL-0098f7.svg)](https://jqwidgets.com/license/)

107 lines (106 loc) 9.76 kB
import { Barcode } from './../index'; import { BarcodeLabelPosition, BarcodeRenderAs, BarcodeType } from './../index'; import { AfterViewInit, ElementRef, OnInit, OnChanges, OnDestroy, SimpleChanges, EventEmitter } from '@angular/core'; import { BaseElement } from './smart.element'; import * as i0 from "@angular/core"; export { BarcodeLabelPosition, BarcodeRenderAs, BarcodeType, ElementRenderMode } from './../index'; export { Smart } from './smart.element'; export { Barcode } from './../index'; export declare class BarcodeComponent extends BaseElement implements OnInit, AfterViewInit, OnDestroy, OnChanges { constructor(ref: ElementRef<Barcode>); private eventHandlers; nativeElement: Barcode; /** @description Creates the component on demand. * @param properties An optional object of properties, which will be added to the template binded ones. */ createComponent(properties?: {}): any; /** @description Defines the background color that appears behind the barcode element. This setting determines the color fill for the area surrounding and underneath the barcode, helping to improve contrast and overall barcode visibility. Accepts color values in standard CSS formats (e.g., hex, RGB, or color names). */ get backgroundColor(): string; set backgroundColor(value: string); /** @description Determines whether the barcode label is displayed on the interface. When set to true, the barcode label will be visible; when set to false, the label will be hidden. */ get displayLabel(): boolean; set displayLabel(value: boolean); /** @description Specifies the color used for the text label displayed below or alongside the barcode. This color determines how the label appears to users and can be set using standard color values, such as hex codes (e.g., #000000 for black) or color names (e.g., "red"). */ get labelColor(): string; set labelColor(value: string); /** @description Specifies the font family to be used for displaying the text on the barcode label. This determines the appearance of the label's text by applying the selected font style. */ get labelFont(): string; set labelFont(value: string); /** @description Specifies the font size used for the text displayed on the barcode label, allowing you to control the readability and appearance of the label’s text. Accepts standard CSS font size units such as px, em, rem, or pt. */ get labelFontSize(): number; set labelFontSize(value: number); /** @description Specifies the amount of space, in pixels or other units, to be applied as the margin below the barcode label. This determines the distance between the bottom edge of the barcode label and any content or elements directly beneath it. */ get labelMarginBottom(): number; set labelMarginBottom(value: number); /** @description Specifies the amount of space added to the top of the barcode label by setting the top margin. This determines how far the label is positioned from the top edge of its container or surrounding elements. Accepts values in units such as pixels (px), em, or percentages (%). */ get labelMarginTop(): number; set labelMarginTop(value: number); /** @description Specifies the exact placement of the barcode label relative to the barcode image, allowing you to control where the label appears (e.g., above, below, left, or right of the barcode). This property ensures the label is positioned according to your layout requirements. */ get labelPosition(): BarcodeLabelPosition | string; set labelPosition(value: BarcodeLabelPosition | string); /** @description Specifies the color to be used for the barcode lines or bars, allowing you to customize the appearance of the barcode by changing its foreground color. This setting does not affect the background color of the barcode. Use a valid color value (e.g., HEX, RGB, or color name) as supported by your implementation. */ get lineColor(): string; set lineColor(value: string); /** @description Specifies the height, in pixels, of each individual barcode line. Increasing this value will make the barcode lines taller, while decreasing it will reduce their height. This property is useful for adjusting the overall visibility and scannability of the barcode. */ get lineHeight(): number; set lineHeight(value: number); /** @description Specifies the thickness of each individual bar in the barcode, allowing you to control how wide the printed barcode lines appear. Adjusting this value can help improve barcode readability for different scanners and printing methods. */ get lineWidth(): number; set lineWidth(value: number); /** @description Specifies the rendering mode used to display the barcode, determining whether it is generated as a vector graphic (such as SVG), a raster image (such as PNG), or using another supported format. This setting affects the appearance, scalability, and performance of the rendered barcode. */ get renderAs(): BarcodeRenderAs | string; set renderAs(value: BarcodeRenderAs | string); /** @description Specifies the format or symbology of the barcode to be generated (e.g., Code128, QR Code, EAN-13, UPC-A). This determines how the data will be encoded and displayed within the barcode. */ get type(): BarcodeType | string; set type(value: BarcodeType | string); /** @description Retrieves the current value of the barcode or updates it with a new value. This property allows you to access the existing barcode data or assign a new barcode value programmatically. */ get value(): string; set value(value: string); /** @description Specifies or retrieves the width of the barcode in pixels. If the width is set to 0, the barcode’s width will be automatically calculated based on its content and type. Use this property to define a fixed width for the barcode, or set it to 0 to allow automatic sizing for optimal readability. */ get width(): number; set width(value: number); /** @description Defines or retrieves the height of the barcode, in pixels. When a value of 0 is assigned, the barcode's height will be determined automatically based on its content and format, ensuring optimal sizing without manual specification. If a positive value is provided, the barcode will be rendered at that exact height. */ get height(): number; set height(value: number); /** @description This event is triggered whenever the scanned or entered barcode value does not meet the required validation criteria. It typically occurs when the barcode is missing, formatted incorrectly, or contains unsupported characters, allowing you to handle validation errors and provide appropriate feedback to the user. * @param event. The custom event. Custom event was created with: event.detail( invalidCharacters, lengthValidity, patternValidity, value) * invalidCharacters - An array indicating the invalid characters. * lengthValidity - A boolean indicating the length validity. * patternValidity - A boolean indicating the pattern validity. * value - the invalid value of the barcode. */ onInvalid: EventEmitter<CustomEvent>; /** @description Exports the generated barcode image or data for use outside the application. This function typically saves or downloads the barcode in formats such as PNG, JPEG, or SVG, making it accessible for printing, sharing, or integration with other systems. * @param {string} format. The format of the exported file - svg, png, jpg * @param {string} fileName?. The name of the exported file */ export(format: string, fileName?: string): void; /** @description Retrieves the barcode image encoded as a Base64 string, allowing for convenient embedding or transmission of the barcode in web applications or APIs without needing a physical image file. * @param {string} format. The dataURL format of the string - svg, png, jpg * @returns {string} */ getDataURL(format: any): Promise<any>; getDataURLSync(format: any): string; /** @description Retrieves the barcode image encoded as a Base64 string, allowing you to easily embed or transmit the barcode in formats such as HTML, CSS, or JSON. * @param {string} format. The dataURL format of the string - svg, png, jpg * @returns {any} */ getDataURLAsync(format: any): Promise<any>; getDataURLAsyncSync(format: any): any; /** @description Retrieves the validation status of the barcode, indicating whether the scanned barcode meets the required format and integrity checks. * @returns {boolean} */ isValid(): Promise<any>; isValidSync(): boolean; get isRendered(): boolean; ngOnInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; ngOnChanges(changes: SimpleChanges): void; /** @description Add event listeners. */ private listen; /** @description Remove event listeners. */ private unlisten; static ɵfac: i0.ɵɵFactoryDeclaration<BarcodeComponent, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<BarcodeComponent, "smart-barcode, [smart-barcode]", ["smart-barcode"], { "backgroundColor": "backgroundColor"; "displayLabel": "displayLabel"; "labelColor": "labelColor"; "labelFont": "labelFont"; "labelFontSize": "labelFontSize"; "labelMarginBottom": "labelMarginBottom"; "labelMarginTop": "labelMarginTop"; "labelPosition": "labelPosition"; "lineColor": "lineColor"; "lineHeight": "lineHeight"; "lineWidth": "lineWidth"; "renderAs": "renderAs"; "type": "type"; "value": "value"; "width": "width"; "height": "height"; }, { "onInvalid": "onInvalid"; }, never>; }