@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
51 lines • 2.66 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { ShapeHandlerData } from "./ShapeHandlerData";
var BarcodeHandlerData = /** @class */ (function (_super) {
__extends(BarcodeHandlerData, _super);
function BarcodeHandlerData(handler) {
var _a, _b;
var _this = _super.call(this, handler) || this;
_this.__type = "BarcodeHandlerData";
if (handler == null || handler.canvas == null)
return _this;
if (handler.canvas.viewerConfiguration && handler.canvas.viewerConfiguration.stubImages && handler.canvas.viewerConfiguration.stubImages.barcode) {
var barcodeConf = handler.canvas.viewerConfiguration.stubImages.barcode;
_this.stubText = barcodeConf.text;
_this.errorText = barcodeConf.errorText;
_this.stubPostScriptName = barcodeConf.postScriptName;
}
var parentSurface = (handler.item.parentPlaceholder != null ?
handler.item.parentPlaceholder.parentContainer.parentComponent :
handler.item.parentContainer.parentComponent);
var 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);
return _this;
}
BarcodeHandlerData.prototype.applyState = function (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.prototype.applyState.call(this, data, handler);
};
;
return BarcodeHandlerData;
}(ShapeHandlerData));
export { BarcodeHandlerData };
//# sourceMappingURL=BarcodeHandlerData.js.map