@pilotlab/lux-types
Version:
A luxurious user experience framework, developed by your friends at Pilot.
61 lines • 2.98 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var 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 function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var lux_is_1 = require("@pilotlab/lux-is");
var lux_attributes_1 = require("@pilotlab/lux-attributes");
var Size = (function (_super) {
__extends(Size, _super);
function Size(width, height, depth) {
var _this = _super.call(this, 'Size', null, lux_attributes_1.DataType.COLLECTION, null, true) || this;
_this.p_width = _this.children.set('width', lux_is_1.default.notEmpty(width) ? width : 0, lux_attributes_1.DataType.NUMBER_DOUBLE, lux_attributes_1.AttributeChangeOptions.zero).node;
_this.p_height = _this.children.set('height', lux_is_1.default.notEmpty(height) ? height : 0, lux_attributes_1.DataType.NUMBER_DOUBLE, lux_attributes_1.AttributeChangeOptions.zero).node;
_this.p_depth = _this.children.set('depth', lux_is_1.default.notEmpty(depth) ? depth : 0, lux_attributes_1.DataType.NUMBER_DOUBLE, lux_attributes_1.AttributeChangeOptions.zero).node;
return _this;
}
Object.defineProperty(Size.prototype, "copy", {
get: function () { return new Size(this.width, this.height, this.depth); },
enumerable: true,
configurable: true
});
Object.defineProperty(Size.prototype, "width", {
get: function () { return this.p_width.value; },
set: function (value) { this.p_width.set(value, lux_attributes_1.AttributeChangeOptions.saveAndSignal.durationZero); },
enumerable: true,
configurable: true
});
Object.defineProperty(Size.prototype, "height", {
get: function () { return this.p_height.value; },
set: function (value) { this.p_height.set(value, lux_attributes_1.AttributeChangeOptions.saveAndSignal.durationZero); },
enumerable: true,
configurable: true
});
Object.defineProperty(Size.prototype, "depth", {
get: function () { return this.p_depth.value; },
set: function (value) { this.p_depth.set(value, lux_attributes_1.AttributeChangeOptions.saveAndSignal.durationZero); },
enumerable: true,
configurable: true
});
Object.defineProperty(Size, "empty", {
get: function () {
var size = new Size();
size.width = null;
size.height = null;
return size;
},
enumerable: true,
configurable: true
});
return Size;
}(lux_attributes_1.Attribute));
exports.Size = Size;
exports.default = Size;
//# sourceMappingURL=size.js.map