@processmaker/screen-builder 3.8.33 → 3.8.35

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.
@@ -9686,6 +9686,10 @@ const IT = Ts(), LT = [
9686
9686
  components: { ...NT, RequiredAsterisk: af },
9687
9687
  mixins: [IT],
9688
9688
  props: ["label", "error", "helper", "name", "value", "controlClass", "endpoint", "accept", "validation", "parent", "config", "multipleUpload", "screenType"],
9689
+ created() {
9690
+ const t = this;
9691
+ this.options.processParams = (e, r) => (!t.isFileManagerPublicInterface() || !t.multipleUpload || (e.data_name = e.filename || r.name), e);
9692
+ },
9689
9693
  updated() {
9690
9694
  this.removeDefaultClasses();
9691
9695
  },
@@ -9853,6 +9857,12 @@ const IT = Ts(), LT = [
9853
9857
  };
9854
9858
  },
9855
9859
  methods: {
9860
+ isFileManagerPublicInterface() {
9861
+ if (typeof window > "u" || !window.location)
9862
+ return !1;
9863
+ const t = String(window.location.pathname || ""), e = String(window.location.hash || "");
9864
+ return t.includes("/file-manager/public") || /\/file-manager\/?$/i.test(t) && /^#\/public(\/|$)/i.test(e);
9865
+ },
9856
9866
  clearFiles() {
9857
9867
  this.showComponent = !1, this.$nextTick(() => {
9858
9868
  this.showComponent = !0;
@@ -9950,7 +9960,7 @@ const IT = Ts(), LT = [
9950
9960
  });
9951
9961
  t.fileType = e.fileType;
9952
9962
  }
9953
- return this.filesAccept && (t.ignored = !0, this.validateFile(t, this.filesAccept) && (t.ignored = !1), t.ignored) ? (this.invalidFile = !0, this.uploading = !1, window.ProcessMaker.alert(this.$t("This file type is not accepted."), "danger"), !1) : (t.ignored = !1, this.name || (this.options.query.data_name = t.name), !0);
9963
+ return this.filesAccept && (t.ignored = !0, this.validateFile(t, this.filesAccept) && (t.ignored = !1), t.ignored) ? (this.invalidFile = !0, this.uploading = !1, window.ProcessMaker.alert(this.$t("This file type is not accepted."), "danger"), !1) : (t.ignored = !1, !this.name && !(this.isFileManagerPublicInterface() && this.multipleUpload) && (this.options.query.data_name = t.name), !0);
9954
9964
  },
9955
9965
  removeDefaultClasses() {
9956
9966
  this.$el.querySelectorAll(".uploader-btn, .uploader-drop").forEach((t) => {
@@ -10076,7 +10086,7 @@ var RT = function() {
10076
10086
  BT,
10077
10087
  !1,
10078
10088
  null,
10079
- "917cc4d9"
10089
+ "49ef329f"
10080
10090
  );
10081
10091
  const Go = HT.exports;
10082
10092
  const VT = {
@@ -46211,9 +46221,7 @@ const u_ = {
46211
46221
  console.log("refs vuetable not exists");
46212
46222
  },
46213
46223
  tableData() {
46214
- const t = Array.isArray(this.collectionData) && this.collectionData.length ? this.collectionData : Array.isArray(this.value) ? this.value : [];
46215
- this.value && (this.selectedIndex = this.value.selectedRowIndex);
46216
- const e = this.paginatorPage - 1;
46224
+ const t = Array.isArray(this.collectionData) && this.collectionData.length ? this.collectionData : Array.isArray(this.value) ? this.value : [], e = this.paginatorPage - 1;
46217
46225
  this.lastPage = Math.ceil(t.length / this.perPage);
46218
46226
  const r = {
46219
46227
  total: t.length,
@@ -46227,7 +46235,7 @@ const u_ = {
46227
46235
  data: t,
46228
46236
  lastSortConfig: !1
46229
46237
  };
46230
- return this.selectedIndex !== null && this.selectedIndex < r.data.length && (this.selectedRow = r.data[this.selectedIndex]), Array.isArray(this.value) && this.value.length > 0 && this.rows.length === 0 && this.value.forEach((i) => {
46238
+ return Array.isArray(this.value) && this.value.length > 0 && this.rows.length === 0 && this.value.forEach((i) => {
46231
46239
  i.hasOwnProperty("selectedRowsIndex") && this.selectedRows.push(r.data[i.selectedRowsIndex]);
46232
46240
  }), r;
46233
46241
  },
@@ -46258,6 +46266,13 @@ const u_ = {
46258
46266
  this.currentPage = this.currentPage > e ? e : this.currentPage, this.currentPage = this.currentPage == 0 ? 1 : this.currentPage;
46259
46267
  }
46260
46268
  },
46269
+ // Restore radio selection when the value prop is set after collection data is already loaded
46270
+ value: {
46271
+ immediate: !0,
46272
+ handler() {
46273
+ Array.isArray(this.collectionData) && this.collectionData.length && this.restoreRadioSelection(this.collectionData);
46274
+ }
46275
+ },
46261
46276
  // Watch for changes in validationData to handle any Mustache variable changes
46262
46277
  validationData: {
46263
46278
  handler(t, e) {
@@ -46281,10 +46296,16 @@ const u_ = {
46281
46296
  methods: {
46282
46297
  togglePopover(t, e, r) {
46283
46298
  if (this.deleteIndex = te.find(this.tableData.data, { row_id: r }), this.isPopoverVisible = this.isPopoverVisible === t ? null : t, this.isPopoverVisible !== null) {
46284
- const i = e.target.getBoundingClientRect();
46285
- this.popoverPosition = {
46286
- top: `${i.bottom + window.scrollY}px`,
46287
- left: `${i.left + window.scrollX}px`
46299
+ const a = (e.target.closest("button") || e.target).getBoundingClientRect(), n = 285, s = 130, o = 8;
46300
+ let u = a.bottom + o, l = a.left;
46301
+ u + s > window.innerHeight - o && (u = Math.max(
46302
+ o,
46303
+ a.top - s - o
46304
+ ));
46305
+ const c = window.innerWidth - n - o;
46306
+ l = Math.max(o, Math.min(l, c)), this.popoverPosition = {
46307
+ top: `${u}px`,
46308
+ left: `${l}px`
46288
46309
  };
46289
46310
  }
46290
46311
  },
@@ -46428,7 +46449,7 @@ const u_ = {
46428
46449
  a[n] = s;
46429
46450
  e.push(a);
46430
46451
  }
46431
- }), this.collectionData = e, this.reapplyCollectionSelections(e);
46452
+ }), this.collectionData = e, this.reapplyCollectionSelections(e), this.restoreRadioSelection(e);
46432
46453
  },
46433
46454
  // Keep selected rows in sync after collection refreshes triggered by PMQL filters.
46434
46455
  reapplyCollectionSelections(t) {
@@ -46451,6 +46472,20 @@ const u_ = {
46451
46472
  s && (i.selectedRowsIndex = a, r.push(i), s === 1 ? e.delete(n) : e.set(n, s - 1));
46452
46473
  }), this.selectedRows = r;
46453
46474
  },
46475
+ // Restore selectedRow after collection data (re)loads or when value prop changes.
46476
+ // Mirrors reapplyCollectionSelections for the single-record (radio) case.
46477
+ restoreRadioSelection(t) {
46478
+ var e;
46479
+ if (!(!this.value || !Array.isArray(t) || t.length === 0)) {
46480
+ if ((e = this.source) != null && e.singleField) {
46481
+ const r = t.find((i) => i[this.source.singleField] === this.value);
46482
+ r && (this.selectedRow = r);
46483
+ } else if (typeof this.value == "object" && !Array.isArray(this.value)) {
46484
+ const r = this.value.selectedRowIndex;
46485
+ r != null && r >= 0 && r < t.length && (this.selectedRow = t[r]);
46486
+ }
46487
+ }
46488
+ },
46454
46489
  shouldPersistCollectionSelection() {
46455
46490
  var e, r, i, a;
46456
46491
  const t = (r = (e = this.source) == null ? void 0 : e.collectionFields) == null ? void 0 : r.pmql;
@@ -46500,12 +46535,12 @@ const u_ = {
46500
46535
  return ((n = this.source) == null ? void 0 : n.sourceOptions) === "Collection" ? a = (s) => ({
46501
46536
  key: s[e || "key"],
46502
46537
  sortable: !0,
46503
- label: s[e || "key"],
46538
+ label: s.label || s[e || "key"],
46504
46539
  tdClass: "table-column"
46505
46540
  }) : a = (s) => ({
46506
46541
  key: s[e || "value"],
46507
46542
  sortable: !0,
46508
- label: s[r || "content"],
46543
+ label: s.label || s[r || "content"],
46509
46544
  tdClass: "table-column"
46510
46545
  }), this.getValidFieldData(t, i).map(
46511
46546
  a
@@ -46638,7 +46673,7 @@ var d_ = function() {
46638
46673
  "btn-danger": e.styleMode === "Classic"
46639
46674
  }, attrs: { title: e.$t("Delete"), "data-cy": "remove-row", popover: "manual" }, on: { click: function(n) {
46640
46675
  e.styleMode === "Modern" ? e.togglePopover(i, n, a.row_id) : e.showDeleteConfirmation(i, a.row_id);
46641
- } } }, [e.styleMode === "Classic" ? r("i", { staticClass: "fas fa-trash-alt" }) : r("img", { attrs: { src: l_, alt: "delete" } })]), r("div", { directives: [{ name: "show", rawName: "v-show", value: e.isPopoverVisible === i, expression: "isPopoverVisible === index" }], staticClass: "popover-content" }, [r("p", [e._v("Are you sure you want to delete it?")]), r("button", { staticClass: "btn btn-light", on: { click: e.hidePopover } }, [e._v("CANCEL")]), r("button", { staticClass: "btn btn-danger", on: { click: function(n) {
46676
+ } } }, [e.styleMode === "Classic" ? r("i", { staticClass: "fas fa-trash-alt" }) : r("img", { attrs: { src: l_, alt: "delete" } })]), r("div", { directives: [{ name: "show", rawName: "v-show", value: e.isPopoverVisible === i, expression: "isPopoverVisible === index" }], staticClass: "popover-content", style: e.popoverPosition }, [r("p", [e._v("Are you sure you want to delete it?")]), r("button", { staticClass: "btn btn-light", on: { click: e.hidePopover } }, [e._v("CANCEL")]), r("button", { staticClass: "btn btn-danger", on: { click: function(n) {
46642
46677
  return e.popover_remove();
46643
46678
  } } }, [e._v("DELETE")])])])])];
46644
46679
  } }]) }), r("div", { staticClass: "d-flex justify-content-between align-items-center" }, [r("div", { staticClass: "col text-left" }, [e.tableData.total > e.perPage && e.perPage !== 0 ? r("b-pagination", { attrs: { "data-cy": "table-pagination", "total-rows": e.tableData.total, "per-page": e.perPage, "aria-label": e.$t("Pagination"), "aria-controls": "vuetable" }, on: { change: e.onChangePage }, model: { value: e.currentPage, callback: function(i) {
@@ -48475,6 +48510,7 @@ const bS = W$.exports, Bg = [
48475
48510
  getCollectionColumns(t) {
48476
48511
  const [e] = (t == null ? void 0 : t.dataRecordList) || [];
48477
48512
  if (e != null && e.data) {
48513
+ this.singleFieldOptions = [];
48478
48514
  const r = e.data;
48479
48515
  for (const [i] of Object.entries(r))
48480
48516
  this.singleFieldOptions.push({ text: i, value: i });
@@ -48968,7 +49004,7 @@ const hee = {
48968
49004
  this.showJsonEditor = !1;
48969
49005
  },
48970
49006
  showEditOption(t) {
48971
- this.optionCardType = "edit", this.editIndex = t, this.optionContent = this.optionsList[t][this.valueField], this.optionValue = this.optionsList[t][this.keyField], this.optionContentCollection = this.optionsList[t][this.keyFieldCollection], this.optionValueCollection = this.optionsList[t][this.valueField], this.optionError = "";
49007
+ this.optionCardType = "edit", this.editIndex = t, this.optionContent = this.optionsList[t][this.valueField], this.optionValue = this.optionsList[t][this.keyField], this.optionContentCollection = this.optionsList[t].label || this.optionsList[t][this.keyFieldCollection], this.optionValueCollection = this.optionsList[t][this.valueField], this.optionError = "";
48972
49008
  },
48973
49009
  showAddOption() {
48974
49010
  this.optionCardType = "insert", this.optionContent = "", this.optionValue = "", this.optionContentCollection = "", this.optionValueCollection = "", this.showOptionCard = !0, this.optionError = "", this.editIndex = null;
@@ -49004,12 +49040,13 @@ const hee = {
49004
49040
  }
49005
49041
  this.optionsList.push(
49006
49042
  {
49007
- [this.keyFieldCollection]: this.optionContentCollection,
49008
- [this.valueField]: this.optionValueCollection
49043
+ [this.keyFieldCollection]: this.optionValueCollection,
49044
+ [this.valueField]: this.optionValueCollection,
49045
+ label: this.optionContentCollection
49009
49046
  }
49010
49047
  ), this.optionsList = this.optionsList.filter((e) => e.content !== "all");
49011
49048
  } else
49012
- this.optionsList[this.editIndex][this.keyFieldCollection] = this.optionContentCollection, this.optionsList[this.editIndex][this.valueField] = this.optionValueCollection;
49049
+ this.optionsList[this.editIndex][this.keyFieldCollection] = this.optionValueCollection, this.optionsList[this.editIndex][this.valueField] = this.optionValueCollection, this.optionsList[this.editIndex].label = this.optionContentCollection;
49013
49050
  this.jsonError = "", this.jsonData = JSON.stringify(this.optionsList), this.showOptionCard = !1, this.optionError = "", this.editIndex = null;
49014
49051
  },
49015
49052
  deleteOption() {
@@ -49104,7 +49141,7 @@ var mee = function() {
49104
49141
  vee,
49105
49142
  !1,
49106
49143
  null,
49107
- "faf2ec78"
49144
+ "6cd701ba"
49108
49145
  );
49109
49146
  const bee = gee.exports, yee = {
49110
49147
  components: {