@omnia/velcron 8.0.310-dev → 8.0.311-dev

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/models/Enums.d.ts CHANGED
@@ -5,7 +5,8 @@ export declare enum AssignOperators {
5
5
  equalsQuestion = "=?",
6
6
  plusPlus = "++",
7
7
  minusMinus = "--",
8
- equalsExclamation = "=!"
8
+ equalsExclamation = "=!",
9
+ equalsMinus = "=-"
9
10
  }
10
11
  export declare enum VelcronActionTypes {
11
12
  getOrSetValue = 0,
package/models/Enums.js CHANGED
@@ -10,6 +10,7 @@ var AssignOperators;
10
10
  AssignOperators["plusPlus"] = "++";
11
11
  AssignOperators["minusMinus"] = "--";
12
12
  AssignOperators["equalsExclamation"] = "=!";
13
+ AssignOperators["equalsMinus"] = "=-";
13
14
  })(AssignOperators || (exports.AssignOperators = AssignOperators = {}));
14
15
  var VelcronActionTypes;
15
16
  (function (VelcronActionTypes) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/velcron",
3
3
  "license": "MIT",
4
- "version": "8.0.310-dev",
4
+ "version": "8.0.311-dev",
5
5
  "description": "Provide Omnia Velcron Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -195,6 +195,9 @@ class VelcronActions {
195
195
  else if (partialTemplate.indexOf(models_1.AssignOperators.equalsPlus) > -1) {
196
196
  assignOpIndex = partialTemplate.indexOf(models_1.AssignOperators.equalsPlus);
197
197
  }
198
+ else if (partialTemplate.indexOf(models_1.AssignOperators.equalsMinus) > -1) {
199
+ assignOpIndex = partialTemplate.indexOf(models_1.AssignOperators.equalsMinus);
200
+ }
198
201
  else if (partialTemplate.indexOf(models_1.AssignOperators.equalsQuestion) > -1) {
199
202
  assignOpIndex = partialTemplate.indexOf(models_1.AssignOperators.equalsQuestion);
200
203
  }
@@ -298,6 +298,10 @@ class VelcronData {
298
298
  assignOperator = models_1.AssignOperators.plusEquals;
299
299
  path = path.substring(0, path.length - models_1.AssignOperators.plusEquals.length);
300
300
  }
301
+ else if (path.endsWith(models_1.AssignOperators.equalsMinus)) {
302
+ assignOperator = models_1.AssignOperators.equalsMinus;
303
+ path = path.substring(0, path.length - models_1.AssignOperators.equalsMinus.length);
304
+ }
301
305
  else if (path.endsWith(models_1.AssignOperators.equalsQuestion)) {
302
306
  assignOperator = models_1.AssignOperators.equalsQuestion;
303
307
  path = path.substring(0, path.length - models_1.AssignOperators.equalsQuestion.length);
@@ -457,6 +461,7 @@ class VelcronData {
457
461
  template = assignOperator + path;
458
462
  }
459
463
  else if (assignOperator === models_1.AssignOperators.equalsPlus || assignOperator === models_1.AssignOperators.plusEquals) {
464
+ //Support adding items to array += unshifts or =+ pushes
460
465
  if (Array.isArray(existingVal)) {
461
466
  names.push("value");
462
467
  obj.push(value);
@@ -469,6 +474,17 @@ class VelcronData {
469
474
  }
470
475
  }
471
476
  }
477
+ else if (assignOperator === models_1.AssignOperators.equalsMinus) {
478
+ //Support removing items from array
479
+ if (Array.isArray(existingVal)) {
480
+ names.push("value");
481
+ obj.push(value);
482
+ template = `${path} = ${path}.filter(item => item !== value)`;
483
+ }
484
+ else {
485
+ VelcronLogger_1.VelcronLogger.logDataError(`Attempted to remove value from a non-array property at path ${path}`);
486
+ }
487
+ }
472
488
  else if (assignOperator === models_1.AssignOperators.equalsQuestion) {
473
489
  if (Array.isArray(existingVal)) {
474
490
  //fix this
@@ -38,7 +38,7 @@ class VelcronDataBinder {
38
38
  }
39
39
  // String interpolation > {{ $state.title }} and {{ $state.description }}
40
40
  // Computed String interpolation > {{@getName}}
41
- return this.interpolateTokens(bindTo, renderContext);
41
+ return VelcronDataBinder.interpolateTokens(bindTo, renderContext);
42
42
  }
43
43
  static interpolateTokens(bindTo, renderContext) {
44
44
  const tokens = VelcronData_1.VelcronData.getTokens(bindTo, false);