UNPKG

@aurigma/design-atoms-model

Version:

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

75 lines 3 kB
import { EventObject } from "../../EventObject"; var ShapePermissions = /** @class */ (function () { function ShapePermissions(defaultValue) { this._allowChangeBorderWidth = true; this._allowChangeFillColor = true; this._allowChangeBorderColor = true; this.propertyChanged = new EventObject(); if (defaultValue == null) defaultValue = true; this.allowChangeBorderWidth = defaultValue; this.allowChangeFillColor = defaultValue; this.allowChangeBorderColor = defaultValue; } Object.defineProperty(ShapePermissions.prototype, "allowChangeBorderWidth", { get: function () { return this._allowChangeBorderWidth; }, set: function (value) { if (this._allowChangeBorderWidth === value) return; this._allowChangeBorderWidth = value; this.propertyChanged.notify(); }, enumerable: true, configurable: true }); Object.defineProperty(ShapePermissions.prototype, "allowChangeFillColor", { get: function () { return this._allowChangeFillColor; }, set: function (value) { if (this._allowChangeFillColor === value) return; this._allowChangeFillColor = value; this.propertyChanged.notify(); }, enumerable: true, configurable: true }); Object.defineProperty(ShapePermissions.prototype, "allowChangeBorderColor", { get: function () { return this._allowChangeBorderColor; }, set: function (value) { if (this._allowChangeBorderColor === value) return; this._allowChangeBorderColor = value; this.propertyChanged.notify(); }, enumerable: true, configurable: true }); ShapePermissions.prototype.clone = function () { var clone = new ShapePermissions(); clone.allowChangeBorderColor = this.allowChangeBorderColor; clone.allowChangeBorderWidth = this.allowChangeBorderWidth; clone.allowChangeFillColor = this.allowChangeFillColor; return clone; }; ShapePermissions.prototype.getSimplifiedObject = function () { var result = {}; result["allowChangeBorderWidth"] = this.allowChangeBorderWidth; result["allowChangeFillColor"] = this.allowChangeFillColor; result["allowChangeBorderColor"] = this.allowChangeBorderColor; return result; }; ShapePermissions.prototype.equals = function (p) { return this.allowChangeBorderColor === p.allowChangeBorderColor && this.allowChangeFillColor === p.allowChangeFillColor && this.allowChangeBorderWidth === p.allowChangeBorderWidth; }; return ShapePermissions; }()); export { ShapePermissions }; //# sourceMappingURL=ShapePermissions.js.map