@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.
121 lines • 4.45 kB
JavaScript
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 __());
};
})();
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
import { ModelComponent } from "../ModelComponent";
import { equals, arrayEquals } from "../../Utils/Utils";
var InStringPlaceholder = /** @class */ (function (_super) {
__extends(InStringPlaceholder, _super);
function InStringPlaceholder(id, name, mask, value, values) {
var _this = _super.call(this) || this;
_this.id = id;
_this._name = name;
_this._mask = mask;
_this._value = value;
_this._values = values;
return _this;
}
Object.defineProperty(InStringPlaceholder.prototype, "mask", {
get: function () {
return this._mask;
},
set: function (value) {
if (value == this._mask)
return;
this._mask = value;
this._propertyChanged.notify(this, "mask");
},
enumerable: true,
configurable: true
});
Object.defineProperty(InStringPlaceholder.prototype, "value", {
get: function () {
return this._value;
},
set: function (value) {
if (value == this._value)
return;
this._value = value;
this._propertyChanged.notify(this, "value");
},
enumerable: true,
configurable: true
});
Object.defineProperty(InStringPlaceholder.prototype, "values", {
get: function () {
return this._values;
},
set: function (values) {
if (values == this._values)
return;
this._values = values;
this._propertyChanged.notify(this, "values");
},
enumerable: true,
configurable: true
});
InStringPlaceholder.prototype.generateNewIds = function () {
this._generateNewId();
};
InStringPlaceholder.prototype._copy = function (source, destination, generateNewIds) {
_super.prototype._copy.call(this, source, destination, false);
destination.mask = source.mask;
destination.value = source.value;
destination.values = __spread(source.values);
return destination;
};
InStringPlaceholder.prototype.clone = function (generateNewIds) {
if (generateNewIds === void 0) { generateNewIds = false; }
var placeholder = new InStringPlaceholder();
this._copy(this, placeholder, generateNewIds);
return placeholder;
};
InStringPlaceholder.prototype.equals = function (other) {
return _super.prototype.equals.call(this, other) &&
equals(this.mask, other.mask) &&
equals(this.value, other.value) &&
arrayEquals(this.values, other.values);
};
InStringPlaceholder.prototype.getSimplifiedObject = function () {
return {
id: this.id,
mask: this.mask,
value: this.value,
values: this.values,
name: this.name
};
};
return InStringPlaceholder;
}(ModelComponent));
export { InStringPlaceholder };
export default InStringPlaceholder;
//# sourceMappingURL=InStringPlaceholder.js.map