@processmaker/screen-builder 3.8.22 → 3.8.23

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.
@@ -46111,7 +46111,41 @@ const _K = {
46111
46111
  a[n] = s;
46112
46112
  e.push(a);
46113
46113
  }
46114
- }), this.collectionData = e;
46114
+ }), this.collectionData = e, this.reapplyCollectionSelections(e);
46115
+ },
46116
+ // Keep selected rows in sync after collection refreshes triggered by PMQL filters.
46117
+ reapplyCollectionSelections(t) {
46118
+ if (!this.shouldPersistCollectionSelection() || !Array.isArray(this.selectedRows) || this.selectedRows.length === 0)
46119
+ return;
46120
+ const e = this.selectedRows.reduce((i, a) => {
46121
+ const n = this.getCollectionRowKey(a);
46122
+ if (!n)
46123
+ return i;
46124
+ const s = i.get(n) || 0;
46125
+ return i.set(n, s + 1), i;
46126
+ }, /* @__PURE__ */ new Map());
46127
+ if (e.size === 0) {
46128
+ this.selectedRows = [];
46129
+ return;
46130
+ }
46131
+ const r = [];
46132
+ t.forEach((i, a) => {
46133
+ const n = this.getCollectionRowKey(i), s = e.get(n);
46134
+ s && (i.selectedRowsIndex = a, r.push(i), s === 1 ? e.delete(n) : e.set(n, s - 1));
46135
+ }), this.selectedRows = r;
46136
+ },
46137
+ shouldPersistCollectionSelection() {
46138
+ var e, r, i, a;
46139
+ const t = (r = (e = this.source) == null ? void 0 : e.collectionFields) == null ? void 0 : r.pmql;
46140
+ return ((i = this.source) == null ? void 0 : i.sourceOptions) === "Collection" && ((a = this.source) == null ? void 0 : a.dataSelectionOptions) === "multiple-records" && typeof t == "string" && t.trim().length > 0;
46141
+ },
46142
+ getCollectionRowKey(t) {
46143
+ if (!t || typeof t != "object")
46144
+ return null;
46145
+ const e = Object.entries(t).filter(
46146
+ ([r]) => r !== "selectedRowsIndex"
46147
+ );
46148
+ return e.length === 0 ? null : (e.sort(([r], [i]) => r > i ? 1 : r < i ? -1 : 0), JSON.stringify(e));
46115
46149
  },
46116
46150
  updateRowDataNamePrefix() {
46117
46151
  this.setUploadDataNamePrefix(this.currentRowIndex);
@@ -55135,6 +55169,10 @@ const Bie = () => new Promise((t) => {
55135
55169
  * @param {Object} data - The event data received from the socket listener.
55136
55170
  */
55137
55171
  handleProcessUpdate(t) {
55172
+ if (!this.task) {
55173
+ this.reload();
55174
+ return;
55175
+ }
55138
55176
  const { event: e, elementDestination: r, tokenId: i } = t;
55139
55177
  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}`);
55140
55178
  },
@@ -55310,7 +55348,7 @@ var Hie = function() {
55310
55348
  Vie,
55311
55349
  !1,
55312
55350
  null,
55313
- "b674103a",
55351
+ "b8b1823e",
55314
55352
  null,
55315
55353
  null
55316
55354
  );