@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.
22 lines • 919 B
JavaScript
import { MaxArtworkSizeConstraints } from "./MaxArtworkSizeConstraints";
export class ContainerConstraints {
constructor() {
this.maxArtworkSize = new MaxArtworkSizeConstraints();
}
_copy(source, destination) {
destination.maxArtworkSize = source.maxArtworkSize != null ? source.maxArtworkSize.clone() : new MaxArtworkSizeConstraints();
}
clone() {
const constraints = new ContainerConstraints();
this._copy(this, constraints);
return constraints;
}
toJSON() {
const isMaxArtworkSizeEmpty = this.maxArtworkSize == null ||
(this.maxArtworkSize.width == null && this.maxArtworkSize.height == null && this.maxArtworkSize.shapeType == null);
return {
maxArtworkSize: isMaxArtworkSizeEmpty ? null : this.maxArtworkSize.toJSON()
};
}
}
//# sourceMappingURL=ContainerConstraints.js.map