@processmaker/screen-builder 3.8.18 → 3.8.19

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": "3.8.18",
3
+ "version": "3.8.19",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -61,7 +61,7 @@
61
61
  "@fortawesome/fontawesome-free": "^5.6.1",
62
62
  "@originjs/vite-plugin-commonjs": "^1.0.3",
63
63
  "@panter/vue-i18next": "^0.15.2",
64
- "@processmaker/vue-form-elements": "0.65.5",
64
+ "@processmaker/vue-form-elements": "0.65.6",
65
65
  "@processmaker/vue-multiselect": "2.3.0",
66
66
  "@storybook/addon-essentials": "^7.6.13",
67
67
  "@storybook/addon-interactions": "^7.6.13",
@@ -125,7 +125,7 @@
125
125
  },
126
126
  "peerDependencies": {
127
127
  "@panter/vue-i18next": "^0.15.0",
128
- "@processmaker/vue-form-elements": "0.65.5",
128
+ "@processmaker/vue-form-elements": "0.65.6",
129
129
  "i18next": "^15.0.8",
130
130
  "vue": "^2.6.12",
131
131
  "vuex": "^3.1.1"
@@ -231,6 +231,20 @@ export default {
231
231
  someSelected() {
232
232
  const selectedCount = this.filteredVariables.filter(v => this.selectedVariables.includes(v)).length;
233
233
  return selectedCount > 0 && selectedCount < this.filteredVariables.length;
234
+ },
235
+
236
+ /**
237
+ * Source for computed properties to watch for changes
238
+ */
239
+ computedPropertiesSource() {
240
+ return this.getComputedProperties() || [];
241
+ },
242
+
243
+ /**
244
+ * Source for watchers to watch for changes
245
+ */
246
+ watchersSource() {
247
+ return this.getWatchers() || [];
234
248
  }
235
249
  },
236
250
  watch: {
@@ -267,22 +281,49 @@ export default {
267
281
  'selectedControl.config.event'(newVal) {
268
282
  this.event = newVal;
269
283
  },
270
- 'builder.variablesTree'() {
271
- // Force recomputation when variables tree changes
272
- this.$forceUpdate();
273
- },
274
- // Watch for computed properties changes in App.vue
275
- '$root.computed'() {
276
- // Force recomputation when computed properties change
277
- this.$forceUpdate();
278
- },
279
- // Watch for watchers changes in App.vue
280
- '$root.watchers'() {
281
- // Force recomputation when watchers change
282
- this.$forceUpdate();
284
+ formConfig: {
285
+ handler() {
286
+ this.$nextTick(() => {
287
+ this.cleanupInvalidSelections();
288
+ });
289
+ },
290
+ deep: true,
291
+ immediate: true
292
+ },
293
+ // Watch for computed properties changes
294
+ computedPropertiesSource: {
295
+ handler() {
296
+ this.$nextTick(() => {
297
+ this.cleanupInvalidSelections();
298
+ });
299
+ },
300
+ deep: true
301
+ },
302
+ // Watch for watchers changes
303
+ watchersSource: {
304
+ handler() {
305
+ this.$nextTick(() => {
306
+ this.cleanupInvalidSelections();
307
+ });
308
+ },
309
+ deep: true
283
310
  }
284
311
  },
285
312
  methods: {
313
+ /**
314
+ * Remove selected variables that no longer exist in availableVariables
315
+ */
316
+ cleanupInvalidSelections() {
317
+ const available = this.availableVariables;
318
+ const validSelected = this.selectedVariables.filter(v => available.includes(v));
319
+ if (validSelected.length !== this.selectedVariables.length) {
320
+ this.selectedVariables = validSelected;
321
+ // Turn off toggle if no variables remain selected
322
+ if (validSelected.length === 0) {
323
+ this.isEnabled = false;
324
+ }
325
+ }
326
+ },
286
327
  /**
287
328
  * Load variables from the variables tree
288
329
  * Only includes root-level variables (no prefix, no dots in name)
@@ -379,6 +420,11 @@ export default {
379
420
  return this.$root.$data.computed;
380
421
  }
381
422
 
423
+ // Try $root.$children[0] (App.vue pattern)
424
+ if (this.$root?.$children?.[0]?.computed && Array.isArray(this.$root.$children[0].computed)) {
425
+ return this.$root.$children[0].computed;
426
+ }
427
+
382
428
  // Try builder sources
383
429
  if (this.builder?.screen?.computed) {
384
430
  return this.builder.screen.computed;