@processmaker/screen-builder 3.8.16 → 3.8.18

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.
@@ -51112,7 +51112,7 @@ const nre = {
51112
51112
  const l = this.loadVariables(r);
51113
51113
  Object.assign(t, l.variables || {});
51114
51114
  }
51115
- return Object.assign(t, this.extractCalculatedVariables()), Object.keys(t).filter((l) => !l.startsWith("_parent.")).sort();
51115
+ return Object.assign(t, this.extractCalculatedVariables()), Object.assign(t, this.extractWatcherVariables()), Object.keys(t).filter((l) => this.isValidVariableName(l)).sort();
51116
51116
  },
51117
51117
  filteredVariables() {
51118
51118
  if (!this.searchQuery)
@@ -51139,6 +51139,19 @@ const nre = {
51139
51139
  return this.isEnabled ? this.requiredVariables.filter(
51140
51140
  (t) => !this.selectedVariables.includes(t)
51141
51141
  ) : [];
51142
+ },
51143
+ /**
51144
+ * Check if all filtered variables are selected
51145
+ */
51146
+ allSelected() {
51147
+ return this.filteredVariables.length > 0 && this.filteredVariables.every((t) => this.selectedVariables.includes(t));
51148
+ },
51149
+ /**
51150
+ * Check if some (but not all) filtered variables are selected
51151
+ */
51152
+ someSelected() {
51153
+ const t = this.filteredVariables.filter((e) => this.selectedVariables.includes(e)).length;
51154
+ return t > 0 && t < this.filteredVariables.length;
51142
51155
  }
51143
51156
  },
