@processmaker/screen-builder 2.85.8 → 2.85.10

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": "2.85.8",
3
+ "version": "2.85.10",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -43,6 +43,7 @@
43
43
  {{ pages[index]?.name }}
44
44
  </span>
45
45
  <span
46
+ v-if="isMultiPage"
46
47
  :data-test="`close-tab-${n}`"
47
48
  class="close-tab"
48
49
  role="link"
@@ -107,6 +108,13 @@ export default {
107
108
  buttonIcon: {
108
109
  type: String,
109
110
  default: () => "fa fa-file"
111
+ },
112
+ /**
113
+ * Is multi page mode enabled
114
+ */
115
+ isMultiPage: {
116
+ type: Boolean,
117
+ default: true
110
118
  }
111
119
  },
112
120
  data() {
@@ -47,10 +47,7 @@ export default {
47
47
  },
48
48
  },
49
49
  currencyValue() {
50
- this.unformattedValue = parseFloat(
51
- this.currencyInput.inputmask.unmaskedvalue().replace(',', '.')
52
- );
53
- this.$emit('input', this.unformattedValue || 0);
50
+ this.handleInput();
54
51
  },
55
52
  },
56
53
  methods: {
@@ -74,8 +71,16 @@ export default {
74
71
  // the decimal does not trigger an input event
75
72
  if (this.currencyValue !== event.target.value) {
76
73
  this.currencyValue = event.target.value;
74
+ } else {
75
+ this.handleInput();
77
76
  }
78
77
  },
78
+ handleInput() {
79
+ this.unformattedValue = parseFloat(
80
+ this.currencyInput.inputmask.unmaskedvalue().replace(',', '.')
81
+ );
82
+ this.$emit('input', this.unformattedValue || 0);
83
+ }
79
84
  },
80
85
  mounted() {
81
86
  this.loadMasks();
@@ -39,6 +39,7 @@
39
39
  :vdata="value"
40
40
  :_parent="_parent"
41
41
  :_initial-page="currentPage"
42
+ @after-submit="afterSubmit"
42
43
  @submit="submit"
43
44
  @asyncWatcherTriggered="onAsyncWatcherOn"
44
45
  @asyncWatcherCompleted="onAsyncWatcherOff"
@@ -108,6 +109,9 @@ export default {
108
109
  },
109
110
  setCurrentPage(page) {
110
111
  this.$refs.component.setCurrentPage(page);
112
+ },
113
+ afterSubmit() {
114
+ this.$emit('after-submit', ...arguments);
111
115
  }
112
116
  }
113
117
  };
@@ -30,6 +30,7 @@
30
30
  :key="refreshScreen"
31
31
  :loop-context="loopContext"
32
32
  @update="onUpdate"
33
+ @after-submit="afterSubmit"
33
34
  @submit="submit"
34
35
  />
35
36
  </div>
@@ -46,6 +47,7 @@
46
47
  :watchers="screen.watchers"
47
48
  :data="requestData"
48
49
  :type="screen.type"
50
+ @after-submit="afterSubmit"
49
51
  @submit="submit"
50
52
  />
51
53
  </div>
@@ -446,6 +448,9 @@ export default {
446
448
  }
447
449
  return 'card-header text-capitalize text-white ' + header;
448
450
  },
451
+ afterSubmit() {
452
+ this.$emit('after-submit', ...arguments);
453
+ },
449
454
  submit(formData = null, loading = false, buttonInfo = null) {
450
455
  //single click
451
456
  if (this.disabled) {
@@ -104,6 +104,7 @@
104
104
  <tabs-bar
105
105
  ref="tabsBar"
106
106
  :pages="config"
107
+ :is-multi-page="showToolbar"
107
108
  @tab-opened="currentPage = $event"
108
109
  >
109
110
  <template #tabs-start>
@@ -1386,7 +1387,7 @@ export default {
1386
1387
  };
1387
1388
  </script>
1388
1389
 
1389
- <style>
1390
+ <style scoped>
1390
1391
  .custom-popover {
1391
1392
  margin-right: -400px;
1392
1393
  padding: 16px;
@@ -18,6 +18,7 @@
18
18
  :test-screen-definition="testScreenDefinition || false"
19
19
  class="p-0"
20
20
  :loop-context="loopContext"
21
+ @after-submit="afterSubmit"
21
22
  @submit="submit"
22
23
  />
23
24
  </div>
@@ -246,6 +247,9 @@ export default {
246
247
  node.$children.forEach((child) => this.registerCustomFunctions(child));
247
248
  }
248
249
  },
250
+ afterSubmit() {
251
+ this.$emit('after-submit', ...arguments);
252
+ },
249
253
  submit(eventData, loading = false, buttonInfo = null) {
250
254
  this.$emit("submit", this.data, loading, buttonInfo);
251
255
  },
@@ -146,6 +146,15 @@ export default {
146
146
  }
147
147
  },
148
148
  async submitForm(eventData, loading = false, buttonInfo = null) {
149
+ const event = {
150
+ name: 'after-submit',
151
+ validation: true
152
+ };
153
+ this.$emit('after-submit', event, ...arguments);
154
+ if (event.validation === false) {
155
+ this.$emit('submit', this.vdata, loading, buttonInfo);
156
+ return;
157
+ }
149
158
  await this.validateNow(findRootScreen(this));
150
159
  this.hasSubmitted(true);
151
160
  if (!this.valid__ || this.disableSubmit__) {