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.

50 lines 1.97 kB
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 { ModelComponent } from "../Product/ModelComponent"; import { Color } from "./Color"; var Swatch = /** @class */ (function (_super) { __extends(Swatch, _super); function Swatch() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(Swatch.prototype, "color", { get: function () { return this._color; }, set: function (value) { this._color = value; }, enumerable: true, configurable: true }); Swatch.prototype.clone = function (generateNewIds) { if (generateNewIds === void 0) { generateNewIds = false; } var result = new Swatch(); this._copy(this, result, generateNewIds); return result; }; Swatch.prototype.equals = function (other) { if (!_super.prototype.equals.call(this, other)) return false; return Color.equals(this.color, other.color); }; Swatch.prototype._copy = function (source, destination, generateNewIds) { var _a; _super.prototype._copy.call(this, source, destination, generateNewIds); destination.color = (_a = source.color) === null || _a === void 0 ? void 0 : _a.clone(); }; return Swatch; }(ModelComponent)); export { Swatch }; //# sourceMappingURL=Swatch.js.map