@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.
44 lines • 1.49 kB
JavaScript
import { ModelComponent } from "./ModelComponent";
import { equals } from "../Utils/Utils";
export class InteractiveZone extends ModelComponent {
get styleKey() {
return this._styleKey;
}
set styleKey(value) {
if (equals(this._styleKey, value))
return;
this._styleKey = value;
this._propertyChanged.notify(this, "styleKey");
}
get snappingEnabled() {
return this._snappingEnabled;
}
set snappingEnabled(value) {
if (this._snappingEnabled === value)
return;
this._snappingEnabled = value;
this._propertyChanged.notify(this, "snappingEnabled");
}
get path() {
return this._path;
}
set path(value) {
if (equals(this._path, value))
return;
this._path = value;
this._propertyChanged.notify(this, "path");
}
clone(generateNewIds = false) {
const interactiveZone = new InteractiveZone();
this._copy(this, interactiveZone, generateNewIds);
return interactiveZone;
}
_copy(source, destination, generateNewIds) {
var _a;
super._copy(source, destination, generateNewIds);
destination.snappingEnabled = source.snappingEnabled;
destination.path = (_a = source.path) === null || _a === void 0 ? void 0 : _a.clone();
destination.styleKey = source.styleKey;
}
}
//# sourceMappingURL=InteractiveZone.js.map