versacall-dashboards-library-react 2.0.13 → 2.0.14

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.
@@ -416,30 +416,40 @@ class DashboardsCellGlobalConditions extends _react.Component {
416
416
  }
417
417
 
418
418
  updateCondition(change) {
419
+ var _this$state = this.state,
420
+ conditionIndex = _this$state.conditionIndex,
421
+ typeCondition = _this$state.typeCondition;
422
+ console.log("conditionIndex = ".concat(conditionIndex, ", typeCondition = ").concat(typeCondition));
423
+
419
424
  var updatedValue = _objectSpread({}, this.props.value);
420
425
 
421
- var conditions = updatedValue["".concat(this.state.typeCondition, "Conditions")]; // const conditions = JSON.parse(JSON.stringify(this.props.value[`${this.state.typeCondition}Conditions`]));
426
+ console.log('updatedValue', updatedValue);
427
+ console.log('typeCondition');
428
+ var conditions = updatedValue["".concat(typeCondition, "Conditions")]; // const conditions = JSON.parse(JSON.stringify(this.props.value[`${this.state.typeCondition}Conditions`]));
422
429
 
423
430
  if (this.state.advanced) {
424
- conditions[this.state.conditionIndex].condition = change.value;
431
+ conditions[conditionIndex].condition = change.value;
425
432
  } else {
426
- var split = conditions[this.state.conditionIndex].condition.split(/[ ,]+/);
433
+ var split = conditions[conditionIndex].condition.split(/[ ,]+/);
434
+ var segment1 = split[0];
435
+ var segment2 = split.length > 1 ? split[1] : '===';
436
+ var segment3 = split.length > 2 ? split[2] : '0';
427
437
 
428
438
  switch (change.stringIndex) {
429
439
  case 0:
430
- conditions[this.state.conditionIndex].condition = "".concat(change.value, " ").concat(split[1], " ").concat(split[2]);
440
+ conditions[conditionIndex].condition = "".concat(change.value, " ").concat(segment2, " ").concat(segment3);
431
441
  break;
432
442
 
433
443
  case 1:
434
- conditions[this.state.conditionIndex].condition = "".concat(split[0], " ").concat(change.value, " ").concat(split[2]);
444
+ conditions[conditionIndex].condition = "".concat(segment1, " ").concat(change.value, " ").concat(segment3);
435
445
  break;
436
446
 
437
447
  case 2:
438
- conditions[this.state.conditionIndex].condition = "".concat(split[0], " ").concat(split[1], " ").concat(change.value);
448
+ conditions[conditionIndex].condition = "".concat(segment1, " ").concat(segment2, " ").concat(change.value);
439
449
  break;
440
450
 
441
451
  default:
442
- conditions[this.state.conditionIndex].condition = '1 > 0';
452
+ conditions[conditionIndex].condition = "".concat(segment1, " ").concat(segment2, " ").concat(segment3);
443
453
  break;
444
454
  }
445
455
  } // this.props.updateValue({ [`${this.state.typeCondition}Conditions`]: conditions });
@@ -617,9 +627,9 @@ class DashboardsCellGlobalConditions extends _react.Component {
617
627
  var _this$props = this.props,
618
628
  classes = _this$props.classes,
619
629
  intl = _this$props.intl;
620
- var _this$state = this.state,
621
- tabIndex = _this$state.tabIndex,
622
- conditionIndex = _this$state.conditionIndex;
630
+ var _this$state2 = this.state,
631
+ tabIndex = _this$state2.tabIndex,
632
+ conditionIndex = _this$state2.conditionIndex;
623
633
  var divStyle = {
624
634
  border: '1px solid black',
625
635
  padding: 10,
@@ -682,13 +692,13 @@ class DashboardsCellGlobalConditions extends _react.Component {
682
692
  styles = _this$props2.styles,
683
693
  widgets = _this$props2.widgets,
684
694
  variables = _this$props2.variables;
685
- var _this$state2 = this.state,
686
- open = _this$state2.open,
687
- tabIndex = _this$state2.tabIndex,
688
- conditionIndex = _this$state2.conditionIndex,
689
- menuIndex = _this$state2.menuIndex,
690
- menuAnchorEl = _this$state2.menuAnchorEl,
691
- advanced = _this$state2.advanced;
695
+ var _this$state3 = this.state,
696
+ open = _this$state3.open,
697
+ tabIndex = _this$state3.tabIndex,
698
+ conditionIndex = _this$state3.conditionIndex,
699
+ menuIndex = _this$state3.menuIndex,
700
+ menuAnchorEl = _this$state3.menuAnchorEl,
701
+ advanced = _this$state3.advanced;
692
702
  var currentCondition = null;
693
703
 
694
704
  if (conditionIndex !== null) {
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "versacall": {
3
3
  "title": "Versacall Dashboards Library React",
4
4
  "applicationType": "react-library",
5
- "build": 13
5
+ "build": 14
6
6
  },
7
7
  "name": "versacall-dashboards-library-react",
8
- "version": "2.0.13",
8
+ "version": "2.0.14",
9
9
  "description": "Versacall Dashboards Library",
10
10
  "main": "dist/index.js",
11
11
  "module": "dist/index.js",