@processmaker/screen-builder 3.6.0 → 3.7.0

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.6.0",
3
+ "version": "3.7.0",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -247,7 +247,11 @@ export default {
247
247
  return json;
248
248
  },
249
249
  showSimpleErrorMessage() {
250
- this.renderComponent = 'simpleErrorMessage';
250
+ // This triggers a re-render if it has already been displayed.
251
+ this.renderComponent = null;
252
+ setTimeout(() => {
253
+ this.renderComponent = 'simpleErrorMessage';
254
+ }, 0);
251
255
  },
252
256
  loadScreen(id) {
253
257
  this.disabled = true;
@@ -1381,15 +1381,27 @@ export default {
1381
1381
  }
1382
1382
  return index > this.pageDelete ? index - 1 : index;
1383
1383
  },
1384
+ // This function is used to calculate the new index of the references FormRecordList
1385
+ calcNewIndexForFormRecordList(index, referencedBy, config) {
1386
+ if (config[this.pageDelete].items.length > 0) {
1387
+ throw new Error(
1388
+ `${this.$t(
1389
+ "Can not delete this page, it is referenced by"
1390
+ )}: ${referencedBy}`
1391
+ );
1392
+ }
1393
+ return index > this.pageDelete ? index - 1 : index;
1394
+ },
1384
1395
  // Update Record list references
1385
1396
  updateRecordListReferences() {
1386
1397
  this.config.forEach((page) => {
1387
1398
  page.items.forEach((item) => {
1388
1399
  if (item.component === "FormRecordList") {
1389
1400
  // eslint-disable-next-line no-param-reassign
1390
- item.config.form = this.calcNewIndexFor(
1401
+ item.config.form = this.calcNewIndexForFormRecordList(
1391
1402
  item.config.form * 1,
1392
- item.config.label
1403
+ item.config.label,
1404
+ this.config,
1393
1405
  );
1394
1406
  }
1395
1407
  });
@@ -222,6 +222,7 @@ export default [
222
222
  allowMultiSelect: false,
223
223
  selectedOptions: [],
224
224
  optionsList: [],
225
+ optionsListExtra: [],
225
226
  key:'value',
226
227
  value:'content',
227
228
  ariaLabel: 'ariaLabel',