51144
51157
  watch: {
@@ -51148,8 +51161,8 @@ const nre = {
51148
51161
  selectedVariables(t) {
51149
51162
  this.isEnabled ? (this.$emit("input", t), this.$emit("change", t)) : (this.$emit("input", []), this.$emit("change", []));
51150
51163
  },
51151
- isEnabled(t) {
51152
- t || (this.selectedVariables = [], this.$emit("input", []), this.$emit("change", []));
51164
+ isEnabled(t, e) {
51165
+ t && !e ? (this.selectedVariables = [...this.availableVariables], this.$emit("input", this.selectedVariables), this.$emit("change", this.selectedVariables)) : t || (this.selectedVariables = [], this.$emit("input", []), this.$emit("change", []));
51153
51166
  },
51154
51167
  "selectedControl.config.event"(t) {
51155
51168
  this.event = t;
@@ -51160,6 +51173,10 @@ const nre = {
51160
51173
  // Watch for computed properties changes in App.vue
51161
51174
  "$root.computed"() {
51162
51175
  this.$forceUpdate();
51176
+ },
51177
+ // Watch for watchers changes in App.vue
51178
+ "$root.watchers"() {
51179
+ this.$forceUpdate();
51163
51180
  }
51164
51181
  },
51165
51182
  methods: {
@@ -51183,9 +51200,22 @@ const nre = {
51183
51200
  const t = new Set(this.filteredVariables);
51184
51201
  this.selectedVariables = this.selectedVariables.filter((e) => !t.has(e));
51185
51202
  },
51203
+ toggleSelectAll(t) {
51204
+ t ? this.selectAll() : this.deselectAll();
51205
+ },
51186
51206
  toggleSearch() {
51187
51207
  this.showSearch = !this.showSearch, this.showSearch || (this.searchQuery = "");
51188
51208
  },
51209
+ /**
51210
+ * Check if a variable name is valid
51211
+ * Uses same logic as dot_notation validation rule
51212
+ */
51213
+ isValidVariableName(t) {
51214
+ if (!t || typeof t != "string" || t.startsWith("_parent."))
51215
+ return !1;
51216
+ const e = /^[a-zA-Z][a-zA-Z0-9_]*$/;
51217
+ return t.split(".").every((i) => e.test(i));
51218
+ },
51189
51219
  /**
51190
51220
  * Extract calculated variables (computed properties) from the screen
51191
51221
  * Searches in multiple locations: App.vue, builder, or parent components
@@ -51217,6 +51247,32 @@ const nre = {
51217
51247
  }
51218
51248
  return [];
51219
51249
  },
51250
+ /**
51251
+ * Extract watcher output variables from the screen
51252
+ */
51253
+ extractWatcherVariables() {
51254
+ const t = {};
51255
+ return (this.getWatchers() || []).forEach((r) => {
51256
+ if (!r.byPass) {
51257
+ r.output_variable && (t[r.output_variable] = null);
51258
+ try {
51259
+ const i = typeof r.script_configuration == "string" ? JSON.parse(r.script_configuration) : r.script_configuration;
51260
+ ((i == null ? void 0 : i.dataMapping) || []).forEach((a) => {
51261
+ a.key && (t[a.key] = null);
51262
+ });
51263
+ } catch {
51264
+ console.error("Invalid JSON in script_configuration for watcher:", r.name);
51265
+ }
51266
+ }
51267
+ }), t;
51268
+ },
51269
+ /**
51270
+ * Get watchers from various sources
51271
+ */
51272
+ getWatchers() {
51273
+ var t, e, r, i, a, n, s, o, u;
51274
+ return ((e = (t = this.$root) == null ? void 0 : t.$data) == null ? void 0 : e.watchers) || ((a = (i = (r = this.$root) == null ? void 0 : r.$children) == null ? void 0 : i[0]) == null ? void 0 : a.watchers) || ((u = (o = (s = (n = this.$root) == null ? void 0 : n.$children) == null ? void 0 : s[0]) == null ? void 0 : o.$data) == null ? void 0 : u.watchers) || [];
51275
+ },
51220
51276
  /**
51221
51277
  * Extract variables from form config
51222
51278
  * Recursively searches through all pages and items
@@ -51239,9 +51295,22 @@ const nre = {
51239
51295
  * Single Responsibility: Only handles variable name extraction
51240
51296
  */
51241
51297
  extractVariableFromItem(t, e) {
51242
- var i;
51243
- const r = (i = t.config) == null ? void 0 : i.name;
51244
- r && !r.startsWith("_parent.") && (e[r] = null);
51298
+ var a;
51299
+ if ([
51300
+ "FormNestedScreen",
51301
+ "FormHtmlViewer",
51302
+ "FormMultiColumn",
51303
+ "FormCollectionRecordControl",
51304
+ "FormCollectionViewControl",
51305
+ "FormAvatar",
51306
+ "FormListTable",
51307
+ "FormAnalyticsChart",
51308
+ "CaseProgressBar",
51309
+ "FileDownload"
51310
+ ].includes(t.component))
51311
+ return;
51312
+ const i = (a = t.config) == null ? void 0 : a.name;
51313
+ i && !i.startsWith("_parent.") && (e[i] = null);
51245
51314
  },
51246
51315
  /**
51247
51316
  * Process special component types
@@ -51337,7 +51406,7 @@ var sre = function() {
51337
51406
  var e = this, r = e._self._c;
51338
51407
  return e.event === "submit" ? r("div", { staticClass: "variables-to-submit-wrapper" }, [e.isEnabled && e.missingRequiredVariables.length > 0 ? r("b-alert", { staticClass: "warning-alert", attrs: { show: "", variant: "warning", "data-cy": "missing-required-warning" } }, [r("i", { staticClass: "fas fa-bolt warning-icon" }), r("span", { staticClass: "warning-text" }, [e._v(" " + e._s(e.$t("The following required fields are not included")) + ' "'), r("strong", [e._v(e._s(e.missingRequiredVariables.join('", "')))]), e._v('". ' + e._s(e.$t("This may cause validation errors during submission.")) + " ")])]) : e._e(), r("div", { staticClass: "variables-to-submit-card" }, [r("div", { staticClass: "header-section" }, [r("h6", { staticClass: "header-title" }, [e._v(e._s(e.$t("Submit Information")))]), r("b-form-checkbox", { staticClass: "toggle-switch", attrs: { switch: "", size: "lg", "data-cy": "variables-to-submit-toggle" }, model: { value: e.isEnabled, callback: function(i) {
51339
51408
  e.isEnabled = i;
51340
- }, expression: "isEnabled" } })], 1), r("div", { staticClass: "description-text" }, [r("p", [e._v(e._s(e.$t("Select variables to submit, otherwise all variables will be submitted by default.")))])]), e.isEnabled && e.availableVariables.length === 0 ? r("div", { staticClass: "alert alert-info" }, [r("small", [e._v(e._s(e.$t("No variables available. Variables will be available after you add form fields to your screen.")))])]) : e.isEnabled ? r("div", [r("div", { staticClass: "divider" }), r("div", { staticClass: "controls-section" }, [r("button", { staticClass: "select-all-button", attrs: { type: "button", disabled: e.filteredVariables.length === 0 || e.selectedVariables.length === e.filteredVariables.length, "data-cy": "variables-to-submit-select-all" }, on: { click: e.selectAll } }, [e._v(" " + e._s(e.$t("Select All")) + " ")]), r("button", { staticClass: "search-button", attrs: { type: "button", "data-cy": "variables-to-submit-search-toggle" }, on: { click: e.toggleSearch } }, [r("i", { staticClass: "fas fa-search" })])]), e.showSearch ? r("div", { staticClass: "search-container" }, [r("b-input-group", [r("b-form-input", { staticClass: "search-input", attrs: { placeholder: e.$t("Search variables..."), "data-cy": "variables-to-submit-search" }, model: { value: e.searchQuery, callback: function(i) {
51409
+ }, expression: "isEnabled" } })], 1), r("div", { staticClass: "description-text" }, [r("p", [e._v(e._s(e.$t("Select variables to submit, otherwise all variables will be submitted by default.")))])]), e.isEnabled && e.availableVariables.length === 0 ? r("div", { staticClass: "alert alert-info" }, [r("small", [e._v(e._s(e.$t("No variables available. Variables will be available after you add form fields to your screen.")))])]) : e.isEnabled ? r("div", [r("div", { staticClass: "divider" }), r("div", { staticClass: "controls-section" }, [r("b-form-checkbox", { staticClass: "select-all-checkbox", attrs: { checked: e.allSelected, indeterminate: e.someSelected, disabled: e.filteredVariables.length === 0, "data-cy": "variables-to-submit-select-all" }, on: { change: e.toggleSelectAll } }, [e._v(" " + e._s(e.$t("Select All")) + " ")]), r("button", { staticClass: "search-button", attrs: { type: "button", "data-cy": "variables-to-submit-search-toggle" }, on: { click: e.toggleSearch } }, [r("i", { staticClass: "fas fa-search" })])], 1), e.showSearch ? r("div", { staticClass: "search-container" }, [r("b-input-group", [r("b-form-input", { staticClass: "search-input", attrs: { placeholder: e.$t("Search variables..."), "data-cy": "variables-to-submit-search" }, model: { value: e.searchQuery, callback: function(i) {
51341
51410
  e.searchQuery = i;
51342
51411
  }, expression: "searchQuery" } }), r("b-input-group-append", [r("b-button", { staticClass: "clear-search-button", attrs: { disabled: !e.searchQuery, "data-cy": "variables-to-submit-clear-search", variant: "outline-secondary" }, on: { click: function(i) {
51343
51412
  e.searchQuery = "";
@@ -51352,7 +51421,7 @@ var sre = function() {
51352
51421
  ore,
51353
51422
  !1,
51354
51423
  null,
51355
- "d234782e",
51424
+ "277c10d3",
51356
51425
  null,
51357
51426
  null
51358
51427
  );
@@ -51463,26 +51532,6 @@ const dre = [
51463
51532
  "defaultValue",
51464
51533
  "showForDesktop",
51465
51534
  { name: "customFormatter", showFor: "FormInput" },
51466
- { name: "ariaLabel", showFor: "FormInput" },
51467
- { name: "ariaLabel", showFor: "FormSelectList" },
51468
- { name: "ariaLabel", showFor: "FormDatePicker" },
51469
- { name: "ariaLabel", showFor: "FormCheckbox" },
51470
- { name: "ariaLabel", showFor: "FormDatePicker" },
51471
- { name: "ariaLabel", showFor: "FileUpload" },
51472
- { name: "ariaLabel", showFor: "FileDownload" },
51473
- { name: "ariaLabel", showFor: "FormSelectList" },
51474
- { name: "ariaLabel", showFor: "FormButton" },
51475
- { name: "ariaLabel", showFor: "FormTextArea" },
51476
- { name: "tabindex", showFor: "FormInput" },
51477
- { name: "tabindex", showFor: "FormSelectList" },
51478
- { name: "tabindex", showFor: "FormDatePicker" },
51479
- { name: "tabindex", showFor: "FormCheckbox" },
51480
- { name: "tabindex", showFor: "FormDatePicker" },
51481
- { name: "tabindex", showFor: "FileUpload" },
51482
- { name: "tabindex", showFor: "FileDownload" },
51483
- { name: "tabindex", showFor: "FormSelectList" },
51484
- { name: "tabindex", showFor: "FormButton" },
51485
- { name: "tabindex", showFor: "FormTextArea" },
51486
51535
  { name: "encryptedConfig", showFor: "FormInput" },
51487
51536
  { name: "variablesToSubmit", showFor: "FormButton" }
51488
51537
  ],
@@ -55049,8 +55098,7 @@ const Bie = () => new Promise((t) => {
55049
55098
  * @param {Object} data - The event data received from the socket listener.
55050
55099
  */
55051
55100
  handleProcessUpdate(t) {
55052
- const { event: e, elementDestination: r, tokenId: i } = t;
55053
- e === "ACTIVITY_COMPLETED" && this.task.id === i && r && (this.task.elementDestination = r, this.task.allow_interstitial = r.type === "displayNextAssignedTask"), e === "ACTIVITY_EXCEPTION" && (this.$emit("error", this.requestId), window.location.href = `/requests/${this.requestId}`);
55101
+ t.event === "ACTIVITY_EXCEPTION" && (this.$emit("error", this.requestId), window.location.href = `/requests/${this.requestId}`);
55054
55102
  },
55055
55103
  /**
55056
55104
  * Adds a socket listener for redirect events.
@@ -55224,7 +55272,7 @@ var Hie = function() {
55224
55272
  Vie,
55225
55273
  !1,
55226
55274
  null,
55227
- "d387aaa4",
55275
+ "1e376439",
55228
55276
  null,
55229
55277
  null
55230
55278
  );