eligius 1.0.10 → 1.0.12

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.
@@ -437,8 +437,9 @@ function prepareValueForSerialization(value) {
437
437
  } else if (value instanceof $__default["default"]) {
438
438
  return 'jQuery object';
439
439
  } else if (value !== null && typeof value === 'object') {
440
- if (value.constructor.toString().substring(0, 5) === 'class') {
441
- return 'Complex object';
440
+ if (value.constructor.toString().substring(0, 5) === 'class' || !value.constructor.toString().startsWith('function Object()')) {
441
+ var funcString = value.constructor.toString();
442
+ return funcString.substring(0, funcString.indexOf('{') + 1);
442
443
  }
443
444
 
444
445
  return Object.fromEntries(Object.entries(value).map(function (_ref) {
@@ -447,14 +448,15 @@ function prepareValueForSerialization(value) {
447
448
  return [propName, prepareValueForSerialization(propValue)];
448
449
  }));
449
450
  } else if (typeof value === 'function') {
450
- var funcString = value.toString();
451
- var paranIndex = funcString.indexOf('{');
451
+ var _funcString = value.toString();
452
+
453
+ var paranIndex = _funcString.indexOf('{');
452
454
 
453
455
  if (paranIndex > -1) {
454
- return funcString.substring(0, funcString.indexOf('{') + 1);
456
+ return _funcString.substring(0, _funcString.indexOf('{') + 1);
455
457
  }
456
458
 
457
- return funcString;
459
+ return _funcString;
458
460
  }
459
461
 
460
462
  return value;
@@ -3320,6 +3322,25 @@ function removeEventDataFromOperationData(operationData) {
3320
3322
  delete operationData.eventArgs;
3321
3323
  }
3322
3324
 
3325
+ var cache$1 = {};
3326
+
3327
+ function _getGlobals(cache, name) {
3328
+ var value = name ? cache[name] : cache;
3329
+ return value && value !== cache ? deepCopy(value) : value;
3330
+ }
3331
+
3332
+ function _setGlobals(cache, newValues) {
3333
+ Object.entries(newValues).forEach(function (_ref) {
3334
+ var name = _ref[0],
3335
+ value = _ref[1];
3336
+ return cache[name] = value;
3337
+ });
3338
+ console.log('cache', cache);
3339
+ }
3340
+
3341
+ var getGlobals = /*#__PURE__*/_getGlobals.bind(null, cache$1);
3342
+ var setGlobals = /*#__PURE__*/_setGlobals.bind(null, cache$1);
3343
+
3323
3344
  function extractOperationDataArgumentValues(sourceObject, argumentValue) {
3324
3345
  if (typeof argumentValue === 'string' && argumentValue.toLowerCase().startsWith('operationdata.')) {
3325
3346
  var propNames = argumentValue.split('.');
@@ -3327,6 +3348,14 @@ function extractOperationDataArgumentValues(sourceObject, argumentValue) {
3327
3348
  return getNestedValue(propNames, sourceObject);
3328
3349
  }
3329
3350
 
3351
+ if (typeof argumentValue === 'string' && argumentValue.toLowerCase().startsWith('globaldata.')) {
3352
+ var _propNames = argumentValue.split('.');
3353
+
3354
+ _propNames.shift();
3355
+
3356
+ return getNestedValue(_propNames, getGlobals());
3357
+ }
3358
+
3330
3359
  return argumentValue;
3331
3360
  }
3332
3361
 
@@ -4224,6 +4253,24 @@ var setElementContent$1 = function setElementContent(operationData) {
4224
4253
  return operationData;
4225
4254
  };
4226
4255
 
4256
+ /**
4257
+ * This operation copies the specified values from the operationData to the global data.
4258
+ *
4259
+ * @param operationData
4260
+ * @returns
4261
+ */
4262
+
4263
+ var setGlobalData$1 = function setGlobalData(operationData) {
4264
+ var properties = operationData.properties;
4265
+ var newGlobals = Object.fromEntries(Object.entries(operationData).filter(function (_ref) {
4266
+ var name = _ref[0];
4267
+ return properties.includes(name);
4268
+ }));
4269
+ setGlobals(newGlobals);
4270
+ delete operationData.properties;
4271
+ return operationData;
4272
+ };
4273
+
4227
4274
  /**
4228
4275
  * This operation assigns the specified properties to the current operation data.
4229
4276
  * When override is set to true the properties replace the current operation data entirely.
@@ -4400,6 +4447,7 @@ var ops = {
4400
4447
  selectElement: selectElement$1,
4401
4448
  setElementAttributes: setElementAttributes$1,
4402
4449
  setElementContent: setElementContent$1,
4450
+ setGlobalData: setGlobalData$1,
4403
4451
  setOperationData: setOperationData$1,
4404
4452
  setStyle: setStyle$1,
4405
4453
  startAction: startAction$1,
@@ -5418,6 +5466,18 @@ function setElementContent() {
5418
5466
  };
5419
5467
  }
5420
5468
 
5469
+ function setGlobalData() {
5470
+ return {
5471
+ description: 'Copies the specified values from the operationData to the global data',
5472
+ properties: {
5473
+ properties: {
5474
+ type: 'ParameterType:array',
5475
+ required: true
5476
+ }
5477
+ }
5478
+ };
5479
+ }
5480
+
5421
5481
  function setOperationData() {
5422
5482
  return {
5423
5483
  description: 'Sets the given properties on the current operation data',
@@ -5533,6 +5593,7 @@ var index = {
5533
5593
  selectElement: selectElement,
5534
5594
  setElementAttributes: setElementAttributes,
5535
5595
  setElementContent: setElementContent,
5596
+ setGlobalData: setGlobalData,
5536
5597
  setOperationData: setOperationData,
5537
5598
  setStyle: setStyle,
5538
5599
  startAction: startAction,
@@ -5600,6 +5661,7 @@ exports.resizeAction = resizeAction$1;
5600
5661
  exports.selectElement = selectElement$1;
5601
5662
  exports.setElementAttributes = setElementAttributes$1;
5602
5663
  exports.setElementContent = setElementContent$1;
5664
+ exports.setGlobalData = setGlobalData$1;
5603
5665
  exports.setOperationData = setOperationData$1;
5604
5666
  exports.setStyle = setStyle$1;
5605
5667
  exports.startAction = startAction$1;