UNPKG

@pilotlab/lux-attributes

Version:

A luxurious user experience framework, developed by your friends at Pilot.

133 lines 6.18 kB
"use strict"; 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_nodes_1 = require("@pilotlab/lux-nodes"); var attributeEnums_1 = require("./attributeEnums"); var AttributeChangeOptions = (function (_super) { __extends(AttributeChangeOptions, _super); function AttributeChangeOptions(action, durationSpeed, ease, changeInitiationType, configuration, isInitialize) { if (action === void 0) { action = attributeEnums_1.AttributeChangeActions.SIGNAL_CHANGE; } if (isInitialize === void 0) { isInitialize = true; } var _this = _super.call(this, null, null, null, null, null, false) || this; _this._action = attributeEnums_1.AttributeChangeActions.SIGNAL_CHANGE; if (isInitialize) _this.initialize(action, durationSpeed, ease, changeInitiationType, configuration); return _this; } AttributeChangeOptions.prototype.p_onInitializeStarted = function (result, args) { var action = args[0]; var durationSpeed = args[1]; var ease = args[2]; var changeInitiationType = args[3]; var configuration = args[4]; this._action = action; this.changeInitiationType = lux_is_1.default.notEmpty(changeInitiationType) ? changeInitiationType : lux_nodes_1.NodeChangeInitiationType.NONE; if (lux_is_1.default.notEmpty(durationSpeed)) this.durationSpeed = durationSpeed; if (lux_is_1.default.notEmpty(ease)) this.ease = ease; if (lux_is_1.default.notEmpty(configuration)) this.configuration = configuration; return result.resolve(); }; Object.defineProperty(AttributeChangeOptions, "default", { get: function () { return new AttributeChangeOptions(); }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions, "noSaveOrSignal", { get: function () { return new AttributeChangeOptions(attributeEnums_1.AttributeChangeActions.NONE); }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions, "signal", { get: function () { return new AttributeChangeOptions(attributeEnums_1.AttributeChangeActions.SIGNAL_CHANGE); }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions, "save", { get: function () { return new AttributeChangeOptions(attributeEnums_1.AttributeChangeActions.SAVE); }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions, "zero", { get: function () { return new AttributeChangeOptions(attributeEnums_1.AttributeChangeActions.NONE).durationZero; }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions.prototype, "action", { get: function () { return this._action; }, enumerable: true, configurable: true }); AttributeChangeOptions.prototype.setAction = function (value) { this._action = value; return this; }; AttributeChangeOptions.prototype.setDuration = function (value) { this.p_durationSpeed = value; return this; }; Object.defineProperty(AttributeChangeOptions.prototype, "durationZero", { get: function () { return this.copy.setDuration(0); }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions.prototype, "durationDefault", { get: function () { return this.copy.setDuration(null); }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions.prototype, "noSaveOrSignal", { get: function () { return this.copy.setAction(attributeEnums_1.AttributeChangeActions.NONE); }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions.prototype, "signal", { get: function () { return this.copy.setAction(attributeEnums_1.AttributeChangeActions.SIGNAL_CHANGE); }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions.prototype, "save", { get: function () { return this.copy.setAction(attributeEnums_1.AttributeChangeActions.SAVE); }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions.prototype, "isSignalChange", { get: function () { return this.action === attributeEnums_1.AttributeChangeActions.SIGNAL_CHANGE; }, enumerable: true, configurable: true }); Object.defineProperty(AttributeChangeOptions.prototype, "isSave", { get: function () { return this.action === attributeEnums_1.AttributeChangeActions.SAVE; }, enumerable: true, configurable: true }); AttributeChangeOptions.prototype.setChangeInitiationType = function (value) { this.changeInitiationType = value; return this; }; Object.defineProperty(AttributeChangeOptions.prototype, "copy", { get: function () { var changeOptionsCopy = new AttributeChangeOptions(this.action, this.durationSpeed, this.ease, this.changeInitiationType, this.configuration); changeOptionsCopy.repeatCount = this.repeatCount; return changeOptionsCopy; }, enumerable: true, configurable: true }); return AttributeChangeOptions; }(lux_nodes_1.NodeChangeOptions)); exports.AttributeChangeOptions = AttributeChangeOptions; exports.default = AttributeChangeOptions; //# sourceMappingURL=attributeChangeOptions.js.map