@processmaker/screen-builder 2.5.26 → 2.5.27-alpha.1

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-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/screen-builder",
3
- "version": "2.5.26",
3
+ "version": "2.5.27-alpha.1",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/screen-builder",
3
- "version": "2.5.26",
3
+ "version": "2.5.27-alpha.1",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "peerDependencies": {
85
85
  "@panter/vue-i18next": "^0.15.0",
86
- "@processmaker/vue-form-elements": "0.18.4-N",
86
+ "@processmaker/vue-form-elements": "0.18.4-O-alpha.1",
87
87
  "i18next": "^15.0.8",
88
88
  "vue": "^2.6.12",
89
89
  "vuex": "^3.1.1"
@@ -284,7 +284,7 @@ export default {
284
284
  Object.keys(component.watch).forEach((key) => {
285
285
  const watch = { deep: true };
286
286
  component.watch[key].forEach(w => Object.assign(watch, w.options));
287
- watch.handler = new Function('value', component.watch[key].map(w => w.code).join('\n'));
287
+ watch.handler = new Function('value', component.watch[key].map(w => `try{${w.code}}catch(e){console.warn(e)}`).join('\n'));
288
288
  component.watch[key] = watch;
289
289
  });
290
290
  // Add validation rules
@@ -26,7 +26,7 @@ export default {
26
26
  }
27
27
  });
28
28
  },
29
- loadFieldProperties({ properties, element, componentName, definition , formIndex}) {
29
+ loadFieldProperties({ properties, element, componentName, definition , formIndex, screen}) {
30
30
  properties.class = this.elementCssClass(element);
31
31
  properties[':validation-data'] = 'getValidationData()';
32
32
 
@@ -38,7 +38,19 @@ export default {
38
38
  properties[':image'] = this.byRef(element.config.image);
39
39
  } else if (this.validVariableName(element.config.name)) {
40
40
  this.registerVariable(element.config.name, element);
41
- properties['v-model'] = `${element.config.name}`;
41
+ // v-model are not assigned directly to the field name, to prevent invalid references like:
42
+ // `person.content` when `person`=null
43
+ const computed_property = `computedProxy__${element.config.name.split('.').join('_DOT_')}`;
44
+ properties['v-model'] = computed_property;
45
+ screen.computed[computed_property] = {
46
+ get() {
47
+ return this.getValue(element.config.name);
48
+ },
49
+ set(value) {
50
+ this.setValue(element.config.name, value);
51
+ return true;
52
+ },
53
+ };
42
54
  }
43
55
  }
44
56
  // Do not replace mustache in RichText control, it is replaced by the control
package/src/.DS_Store DELETED
Binary file