@processmaker/screen-builder 2.83.1 → 2.83.3
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/dist/vue-form-builder.css +1 -1
- package/dist/vue-form-builder.es.js +21333 -21147
- package/dist/vue-form-builder.es.js.map +1 -1
- package/dist/vue-form-builder.umd.js +54 -54
- package/dist/vue-form-builder.umd.js.map +1 -1
- package/package.json +13 -13
- package/src/components/editor/loop.vue +152 -132
- package/src/components/editor/multi-column.vue +178 -152
- package/src/components/inspector/collection-select-list.vue +43 -36
- package/src/components/inspector/label-submit-button.vue +5 -0
- package/src/components/inspector/loading-submit-button.vue +8 -5
- package/src/components/inspector/outbound-config.vue +91 -71
- package/src/components/inspector/screen-selector.vue +47 -44
- package/src/components/inspector/select-data-type-mask.vue +1 -1
- package/src/components/inspector/tooltip.vue +62 -60
- package/src/components/inspector/validation-select.vue +404 -180
- package/src/components/renderer/add-loop-row.vue +32 -21
- package/src/components/renderer/form-analytics-chart.vue +23 -26
- package/src/components/renderer/form-list-table.vue +77 -30
- package/src/components/renderer/form-loop.vue +88 -60
- package/src/components/renderer/form-masked-input.vue +1 -1
- package/src/components/renderer/form-nested-screen.vue +5 -0
- package/src/components/renderer/form-record-list.vue +25 -0
- package/src/components/task.vue +3 -1
- package/src/components/vue-form-renderer.vue +2 -1
- package/src/main.js +4 -2
package/package.json
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@processmaker/screen-builder",
|
|
3
|
-
"version": "2.83.
|
|
3
|
+
"version": "2.83.3",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"dev": "vite",
|
|
6
|
-
"serve": "vue-cli-service serve",
|
|
5
|
+
"dev": "VITE_COVERAGE=true vite",
|
|
7
6
|
"build": "vite build",
|
|
8
7
|
"preview": "vite preview",
|
|
9
|
-
"test:unit": "vue-cli-service test:unit",
|
|
10
8
|
"lint": "vue-cli-service lint",
|
|
11
9
|
"build-bundle": "npm run build",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"run-cypress": "NODE_ENV=test TZ=UTC nyc cypress run",
|
|
15
|
-
"test": "vue-cli-service test:unit"
|
|
10
|
+
"open-cypress": "nyc cypress open",
|
|
11
|
+
"run-cypress": "TZ=UTC nyc cypress run"
|
|
16
12
|
},
|
|
17
13
|
"main": "./dist/vue-form-builder.umd.js",
|
|
18
14
|
"module": "./dist/vue-form-builder.es.js",
|
|
@@ -46,10 +42,12 @@
|
|
|
46
42
|
"vuelidate": "^0.7.5"
|
|
47
43
|
},
|
|
48
44
|
"devDependencies": {
|
|
49
|
-
"@4tw/cypress-drag-drop": "
|
|
45
|
+
"@4tw/cypress-drag-drop": "^2.2.5",
|
|
50
46
|
"@babel/core": "^7.12.16",
|
|
51
47
|
"@babel/eslint-parser": "^7.12.16",
|
|
52
|
-
"@cypress/
|
|
48
|
+
"@cypress-audit/lighthouse": "^1.4.2",
|
|
49
|
+
"@cypress-audit/pa11y": "^1.4.2",
|
|
50
|
+
"@cypress/code-coverage": "^3.12.19",
|
|
53
51
|
"@fortawesome/fontawesome-free": "^5.6.1",
|
|
54
52
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
55
53
|
"@panter/vue-i18next": "^0.15.2",
|
|
@@ -64,17 +62,18 @@
|
|
|
64
62
|
"bootstrap-vue": "^2.19.0",
|
|
65
63
|
"css-loader": "^5.2.7",
|
|
66
64
|
"css-tree": "^1.0.0-alpha.29",
|
|
67
|
-
"cypress": "^
|
|
68
|
-
"cypress-
|
|
69
|
-
"cypress-wait-until": "^1.7.1",
|
|
65
|
+
"cypress": "^13.6.3",
|
|
66
|
+
"cypress-wait-until": "^3.0.1",
|
|
70
67
|
"eslint": "^8.21.0",
|
|
71
68
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
72
69
|
"eslint-config-prettier": "^8.5.0",
|
|
70
|
+
"eslint-plugin-cypress": "^2.15.1",
|
|
73
71
|
"eslint-plugin-import": "^2.26.0",
|
|
74
72
|
"eslint-plugin-jest": "^22.4.1",
|
|
75
73
|
"eslint-plugin-prettier": "^4.2.1",
|
|
76
74
|
"eslint-plugin-vue": "^9.3.0",
|
|
77
75
|
"expr-eval": "^2.0.2",
|
|
76
|
+
"globby": "^11.1.0",
|
|
78
77
|
"i18next": "^15.0.8",
|
|
79
78
|
"identity-obj-proxy": "^3.0.0",
|
|
80
79
|
"inputmask": "^5.0.7",
|
|
@@ -85,6 +84,7 @@
|
|
|
85
84
|
"v-calendar": "^0.9.7",
|
|
86
85
|
"validatorjs": "^3.14.2",
|
|
87
86
|
"vite": "^4.0.4",
|
|
87
|
+
"vite-plugin-istanbul": "^5.0.0",
|
|
88
88
|
"vite-plugin-monaco-editor": "^1.1.0",
|
|
89
89
|
"vue": "^2.6.12",
|
|
90
90
|
"vue-deepset": "^0.6.3",
|
|
@@ -1,129 +1,145 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="column-draggable" :selector="config.customCssSelector">
|
|
3
|
-
<draggable
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
v-if="selected === element"
|
|
18
|
-
class="card-header form-element-header d-flex align-items-center border rounded"
|
|
19
|
-
:class="{ 'pulse': isAiSection(element) }"
|
|
20
|
-
>
|
|
21
|
-
<i class="fas fa-arrows-alt-v mr-1 text-muted"/>
|
|
22
|
-
<i v-if="element.config.icon" :class="element.config.icon" class="mr-2 ml-1"/>
|
|
23
|
-
{{ element.config.name || $t('Variable Name') }}
|
|
24
|
-
<div class="ml-auto">
|
|
25
|
-
<button
|
|
26
|
-
v-if="isAiSection(element) && aiPreview(element)"
|
|
27
|
-
class="btn btn-sm btn-primary mr-2"
|
|
28
|
-
:title="$t('Apply Changes')"
|
|
29
|
-
@click="applyAiChanges(element)"
|
|
30
|
-
>
|
|
31
|
-
{{ $t("Apply Changes") }}
|
|
32
|
-
</button>
|
|
33
|
-
<button
|
|
34
|
-
v-if="!(isAiSection(element) && aiPreview(element))"
|
|
35
|
-
class="btn btn-sm btn-secondary mr-2"
|
|
36
|
-
:title="$t('Copy Control')"
|
|
37
|
-
@click="duplicateItem(index)"
|
|
3
|
+
<draggable style="min-height: 80px" :list="items" group="controls">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(element, index) in items"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="control-item"
|
|
8
|
+
:class="{ selected: selected === element, hasError: hasError(element) }"
|
|
9
|
+
@click.stop="inspect(element)"
|
|
10
|
+
>
|
|
11
|
+
<div v-if="element.container" @click.stop="inspect(element)">
|
|
12
|
+
<div
|
|
13
|
+
class="m-2 card border-0"
|
|
14
|
+
:class="{
|
|
15
|
+
'ai-section-card': isAiSection(element) && selected === element
|
|
16
|
+
}"
|
|
38
17
|
>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
18
|
+
<div
|
|
19
|
+
v-if="selected === element"
|
|
20
|
+
class="card-header form-element-header d-flex align-items-center border rounded"
|
|
21
|
+
:class="{ pulse: isAiSection(element) }"
|
|
22
|
+
>
|
|
23
|
+
<i class="fas fa-arrows-alt-v mr-1 text-muted" />
|
|
24
|
+
<i
|
|
25
|
+
v-if="element.config.icon"
|
|
26
|
+
:class="element.config.icon"
|
|
27
|
+
class="mr-2 ml-1"
|
|
28
|
+
/>
|
|
29
|
+
{{ element.config.name || $t("Variable Name") }}
|
|
30
|
+
<div class="ml-auto">
|
|
31
|
+
<button
|
|
32
|
+
v-if="isAiSection(element) && aiPreview(element)"
|
|
33
|
+
class="btn btn-sm btn-primary mr-2"
|
|
34
|
+
:title="$t('Apply Changes')"
|
|
35
|
+
@click="applyAiChanges(element)"
|
|
36
|
+
>
|
|
37
|
+
{{ $t("Apply Changes") }}
|
|
38
|
+
</button>
|
|
39
|
+
<button
|
|
40
|
+
v-if="!(isAiSection(element) && aiPreview(element))"
|
|
41
|
+
class="btn btn-sm btn-secondary mr-2"
|
|
42
|
+
:title="$t('Copy Control')"
|
|
43
|
+
@click="duplicateItem(index)"
|
|
44
|
+
>
|
|
45
|
+
<i class="fas fa-copy text-light" />
|
|
46
|
+
</button>
|
|
47
|
+
<button
|
|
48
|
+
class="btn btn-sm btn-danger"
|
|
49
|
+
:aria-label="$t('Delete')"
|
|
50
|
+
@click="deleteItem(index)"
|
|
51
|
+
>
|
|
52
|
+
<i class="far fa-trash-alt text-light" />
|
|
53
|
+
</button>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
64
56
|
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
57
|
+
<component
|
|
58
|
+
v-model="element.items"
|
|
59
|
+
:is="element['editor-component']"
|
|
60
|
+
:class="elementCssClass(element)"
|
|
61
|
+
:validation-errors="validationErrors"
|
|
62
|
+
class="mb-3 mr-3 ml-3"
|
|
63
|
+
:selected="selected"
|
|
64
|
+
:ai-element="element"
|
|
65
|
+
:config="element.config"
|
|
66
|
+
@inspect="inspect"
|
|
67
|
+
@update-state="$emit('update-state')"
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div v-else :id="element.config.name ? element.config.name : undefined">
|
|
73
|
+
<div class="m-2" :class="{ card: selected === element }">
|
|
74
|
+
<div
|
|
75
|
+
v-if="selected === element"
|
|
76
|
+
class="card-header form-element-header d-flex align-items-center"
|
|
77
|
+
>
|
|
78
|
+
<i class="fas fa-arrows-alt-v mr-1 text-muted" />
|
|
79
|
+
<i
|
|
80
|
+
v-if="element.config.icon"
|
|
81
|
+
:class="element.config.icon"
|
|
82
|
+
class="mr-2 ml-1"
|
|
83
|
+
/>
|
|
84
|
+
{{ element.config.name || $t("Variable Name") }}
|
|
85
|
+
<div class="ml-auto">
|
|
86
|
+
<button
|
|
87
|
+
class="btn btn-sm btn-secondary mr-2"
|
|
88
|
+
:title="$t('Copy Control')"
|
|
89
|
+
@click="duplicateItem(index)"
|
|
90
|
+
>
|
|
91
|
+
<i class="fas fa-copy text-light" />
|
|
92
|
+
</button>
|
|
93
|
+
<button
|
|
94
|
+
class="btn btn-sm btn-danger"
|
|
95
|
+
:aria-label="$t('Delete')"
|
|
96
|
+
@click="deleteItem(index)"
|
|
97
|
+
>
|
|
98
|
+
<i class="far fa-trash-alt text-light" />
|
|
99
|
+
</button>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
91
102
|
|
|
92
|
-
<component
|
|
93
|
-
|
|
94
|
-
:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
<component
|
|
104
|
+
v-bind="element.config"
|
|
105
|
+
:is="element['editor-component']"
|
|
106
|
+
class="p-3"
|
|
107
|
+
:class="[
|
|
108
|
+
elementCssClass(element),
|
|
109
|
+
{ 'prevent-interaction': !element.config.interactive }
|
|
110
|
+
]"
|
|
111
|
+
:tabindex="element.config.interactive ? 0 : -1"
|
|
112
|
+
:config="element.config"
|
|
113
|
+
@input="
|
|
114
|
+
element.config.interactive
|
|
115
|
+
? (element.config.content = $event)
|
|
116
|
+
: null
|
|
117
|
+
"
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</draggable>
|
|
123
|
+
</div>
|
|
106
124
|
</template>
|
|
107
125
|
|
|
108
126
|
<script>
|
|
109
|
-
import draggable from
|
|
110
|
-
import
|
|
111
|
-
import * as renderer from '@/components/renderer';
|
|
112
|
-
import _ from 'lodash';
|
|
127
|
+
import draggable from "vuedraggable";
|
|
128
|
+
import _ from "lodash";
|
|
113
129
|
import {
|
|
114
|
-
FormInput,
|
|
115
|
-
FormSelectList,
|
|
116
|
-
FormTextArea,
|
|
117
130
|
FormCheckbox,
|
|
118
131
|
FormDatePicker,
|
|
119
132
|
FormHtmlEditor,
|
|
120
133
|
FormHtmlViewer,
|
|
121
|
-
|
|
134
|
+
FormInput,
|
|
135
|
+
FormSelectList,
|
|
136
|
+
FormTextArea
|
|
137
|
+
} from "@processmaker/vue-form-elements";
|
|
138
|
+
import { HasColorProperty } from "@/mixins";
|
|
139
|
+
import * as renderer from "@/components/renderer";
|
|
122
140
|
|
|
123
141
|
export default {
|
|
124
|
-
name:
|
|
125
|
-
mixins: [HasColorProperty],
|
|
126
|
-
props: ['value', 'name', 'config', 'selected', 'validationErrors'],
|
|
142
|
+
name: "Loop",
|
|
127
143
|
components: {
|
|
128
144
|
draggable,
|
|
129
145
|
FormInput,
|
|
@@ -133,14 +149,27 @@ export default {
|
|
|
133
149
|
FormDatePicker,
|
|
134
150
|
FormHtmlEditor,
|
|
135
151
|
FormHtmlViewer,
|
|
136
|
-
...renderer
|
|
152
|
+
...renderer
|
|
137
153
|
},
|
|
154
|
+
mixins: [HasColorProperty],
|
|
155
|
+
props: ["value", "name", "config", "selected", "validationErrors"],
|
|
138
156
|
data() {
|
|
139
157
|
return {
|
|
140
158
|
items: [],
|
|
141
159
|
cancelledJobs: []
|
|
142
160
|
};
|
|
143
161
|
},
|
|
162
|
+
watch: {
|
|
163
|
+
value: {
|
|
164
|
+
handler() {
|
|
165
|
+
this.items = this.value;
|
|
166
|
+
},
|
|
167
|
+
immediate: true
|
|
168
|
+
},
|
|
169
|
+
items() {
|
|
170
|
+
this.$emit("input", this.items);
|
|
171
|
+
}
|
|
172
|
+
},
|
|
144
173
|
mounted() {
|
|
145
174
|
if (
|
|
146
175
|
!localStorage.getItem("cancelledJobs") ||
|
|
@@ -157,34 +186,25 @@ export default {
|
|
|
157
186
|
this.updateProgress(progress, nonce);
|
|
158
187
|
});
|
|
159
188
|
},
|
|
160
|
-
watch: {
|
|
161
|
-
value: {
|
|
162
|
-
handler() {
|
|
163
|
-
this.items = this.value;
|
|
164
|
-
},
|
|
165
|
-
immediate: true,
|
|
166
|
-
},
|
|
167
|
-
items() {
|
|
168
|
-
this.$emit('input', this.items);
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
189
|
methods: {
|
|
172
190
|
hasError(element) {
|
|
173
|
-
if (!this.validationErrors) {
|
|
191
|
+
if (!this.validationErrors) {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
174
194
|
return this.validationErrors.some(({ item }) => item === element);
|
|
175
195
|
},
|
|
176
196
|
inspect(element) {
|
|
177
|
-
this.$emit(
|
|
197
|
+
this.$emit("inspect", element);
|
|
178
198
|
},
|
|
179
199
|
deleteItem(index) {
|
|
180
200
|
// Remove the item from the array in currentPage
|
|
181
201
|
this.items.splice(index, 1);
|
|
182
|
-
this.$emit(
|
|
202
|
+
this.$emit("update-state");
|
|
183
203
|
},
|
|
184
204
|
duplicateItem(index) {
|
|
185
205
|
const duplicate = _.cloneDeep(this.items[index]);
|
|
186
206
|
this.items.push(duplicate);
|
|
187
|
-
this.$emit(
|
|
207
|
+
this.$emit("update-state");
|
|
188
208
|
},
|
|
189
209
|
isAiSection(element) {
|
|
190
210
|
return element.component === "AiSection";
|
|
@@ -226,7 +246,7 @@ export default {
|
|
|
226
246
|
.hasError {
|
|
227
247
|
border: 1px solid red;
|
|
228
248
|
border-radius: 0.25rem;
|
|
229
|
-
|
|
249
|
+
|
|
230
250
|
.form-element-header {
|
|
231
251
|
border-bottom: 1px solid red;
|
|
232
252
|
color: red;
|
|
@@ -245,25 +265,25 @@ export default {
|
|
|
245
265
|
|
|
246
266
|
.control-item {
|
|
247
267
|
position: relative;
|
|
248
|
-
|
|
268
|
+
|
|
249
269
|
.delete {
|
|
250
270
|
position: absolute;
|
|
251
271
|
top: 0px;
|
|
252
272
|
right: 0px;
|
|
253
273
|
display: none;
|
|
254
274
|
}
|
|
255
|
-
|
|
275
|
+
|
|
256
276
|
&.selected,
|
|
257
277
|
&:hover {
|
|
258
278
|
.mask {
|
|
259
279
|
border: 1px solid red;
|
|
260
280
|
}
|
|
261
|
-
|
|
281
|
+
|
|
262
282
|
.delete {
|
|
263
283
|
display: inline-block;
|
|
264
284
|
}
|
|
265
285
|
}
|
|
266
|
-
|
|
286
|
+
|
|
267
287
|
.mask {
|
|
268
288
|
position: absolute;
|
|
269
289
|
top: 0px;
|