UNPKG

@aurigma/design-atoms

Version:

Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.

34 lines 1.79 kB
import { ShapeHandlerData } from "./ShapeHandlerData"; export class BarcodeHandlerData extends ShapeHandlerData { constructor(handler) { var _a, _b; super(handler); this.__type = "BarcodeHandlerData"; if (handler == null || handler.canvas == null) return; if (handler.canvas.viewerConfiguration && handler.canvas.viewerConfiguration.stubImages && handler.canvas.viewerConfiguration.stubImages.barcode) { const barcodeConf = handler.canvas.viewerConfiguration.stubImages.barcode; this.stubText = barcodeConf.text; this.errorText = barcodeConf.errorText; this.stubPostScriptName = barcodeConf.postScriptName; } const parentSurface = (handler.item.parentPlaceholder != null ? handler.item.parentPlaceholder.parentContainer.parentComponent : handler.item.parentContainer.parentComponent); const printArea = parentSurface.printAreas.getItem(0); this.dpi = (_b = (_a = handler.canvas.renderingConfigProvider.getHiResRendering(printArea)) === null || _a === void 0 ? void 0 : _a.dpi) !== null && _b !== void 0 ? _b : 72; this.size = Math.round(Math.max(printArea.bounds.width, printArea.bounds.height) / 2); } applyState(data, handler) { if (handler) { handler.beginUpdate(); //call endUpdate in base class handler.currentFileId = data.currentFileId; handler.stubTextImageFileId = data.stubTextImageFileId; handler.errorTextImageFileId = data.errorTextImageFileId; handler.errorMessage = data.errorMessage; } super.applyState(data, handler); } ; } //# sourceMappingURL=BarcodeHandlerData.js.map