eligius 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/controllers/label-controller.d.ts +3 -0
- package/dist/eligius-engine.d.ts +15 -4
- package/dist/eligius.cjs.development.js +202 -144
- package/dist/eligius.cjs.development.js.map +1 -1
- package/dist/eligius.cjs.production.min.js +1 -1
- package/dist/eligius.cjs.production.min.js.map +1 -1
- package/dist/eligius.esm.js +201 -145
- package/dist/eligius.esm.js.map +1 -1
- package/dist/operation/calc.d.ts +1 -1
- package/dist/operation/create-element.d.ts +0 -1
- package/dist/operation/get-controller-instance.d.ts +1 -3
- package/dist/operation/get-query-params.d.ts +28 -0
- package/dist/operation/index.d.ts +2 -0
- package/dist/operation/invoke-object-method.d.ts +15 -0
- package/dist/operation/load-json.d.ts +2 -3
- package/dist/operation/math.d.ts +1 -1
- package/dist/operation/metadata/get-query-params.d.ts +4 -0
- package/dist/operation/metadata/index.d.ts +2 -0
- package/dist/operation/metadata/invoke-object-method.d.ts +4 -0
- package/dist/operation/metadata/types.d.ts +1 -1
- package/dist/operation/remove-properties-from-operation-data.d.ts +1 -0
- package/dist/operation/select-element.d.ts +2 -3
- package/dist/operation/set-style.d.ts +4 -4
- package/dist/operation/start-loop.d.ts +2 -3
- package/dist/types.d.ts +42 -3
- package/package.json +2 -2
|
@@ -436,7 +436,7 @@ function prepareValueForSerialization(value) {
|
|
|
436
436
|
return value.map(prepareValueForSerialization);
|
|
437
437
|
} else if (value instanceof $__default["default"]) {
|
|
438
438
|
return 'jQuery object';
|
|
439
|
-
} else if (typeof value === 'object') {
|
|
439
|
+
} else if (value !== null && typeof value === 'object') {
|
|
440
440
|
return Object.fromEntries(Object.entries(value).map(function (_ref) {
|
|
441
441
|
var propName = _ref[0],
|
|
442
442
|
propValue = _ref[1];
|
|
@@ -1252,6 +1252,7 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1252
1252
|
this.operationData = null;
|
|
1253
1253
|
this.labelData = {};
|
|
1254
1254
|
this.name = 'LabelController';
|
|
1255
|
+
this.requestLabelDataBound = void 0;
|
|
1255
1256
|
}
|
|
1256
1257
|
|
|
1257
1258
|
var _proto = LabelController.prototype;
|
|
@@ -1260,6 +1261,13 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1260
1261
|
this.operationData = Object.assign({}, operationData);
|
|
1261
1262
|
};
|
|
1262
1263
|
|
|
1264
|
+
_proto.setLabelId = function setLabelId(newLabelId) {
|
|
1265
|
+
if (this.requestLabelDataBound) {
|
|
1266
|
+
this.requestLabelDataBound(newLabelId);
|
|
1267
|
+
this.setLabel();
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1263
1271
|
_proto.attach = function attach(eventbus) {
|
|
1264
1272
|
var _this = this;
|
|
1265
1273
|
|
|
@@ -1270,13 +1278,20 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1270
1278
|
eventbus.broadcast(TimelineEventNames.REQUEST_CURRENT_LANGUAGE, [function (language) {
|
|
1271
1279
|
_this.currentLanguage = language;
|
|
1272
1280
|
}]);
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
}]);
|
|
1281
|
+
this.requestLabelDataBound = this.requestLabelData.bind(this, eventbus);
|
|
1282
|
+
this.requestLabelDataBound(this.operationData.labelId);
|
|
1276
1283
|
this.setLabel();
|
|
1277
1284
|
this.listeners.push(eventbus.on(TimelineEventNames.LANGUAGE_CHANGE, this.handleLanguageChange.bind(this)));
|
|
1278
1285
|
};
|
|
1279
1286
|
|
|
1287
|
+
_proto.requestLabelData = function requestLabelData(eventbus, labelId) {
|
|
1288
|
+
var _this2 = this;
|
|
1289
|
+
|
|
1290
|
+
eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTION, [labelId, function (labelCollection) {
|
|
1291
|
+
_this2.createTextDataLookup(labelCollection);
|
|
1292
|
+
}]);
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1280
1295
|
_proto.setLabel = function setLabel() {
|
|
1281
1296
|
if (this.currentLanguage) {
|
|
1282
1297
|
var _this$operationData;
|
|
@@ -1287,8 +1302,9 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1287
1302
|
|
|
1288
1303
|
_proto.detach = function detach(_eventbus) {
|
|
1289
1304
|
this.listeners.forEach(function (func) {
|
|
1290
|
-
func();
|
|
1305
|
+
return func();
|
|
1291
1306
|
});
|
|
1307
|
+
this.requestLabelDataBound = undefined;
|
|
1292
1308
|
};
|
|
1293
1309
|
|
|
1294
1310
|
_proto.handleLanguageChange = function handleLanguageChange(code) {
|
|
@@ -1297,10 +1313,10 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1297
1313
|
};
|
|
1298
1314
|
|
|
1299
1315
|
_proto.createTextDataLookup = function createTextDataLookup(data) {
|
|
1300
|
-
var
|
|
1316
|
+
var _this3 = this;
|
|
1301
1317
|
|
|
1302
1318
|
data.forEach(function (d) {
|
|
1303
|
-
|
|
1319
|
+
_this3.labelData[d.languageCode] = d.label;
|
|
1304
1320
|
});
|
|
1305
1321
|
};
|
|
1306
1322
|
|
|
@@ -2054,9 +2070,8 @@ var ctrls = {
|
|
|
2054
2070
|
};
|
|
2055
2071
|
|
|
2056
2072
|
/**
|
|
2057
|
-
*
|
|
2058
|
-
* the given timeline provider and triggering the actions associated with
|
|
2059
|
-
* ...
|
|
2073
|
+
* This is where the magic happens. The engine is responsible for starting and stopping
|
|
2074
|
+
* the given timeline provider and triggering the actions associated with the positions along the timeline.
|
|
2060
2075
|
*/
|
|
2061
2076
|
|
|
2062
2077
|
var EligiusEngine = /*#__PURE__*/function () {
|
|
@@ -2075,6 +2090,11 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2075
2090
|
this.timelineProviders = timelineProviders;
|
|
2076
2091
|
this.languageManager = languageManager;
|
|
2077
2092
|
}
|
|
2093
|
+
/**
|
|
2094
|
+
* Initializes the engine by creating the HTML layout and the first time line
|
|
2095
|
+
* by executing its initActions.
|
|
2096
|
+
*/
|
|
2097
|
+
|
|
2078
2098
|
|
|
2079
2099
|
var _proto = EligiusEngine.prototype;
|
|
2080
2100
|
|
|
@@ -2194,9 +2214,20 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2194
2214
|
}
|
|
2195
2215
|
|
|
2196
2216
|
return _cleanUp;
|
|
2197
|
-
}()
|
|
2198
|
-
|
|
2199
|
-
|
|
2217
|
+
}()
|
|
2218
|
+
/**
|
|
2219
|
+
* Cleans up all the necessary parts that the engine initialized.
|
|
2220
|
+
* - It ends the currently active operations and the init actions.
|
|
2221
|
+
* - It removes all its eventbus listeners, handlers and interceptors.
|
|
2222
|
+
* - It destroys all of its timeline providers
|
|
2223
|
+
* - It empties the HTML element indicated by the containerSelector configuration property.
|
|
2224
|
+
*
|
|
2225
|
+
*/
|
|
2226
|
+
;
|
|
2227
|
+
|
|
2228
|
+
_proto.destroy =
|
|
2229
|
+
/*#__PURE__*/
|
|
2230
|
+
function () {
|
|
2200
2231
|
var _destroy = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
2201
2232
|
var containerSelector, container;
|
|
2202
2233
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
@@ -2297,13 +2328,11 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2297
2328
|
}
|
|
2298
2329
|
|
|
2299
2330
|
if (isFinite(end)) {
|
|
2300
|
-
var _timeLineAction$id2;
|
|
2301
|
-
|
|
2302
2331
|
var timelineEndPositions = this._initializeTimelinePosition(this._timeLineActionsLookup[uri], end);
|
|
2303
2332
|
|
|
2304
2333
|
var endMethod = timeLineAction.end.bind(timeLineAction);
|
|
2305
2334
|
|
|
2306
|
-
if (
|
|
2335
|
+
if (!timeLineAction.id) {
|
|
2307
2336
|
endMethod.id = timeLineAction.id;
|
|
2308
2337
|
}
|
|
2309
2338
|
|
|
@@ -3393,10 +3422,8 @@ var calc$1 = function calc(operationData) {
|
|
|
3393
3422
|
var _operationData = operationData,
|
|
3394
3423
|
left = _operationData.left,
|
|
3395
3424
|
right = _operationData.right,
|
|
3396
|
-
operator = _operationData.operator
|
|
3397
|
-
|
|
3398
|
-
propertyName = _operationData$proper === void 0 ? 'calculationResult' : _operationData$proper;
|
|
3399
|
-
operationData[propertyName] = calcFunctions[operator](+left, +right);
|
|
3425
|
+
operator = _operationData.operator;
|
|
3426
|
+
operationData.calculationResult = calcFunctions[operator](+left, +right);
|
|
3400
3427
|
return operationData;
|
|
3401
3428
|
};
|
|
3402
3429
|
|
|
@@ -3441,17 +3468,14 @@ var createElement$1 = function createElement(operationData) {
|
|
|
3441
3468
|
var _operationData = operationData,
|
|
3442
3469
|
elementName = _operationData.elementName,
|
|
3443
3470
|
attributes = _operationData.attributes,
|
|
3444
|
-
text = _operationData.text
|
|
3445
|
-
_operationData$proper = _operationData.propertyName,
|
|
3446
|
-
propertyName = _operationData$proper === void 0 ? 'template' : _operationData$proper;
|
|
3471
|
+
text = _operationData.text;
|
|
3447
3472
|
var serializedAttrs = attributes ? ' ' + Object.entries(attributes).map(function (_ref) {
|
|
3448
3473
|
var key = _ref[0],
|
|
3449
3474
|
value = _ref[1];
|
|
3450
3475
|
return key + "=\"" + value + "\"";
|
|
3451
3476
|
}).join(' ') : '';
|
|
3452
3477
|
var template = text ? $__default["default"]("<" + elementName + serializedAttrs + ">" + text + "</" + elementName + ">") : $__default["default"]("<" + elementName + serializedAttrs + "/>");
|
|
3453
|
-
operationData
|
|
3454
|
-
delete operationData.propertyName;
|
|
3478
|
+
operationData.template = template;
|
|
3455
3479
|
return operationData;
|
|
3456
3480
|
};
|
|
3457
3481
|
|
|
@@ -3565,25 +3589,21 @@ var getControllerFromElement$1 = function getControllerFromElement(operationData
|
|
|
3565
3589
|
|
|
3566
3590
|
/**
|
|
3567
3591
|
* This operation retrieves an instance of the given controller name.
|
|
3568
|
-
* It assigns this instance to the property on the current operation data
|
|
3569
|
-
* defined by the propertyName property which defaults to 'controllerInstance'.
|
|
3592
|
+
* It assigns this instance to the `controllerInstance` property on the current operation data
|
|
3570
3593
|
*
|
|
3571
3594
|
* @param operationData
|
|
3572
3595
|
* @returns
|
|
3573
3596
|
*/
|
|
3574
3597
|
|
|
3575
3598
|
var getControllerInstance$1 = function getControllerInstance(operationData) {
|
|
3576
|
-
var systemName = operationData.systemName
|
|
3577
|
-
|
|
3578
|
-
propertyName = _operationData$proper === void 0 ? 'controllerInstance' : _operationData$proper;
|
|
3579
|
-
operationData[propertyName] = null;
|
|
3599
|
+
var systemName = operationData.systemName;
|
|
3600
|
+
operationData.controllerInstance = undefined;
|
|
3580
3601
|
|
|
3581
3602
|
var resultCallback = function resultCallback(instance) {
|
|
3582
|
-
operationData
|
|
3603
|
+
operationData.controllerInstance = instance;
|
|
3583
3604
|
};
|
|
3584
3605
|
|
|
3585
3606
|
this.eventbus.broadcast(TimelineEventNames.REQUEST_INSTANCE, [systemName, resultCallback]);
|
|
3586
|
-
delete operationData.propertyName;
|
|
3587
3607
|
return operationData;
|
|
3588
3608
|
};
|
|
3589
3609
|
|
|
@@ -3823,13 +3843,58 @@ var getImport$1 = function getImport(operationData) {
|
|
|
3823
3843
|
return operationData;
|
|
3824
3844
|
};
|
|
3825
3845
|
|
|
3846
|
+
/**
|
|
3847
|
+
* This operation retrieves the current query parameters from the browser's address bar and places
|
|
3848
|
+
* them on the returned operation data.
|
|
3849
|
+
*
|
|
3850
|
+
* @param operationData
|
|
3851
|
+
* @returns
|
|
3852
|
+
*/
|
|
3853
|
+
var getQueryParams$1 = function getQueryParams(operationData) {
|
|
3854
|
+
var searchParams = new URLSearchParams(window.location.search);
|
|
3855
|
+
var queryParams = Object.fromEntries(searchParams.entries());
|
|
3856
|
+
var defaultValues = operationData.defaultValues;
|
|
3857
|
+
|
|
3858
|
+
if (defaultValues) {
|
|
3859
|
+
var defaultEntries = Object.entries(defaultValues).filter(function (_ref) {
|
|
3860
|
+
var name = _ref[0];
|
|
3861
|
+
return !(name in queryParams);
|
|
3862
|
+
});
|
|
3863
|
+
defaultEntries.forEach(function (_ref2) {
|
|
3864
|
+
var name = _ref2[0],
|
|
3865
|
+
value = _ref2[1];
|
|
3866
|
+
return queryParams[name] = value;
|
|
3867
|
+
});
|
|
3868
|
+
delete operationData.defaultValues;
|
|
3869
|
+
}
|
|
3870
|
+
|
|
3871
|
+
operationData.queryParams = queryParams;
|
|
3872
|
+
return operationData;
|
|
3873
|
+
};
|
|
3874
|
+
|
|
3875
|
+
/**
|
|
3876
|
+
* This operation invokes the specified method on the given object with the optional specified arguments
|
|
3877
|
+
* and assigns the result to the `methodResult` property.
|
|
3878
|
+
*
|
|
3879
|
+
* @param operationData
|
|
3880
|
+
* @returns
|
|
3881
|
+
*/
|
|
3882
|
+
var invokeObjectMethod$1 = function invokeObjectMethod(operationData) {
|
|
3883
|
+
var methodName = operationData.methodName,
|
|
3884
|
+
methodArguments = operationData.methodArguments;
|
|
3885
|
+
delete operationData.methodName;
|
|
3886
|
+
delete operationData.methodArguments;
|
|
3887
|
+
operationData.methodResult = operationData.instance[methodName].apply(operationData.instance, methodArguments != null ? methodArguments : []);
|
|
3888
|
+
return operationData;
|
|
3889
|
+
};
|
|
3890
|
+
|
|
3826
3891
|
var jsonCache = {};
|
|
3827
3892
|
var addToCache = function addToCache(key, value) {
|
|
3828
3893
|
jsonCache[key] = value;
|
|
3829
3894
|
};
|
|
3830
3895
|
/**
|
|
3831
|
-
* This operation loads a JSON file from the specified url and assigns it to the
|
|
3832
|
-
* property
|
|
3896
|
+
* This operation loads a JSON file from the specified url and assigns it to the json
|
|
3897
|
+
* property on the current operation data.
|
|
3833
3898
|
*
|
|
3834
3899
|
* If the cache property is set to true and a cached value already exists, this is assigned
|
|
3835
3900
|
* instead of re-retrieving it from the url.
|
|
@@ -3840,47 +3905,41 @@ var addToCache = function addToCache(key, value) {
|
|
|
3840
3905
|
|
|
3841
3906
|
var loadJSON$1 = function loadJSON(operationData) {
|
|
3842
3907
|
var url = operationData.url,
|
|
3843
|
-
cache = operationData.cache
|
|
3844
|
-
_operationData$proper = operationData.propertyName,
|
|
3845
|
-
propertyName = _operationData$proper === void 0 ? 'json' : _operationData$proper;
|
|
3908
|
+
cache = operationData.cache;
|
|
3846
3909
|
|
|
3847
3910
|
if (cache && jsonCache[url]) {
|
|
3848
|
-
operationData
|
|
3849
|
-
delete operationData.propertyName;
|
|
3911
|
+
operationData.json = jsonCache[url];
|
|
3850
3912
|
return operationData;
|
|
3851
3913
|
}
|
|
3852
3914
|
|
|
3853
|
-
return
|
|
3854
|
-
|
|
3855
|
-
var
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
return response.json();
|
|
3915
|
+
return fetch(url).then( /*#__PURE__*/function () {
|
|
3916
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(response) {
|
|
3917
|
+
var json, cacheValue;
|
|
3918
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3919
|
+
while (1) {
|
|
3920
|
+
switch (_context.prev = _context.next) {
|
|
3921
|
+
case 0:
|
|
3922
|
+
_context.next = 2;
|
|
3923
|
+
return response.json();
|
|
3863
3924
|
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
resolve(operationData);
|
|
3925
|
+
case 2:
|
|
3926
|
+
json = _context.sent;
|
|
3927
|
+
cacheValue = operationData.json = json;
|
|
3928
|
+
addToCache(url, cacheValue);
|
|
3929
|
+
return _context.abrupt("return", operationData);
|
|
3870
3930
|
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
}
|
|
3931
|
+
case 6:
|
|
3932
|
+
case "end":
|
|
3933
|
+
return _context.stop();
|
|
3875
3934
|
}
|
|
3876
|
-
}
|
|
3877
|
-
})
|
|
3935
|
+
}
|
|
3936
|
+
}, _callee);
|
|
3937
|
+
}));
|
|
3878
3938
|
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
});
|
|
3939
|
+
return function (_x) {
|
|
3940
|
+
return _ref.apply(this, arguments);
|
|
3941
|
+
};
|
|
3942
|
+
}());
|
|
3884
3943
|
};
|
|
3885
3944
|
|
|
3886
3945
|
/**
|
|
@@ -3912,10 +3971,8 @@ var math$1 = function math(operationData) {
|
|
|
3912
3971
|
operationData.args = resolveMathConstants(operationData.args);
|
|
3913
3972
|
var _operationData = operationData,
|
|
3914
3973
|
args = _operationData.args,
|
|
3915
|
-
functionName = _operationData.functionName
|
|
3916
|
-
|
|
3917
|
-
propertyName = _operationData$proper === void 0 ? 'mathResult' : _operationData$proper;
|
|
3918
|
-
operationData[propertyName] = Math[functionName].apply(null, args);
|
|
3974
|
+
functionName = _operationData.functionName;
|
|
3975
|
+
operationData.mathResult = Math[functionName].apply(null, args);
|
|
3919
3976
|
return operationData;
|
|
3920
3977
|
};
|
|
3921
3978
|
|
|
@@ -3984,17 +4041,22 @@ var removeElement$1 = function removeElement(operationData) {
|
|
|
3984
4041
|
|
|
3985
4042
|
/**
|
|
3986
4043
|
* This operation removes the given list of properties from the current operation data.
|
|
4044
|
+
* It will also omit the property 'propertyNames' from the result.
|
|
3987
4045
|
*
|
|
3988
4046
|
* @param operationData
|
|
3989
4047
|
* @returns
|
|
3990
4048
|
*/
|
|
3991
4049
|
var removePropertiesFromOperationData$1 = function removePropertiesFromOperationData(operationData) {
|
|
3992
4050
|
var propertyNames = operationData.propertyNames;
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
4051
|
+
|
|
4052
|
+
if (propertyNames.indexOf('propertyNames') < 0) {
|
|
4053
|
+
propertyNames.push('propertyNames');
|
|
4054
|
+
}
|
|
4055
|
+
|
|
4056
|
+
return Object.fromEntries(Object.entries(operationData).filter(function (_ref) {
|
|
4057
|
+
var name = _ref[0];
|
|
4058
|
+
return !propertyNames.includes(name);
|
|
4059
|
+
}));
|
|
3998
4060
|
};
|
|
3999
4061
|
|
|
4000
4062
|
/**
|
|
@@ -4050,25 +4112,21 @@ var resizeAction$1 = function resizeAction(operationData) {
|
|
|
4050
4112
|
return operationData;
|
|
4051
4113
|
};
|
|
4052
4114
|
|
|
4053
|
-
function findElementBySelector(root, selector
|
|
4115
|
+
function findElementBySelector(root, selector) {
|
|
4054
4116
|
var element = root.find(selector);
|
|
4055
4117
|
|
|
4056
4118
|
if (!element.length) {
|
|
4057
4119
|
console.warn("selector '" + selector + "' wasn't found!");
|
|
4058
4120
|
}
|
|
4059
4121
|
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
if (operationData.hasOwnProperty('propertyName')) {
|
|
4063
|
-
delete operationData.propertyName;
|
|
4064
|
-
}
|
|
4122
|
+
return element;
|
|
4065
4123
|
}
|
|
4066
4124
|
/**
|
|
4067
4125
|
* This operation selects one or more elements using the specified selector.
|
|
4068
4126
|
*
|
|
4069
4127
|
* If useSelectedElementAsRoot is set to true and a valid DOM element is assigned
|
|
4070
|
-
* to the current operation data
|
|
4071
|
-
* then the element will be looked for only in the
|
|
4128
|
+
* to the current operation data's `selectedElement` property
|
|
4129
|
+
* then the element will be looked for only in the descendant elements of this DOM element.
|
|
4072
4130
|
*
|
|
4073
4131
|
* @param operationData
|
|
4074
4132
|
* @returns
|
|
@@ -4077,23 +4135,21 @@ function findElementBySelector(root, selector, operationData, propertyName) {
|
|
|
4077
4135
|
|
|
4078
4136
|
var selectElement$1 = function selectElement(operationData) {
|
|
4079
4137
|
var selector = operationData.selector,
|
|
4080
|
-
_operationData$proper = operationData.propertyName,
|
|
4081
|
-
propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper,
|
|
4082
4138
|
_operationData$useSel = operationData.useSelectedElementAsRoot,
|
|
4083
4139
|
useSelectedElementAsRoot = _operationData$useSel === void 0 ? false : _operationData$useSel;
|
|
4084
4140
|
|
|
4085
4141
|
if (!selector) {
|
|
4086
|
-
throw new Error('selector is
|
|
4142
|
+
throw new Error('selectElement: selector is either empty or not defined.');
|
|
4087
4143
|
}
|
|
4088
4144
|
|
|
4089
|
-
if (useSelectedElementAsRoot && operationData
|
|
4090
|
-
var currentRoot = operationData
|
|
4091
|
-
findElementBySelector(currentRoot, selector
|
|
4145
|
+
if (useSelectedElementAsRoot && operationData.selectedElement) {
|
|
4146
|
+
var currentRoot = operationData.selectedElement;
|
|
4147
|
+
operationData.selectedElement = findElementBySelector(currentRoot, selector);
|
|
4092
4148
|
return operationData;
|
|
4093
4149
|
}
|
|
4094
4150
|
|
|
4095
4151
|
var rootCallback = function rootCallback(root) {
|
|
4096
|
-
findElementBySelector(root, selector
|
|
4152
|
+
operationData.selectedElement = findElementBySelector(root, selector);
|
|
4097
4153
|
};
|
|
4098
4154
|
|
|
4099
4155
|
this.eventbus.broadcast(TimelineEventNames.REQUEST_ENGINE_ROOT, [rootCallback]);
|
|
@@ -4182,19 +4238,15 @@ var setOperationData$1 = function setOperationData(operationData) {
|
|
|
4182
4238
|
/**
|
|
4183
4239
|
* This operation assigns the specified CSS style properties to the
|
|
4184
4240
|
* specified selected element. The selected element is assigned to
|
|
4185
|
-
* the
|
|
4186
|
-
* to 'selectedElement'.
|
|
4241
|
+
* the `selectedElement` property.
|
|
4187
4242
|
*
|
|
4188
4243
|
* @param operationData
|
|
4189
4244
|
* @returns
|
|
4190
4245
|
*/
|
|
4191
4246
|
|
|
4192
4247
|
var setStyle$1 = function setStyle(operationData) {
|
|
4193
|
-
var _operationData$proper = operationData.propertyName,
|
|
4194
|
-
propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper;
|
|
4195
4248
|
var properties = resolvePropertyValues(operationData, operationData.properties);
|
|
4196
|
-
operationData
|
|
4197
|
-
delete operationData.propertyName;
|
|
4249
|
+
operationData.selectedElement.css(properties);
|
|
4198
4250
|
return operationData;
|
|
4199
4251
|
};
|
|
4200
4252
|
|
|
@@ -4229,19 +4281,16 @@ var startAction$1 = function startAction(operationData) {
|
|
|
4229
4281
|
* This operation starts a loop using the given collection.
|
|
4230
4282
|
*
|
|
4231
4283
|
* Each iteration the current item from the specified collection is
|
|
4232
|
-
* assigned to the property on the current operation data
|
|
4233
|
-
* by the propertyName property which defaults to 'currentItem'.
|
|
4284
|
+
* assigned to the `currentItem` property on the current operation data.
|
|
4234
4285
|
*
|
|
4235
4286
|
* @param operationData
|
|
4236
4287
|
* @returns
|
|
4237
4288
|
*/
|
|
4238
4289
|
var startLoop$1 = function startLoop(operationData) {
|
|
4239
4290
|
var context = this;
|
|
4240
|
-
var collection = operationData.collection
|
|
4241
|
-
_operationData$proper = operationData.propertyName,
|
|
4242
|
-
propertyName = _operationData$proper === void 0 ? 'currentItem' : _operationData$proper;
|
|
4291
|
+
var collection = operationData.collection;
|
|
4243
4292
|
|
|
4244
|
-
if (
|
|
4293
|
+
if (collection !== null && !Array.isArray(collection)) {
|
|
4245
4294
|
throw new Error('Expected collection to be array type, string value was probably not resolved correctly');
|
|
4246
4295
|
}
|
|
4247
4296
|
|
|
@@ -4256,10 +4305,9 @@ var startLoop$1 = function startLoop(operationData) {
|
|
|
4256
4305
|
}
|
|
4257
4306
|
|
|
4258
4307
|
if (collection != null && collection.length && context.loopIndex !== undefined) {
|
|
4259
|
-
operationData
|
|
4308
|
+
operationData.currentItem = collection[context.loopIndex];
|
|
4260
4309
|
}
|
|
4261
4310
|
|
|
4262
|
-
delete operationData.propertyName;
|
|
4263
4311
|
return operationData;
|
|
4264
4312
|
};
|
|
4265
4313
|
|
|
@@ -4322,6 +4370,8 @@ var ops = {
|
|
|
4322
4370
|
getControllerInstance: getControllerInstance$1,
|
|
4323
4371
|
getElementDimensions: getElementDimensions$1,
|
|
4324
4372
|
getImport: getImport$1,
|
|
4373
|
+
getQueryParams: getQueryParams$1,
|
|
4374
|
+
invokeObjectMethod: invokeObjectMethod$1,
|
|
4325
4375
|
loadJSON: loadJSON$1,
|
|
4326
4376
|
log: log$1,
|
|
4327
4377
|
math: math$1,
|
|
@@ -4944,7 +4994,7 @@ function animate() {
|
|
|
4944
4994
|
required: true
|
|
4945
4995
|
},
|
|
4946
4996
|
animationDuration: {
|
|
4947
|
-
type: 'ParameterType:
|
|
4997
|
+
type: 'ParameterType:number',
|
|
4948
4998
|
required: true
|
|
4949
4999
|
}
|
|
4950
5000
|
}
|
|
@@ -4981,15 +5031,15 @@ function broadcastEvent() {
|
|
|
4981
5031
|
|
|
4982
5032
|
function calc() {
|
|
4983
5033
|
return {
|
|
4984
|
-
description: '
|
|
5034
|
+
description: 'Calculates the given left and right hand sides using the specified operator',
|
|
4985
5035
|
properties: {
|
|
4986
5036
|
left: {
|
|
4987
|
-
type: 'ParameterType:
|
|
5037
|
+
type: 'ParameterType:number',
|
|
4988
5038
|
description: 'The left operand',
|
|
4989
5039
|
required: true
|
|
4990
5040
|
},
|
|
4991
5041
|
right: {
|
|
4992
|
-
type: 'ParameterType:
|
|
5042
|
+
type: 'ParameterType:number',
|
|
4993
5043
|
description: 'The right operand',
|
|
4994
5044
|
required: true
|
|
4995
5045
|
},
|
|
@@ -5011,18 +5061,11 @@ function calc() {
|
|
|
5011
5061
|
}, {
|
|
5012
5062
|
value: '**',
|
|
5013
5063
|
description: 'Exponent: Raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times.'
|
|
5014
|
-
}]
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
}
|
|
5064
|
+
}]
|
|
5065
|
+
},
|
|
5066
|
+
outputProperties: {
|
|
5067
|
+
calculationResult: 'ParameterType:number'
|
|
5019
5068
|
}
|
|
5020
|
-
/*outputProperties: {
|
|
5021
|
-
propertyName: {
|
|
5022
|
-
type: 'ParameterType:integer',
|
|
5023
|
-
},
|
|
5024
|
-
},*/
|
|
5025
|
-
|
|
5026
5069
|
};
|
|
5027
5070
|
}
|
|
5028
5071
|
|
|
@@ -5120,10 +5163,6 @@ function getControllerInstance() {
|
|
|
5120
5163
|
systemName: {
|
|
5121
5164
|
type: 'ParameterType:controllerName',
|
|
5122
5165
|
required: true
|
|
5123
|
-
},
|
|
5124
|
-
propertyName: {
|
|
5125
|
-
type: 'ParameterType:string',
|
|
5126
|
-
defaultValue: 'controllerInstance'
|
|
5127
5166
|
}
|
|
5128
5167
|
},
|
|
5129
5168
|
outputProperties: {
|
|
@@ -5160,6 +5199,35 @@ function getImport() {
|
|
|
5160
5199
|
};
|
|
5161
5200
|
}
|
|
5162
5201
|
|
|
5202
|
+
function getQueryParams() {
|
|
5203
|
+
return {
|
|
5204
|
+
description: "Retrieves the current query parameters from the browser's address bar",
|
|
5205
|
+
outputProperties: {
|
|
5206
|
+
queryParams: 'ParameterType:object'
|
|
5207
|
+
}
|
|
5208
|
+
};
|
|
5209
|
+
}
|
|
5210
|
+
|
|
5211
|
+
function invokeObjectMethod() {
|
|
5212
|
+
return {
|
|
5213
|
+
description: 'Invokes the specified method on the given object with the optional specified arguments',
|
|
5214
|
+
properties: {
|
|
5215
|
+
instance: {
|
|
5216
|
+
type: 'ParameterType:object',
|
|
5217
|
+
required: true
|
|
5218
|
+
},
|
|
5219
|
+
methodName: {
|
|
5220
|
+
type: 'ParameterType:string',
|
|
5221
|
+
required: true
|
|
5222
|
+
},
|
|
5223
|
+
methodArguments: 'ParameterType:array'
|
|
5224
|
+
},
|
|
5225
|
+
outputProperties: {
|
|
5226
|
+
methodResult: 'ParameterType:object'
|
|
5227
|
+
}
|
|
5228
|
+
};
|
|
5229
|
+
}
|
|
5230
|
+
|
|
5163
5231
|
function loadJSON() {
|
|
5164
5232
|
return {
|
|
5165
5233
|
description: 'Load JSON from the given url',
|
|
@@ -5168,11 +5236,7 @@ function loadJSON() {
|
|
|
5168
5236
|
type: 'ParameterType:url',
|
|
5169
5237
|
required: true
|
|
5170
5238
|
},
|
|
5171
|
-
cache: 'ParameterType:boolean'
|
|
5172
|
-
propertyName: {
|
|
5173
|
-
type: 'ParameterType:string',
|
|
5174
|
-
defaultValue: 'json'
|
|
5175
|
-
}
|
|
5239
|
+
cache: 'ParameterType:boolean'
|
|
5176
5240
|
},
|
|
5177
5241
|
outputProperties: {
|
|
5178
5242
|
json: 'ParameterType:object'
|
|
@@ -5195,10 +5259,7 @@ function math() {
|
|
|
5195
5259
|
required: true
|
|
5196
5260
|
},
|
|
5197
5261
|
functionName: createMathFunctionNames(),
|
|
5198
|
-
|
|
5199
|
-
type: 'ParameterType:string',
|
|
5200
|
-
defaultValue: 'mathResult'
|
|
5201
|
-
}
|
|
5262
|
+
mathResult: 'ParameterType:number'
|
|
5202
5263
|
}
|
|
5203
5264
|
};
|
|
5204
5265
|
}
|
|
@@ -5301,11 +5362,10 @@ function selectElement() {
|
|
|
5301
5362
|
type: 'ParameterType:selector',
|
|
5302
5363
|
required: true
|
|
5303
5364
|
},
|
|
5304
|
-
propertyName: 'ParameterType:string',
|
|
5305
5365
|
useSelectedElementAsRoot: 'ParameterType:boolean'
|
|
5306
5366
|
},
|
|
5307
5367
|
outputProperties: {
|
|
5308
|
-
selectedElement: 'ParameterType:
|
|
5368
|
+
selectedElement: 'ParameterType:jQuery'
|
|
5309
5369
|
}
|
|
5310
5370
|
};
|
|
5311
5371
|
}
|
|
@@ -5368,10 +5428,7 @@ function setStyle() {
|
|
|
5368
5428
|
type: 'ParameterType:object',
|
|
5369
5429
|
required: true
|
|
5370
5430
|
},
|
|
5371
|
-
|
|
5372
|
-
type: 'ParameterType:string',
|
|
5373
|
-
required: false
|
|
5374
|
-
}
|
|
5431
|
+
selectedElement: 'ParameterType:jQuery'
|
|
5375
5432
|
}
|
|
5376
5433
|
};
|
|
5377
5434
|
}
|
|
@@ -5394,10 +5451,7 @@ function startLoop() {
|
|
|
5394
5451
|
type: 'ParameterType:array',
|
|
5395
5452
|
required: true
|
|
5396
5453
|
},
|
|
5397
|
-
|
|
5398
|
-
type: 'ParameterType:string',
|
|
5399
|
-
defaultValue: 'currentItem'
|
|
5400
|
-
}
|
|
5454
|
+
currentItem: 'ParameterType:object'
|
|
5401
5455
|
}
|
|
5402
5456
|
};
|
|
5403
5457
|
}
|
|
@@ -5427,7 +5481,7 @@ function wait() {
|
|
|
5427
5481
|
description: 'Waits the given amount of milliseconds before the action continues',
|
|
5428
5482
|
properties: {
|
|
5429
5483
|
milliseconds: {
|
|
5430
|
-
type: 'ParameterType:
|
|
5484
|
+
type: 'ParameterType:number',
|
|
5431
5485
|
required: true
|
|
5432
5486
|
}
|
|
5433
5487
|
}
|
|
@@ -5453,6 +5507,8 @@ var index = {
|
|
|
5453
5507
|
getControllerInstance: getControllerInstance,
|
|
5454
5508
|
getElementDimensions: getElementDimensions,
|
|
5455
5509
|
getImport: getImport,
|
|
5510
|
+
getQueryParams: getQueryParams,
|
|
5511
|
+
invokeObjectMethod: invokeObjectMethod,
|
|
5456
5512
|
loadJSON: loadJSON,
|
|
5457
5513
|
log: log,
|
|
5458
5514
|
math: math,
|
|
@@ -5517,6 +5573,8 @@ exports.getControllerFromElement = getControllerFromElement$1;
|
|
|
5517
5573
|
exports.getControllerInstance = getControllerInstance$1;
|
|
5518
5574
|
exports.getElementDimensions = getElementDimensions$1;
|
|
5519
5575
|
exports.getImport = getImport$1;
|
|
5576
|
+
exports.getQueryParams = getQueryParams$1;
|
|
5577
|
+
exports.invokeObjectMethod = invokeObjectMethod$1;
|
|
5520
5578
|
exports.loadJSON = loadJSON$1;
|
|
5521
5579
|
exports.log = log$1;
|
|
5522
5580
|
exports.math = math$1;
|