@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.
61 lines • 2.31 kB
JavaScript
import { EventObject } from "../../EventObject";
export class ShapePermissions {
get allowChangeBorderWidth() {
return this._allowChangeBorderWidth;
}
set allowChangeBorderWidth(value) {
if (this._allowChangeBorderWidth === value)
return;
this._allowChangeBorderWidth = value;
this.propertyChanged.notify();
}
get allowChangeFillColor() {
return this._allowChangeFillColor;
}
set allowChangeFillColor(value) {
if (this._allowChangeFillColor === value)
return;
this._allowChangeFillColor = value;
this.propertyChanged.notify();
}
get allowChangeBorderColor() {
return this._allowChangeBorderColor;
}
set allowChangeBorderColor(value) {
if (this._allowChangeBorderColor === value)
return;
this._allowChangeBorderColor = value;
this.propertyChanged.notify();
}
constructor(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;
}
clone() {
const clone = new ShapePermissions();
clone.allowChangeBorderColor = this.allowChangeBorderColor;
clone.allowChangeBorderWidth = this.allowChangeBorderWidth;
clone.allowChangeFillColor = this.allowChangeFillColor;
return clone;
}
getSimplifiedObject() {
const result = {};
result["allowChangeBorderWidth"] = this.allowChangeBorderWidth;
result["allowChangeFillColor"] = this.allowChangeFillColor;
result["allowChangeBorderColor"] = this.allowChangeBorderColor;
return result;
}
equals(p) {
return this.allowChangeBorderColor === p.allowChangeBorderColor &&
this.allowChangeFillColor === p.allowChangeFillColor &&
this.allowChangeBorderWidth === p.allowChangeBorderWidth;
}
}
//# sourceMappingURL=ShapePermissions.js.map