@processmaker/screen-builder 2.29.0 → 2.30.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/screen-builder",
3
- "version": "2.29.0",
3
+ "version": "2.30.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "dependencies": {
24
24
  "is-proxy": "^1.0.6",
25
- "lodash": "^4.17.20",
25
+ "lodash": "^4.17.21",
26
26
  "moment": "^2.29.1",
27
27
  "moment-timezone": "^0.5.27",
28
28
  "scrollparent": "^2.0.1",
@@ -35,7 +35,7 @@ class Validations {
35
35
  isVisible() {
36
36
  // Disable validations if field is hidden
37
37
  let visible = true;
38
- if (!this.data.noData && this.element.config.conditionalHide) {
38
+ if (this.element.config.conditionalHide) {
39
39
  try {
40
40
  visible = !!Parser.evaluate(this.element.config.conditionalHide, this.data);
41
41
  } catch (error) {
@@ -43,7 +43,7 @@ class Validations {
43
43
  }
44
44
  }
45
45
  return visible;
46
- }
46
+ }
47
47
  }
48
48
 
49
49
  /**
@@ -115,7 +115,8 @@ class FormLoopValidations extends Validations {
115
115
  const loopField = get(validations, this.element.config.name);
116
116
  loopField['$each'] = {};
117
117
  this.checkForSiblings(validations);
118
- await ValidationsFactory(this.element.items, { screen: this.screen, data: {_parent: this.data, noData:true }, parentVisibilityRule: this.element.config.conditionalHide, insideLoop: true }).addValidations(loopField['$each']);
118
+ const firstRow = (get(this.data, this.element.config.name) || [{}])[0];
119
+ await ValidationsFactory(this.element.items, { screen: this.screen, data: {_parent: this.data, ...firstRow }, parentVisibilityRule: this.element.config.conditionalHide, insideLoop: true }).addValidations(loopField['$each']);
119
120
  }
120
121
  checkForSiblings(validations) {
121
122
  const siblings = [];
@@ -3,7 +3,7 @@ import { debounce } from 'lodash';
3
3
 
4
4
  export default {
5
5
  mounted() {
6
- this.refreshValidationRulesByName = debounce(this.refreshValidationRulesByName, 1000);
6
+ this.refreshValidationRulesByName = debounce(this.refreshValidationRulesByName, 500);
7
7
 
8
8
  this.$root.$on('refresh-validation-rules', () => {
9
9
  this.loadValidationRules();
@@ -30,7 +30,7 @@ export default {
30
30
 
31
31
  window.setTimeout(() => {
32
32
  this.refreshValidationRulesByName(fieldName, isVisible);
33
- }, 1000);
33
+ }, 250);
34
34
  return isVisible;
35
35
  } catch (e) {
36
36
  return false;