@processmaker/screen-builder 3.0.4 → 3.0.6
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 +62 -40
- package/dist/vue-form-builder.es.js.map +1 -1
- package/dist/vue-form-builder.umd.js +41 -41
- package/dist/vue-form-builder.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/editor/loop.vue +2 -2
- package/src/components/editor/multi-column.vue +2 -2
- package/src/components/inspector/collection-records-list.vue +25 -10
- package/src/components/inspector/options-list.vue +1 -1
- package/src/components/renderer/form-collection-record-control.vue +11 -7
- package/src/components/renderer/form-list-table.vue +2 -2
- package/src/components/renderer/form-new-request.vue +1 -1
- package/src/components/renderer/form-record-list.vue +16 -14
- package/src/components/renderer/form-requests.vue +1 -1
- package/src/components/screen-renderer.vue +1 -1
- package/src/components/vue-form-builder.vue +4 -8
- package/src/components/vue-form-renderer.vue +1 -1
- package/src/form-builder-controls.js +9 -0
- package/src/mixins/HasColorProperty.js +1 -0
package/package.json
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
</button>
|
|
63
63
|
<button
|
|
64
64
|
v-if="!(isAiSection(element) && aiPreview(element))"
|
|
65
|
-
class="btn btn-sm btn-
|
|
65
|
+
class="btn btn-sm btn-primary mr-2"
|
|
66
66
|
:title="$t('Copy Control')"
|
|
67
67
|
@click="duplicateItem(index)"
|
|
68
68
|
>
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
@removeFromClipboard="removeFromClipboard(items[index])"
|
|
129
129
|
/>
|
|
130
130
|
<button
|
|
131
|
-
class="btn btn-sm btn-
|
|
131
|
+
class="btn btn-sm btn-primary mr-2"
|
|
132
132
|
:title="$t('Copy Control')"
|
|
133
133
|
@click="duplicateItem(index)"
|
|
134
134
|
>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
</button>
|
|
73
73
|
<button
|
|
74
74
|
v-if="!(isAiSection(element) && aiPreview(element))"
|
|
75
|
-
class="btn btn-sm btn-
|
|
75
|
+
class="btn btn-sm btn-primary mr-2"
|
|
76
76
|
:aria-label="$t('Duplicate')"
|
|
77
77
|
@click="duplicateItem(index, row)"
|
|
78
78
|
>
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
@removeFromClipboard="removeFromClipboard(element)"
|
|
141
141
|
/>
|
|
142
142
|
<button
|
|
143
|
-
class="btn btn-sm btn-
|
|
143
|
+
class="btn btn-sm btn-primary mr-2"
|
|
144
144
|
:title="$t('Copy Control')"
|
|
145
145
|
@click="duplicateItem(index, row)"
|
|
146
146
|
>
|
|
@@ -54,7 +54,8 @@ export default {
|
|
|
54
54
|
dataRecordList: [],
|
|
55
55
|
idCollectionScreenView: null,
|
|
56
56
|
idCollectionScreenEdit: null,
|
|
57
|
-
screenMode: null
|
|
57
|
+
screenMode: null,
|
|
58
|
+
collectionsMap: {}
|
|
58
59
|
};
|
|
59
60
|
},
|
|
60
61
|
computed: {
|
|
@@ -76,6 +77,7 @@ export default {
|
|
|
76
77
|
},
|
|
77
78
|
collectionId: {
|
|
78
79
|
handler() {
|
|
80
|
+
this.updateScreenIds();
|
|
79
81
|
this.getFields();
|
|
80
82
|
}
|
|
81
83
|
},
|
|
@@ -114,17 +116,20 @@ export default {
|
|
|
114
116
|
},
|
|
115
117
|
getCollections() {
|
|
116
118
|
this.$dataProvider.getCollections().then((response) => {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
this.collectionsMap = response.data.data.reduce((acc, collection) => {
|
|
120
|
+
acc[collection.id] = {
|
|
121
|
+
read_screen_id: collection.read_screen_id,
|
|
122
|
+
create_screen_id: collection.create_screen_id
|
|
123
|
+
};
|
|
124
|
+
return acc;
|
|
125
|
+
}, {});
|
|
126
|
+
|
|
120
127
|
this.collections = [
|
|
121
128
|
{ value: null, text: this.$t("Select a collection") },
|
|
122
|
-
...response.data.data.map((collection) => {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
};
|
|
127
|
-
})
|
|
129
|
+
...response.data.data.map((collection) => ({
|
|
130
|
+
text: collection.name,
|
|
131
|
+
value: collection.id
|
|
132
|
+
}))
|
|
128
133
|
];
|
|
129
134
|
});
|
|
130
135
|
},
|
|
@@ -155,6 +160,16 @@ export default {
|
|
|
155
160
|
},
|
|
156
161
|
onPmqlChange(pmql) {
|
|
157
162
|
this.pmql = pmql;
|
|
163
|
+
},
|
|
164
|
+
updateScreenIds() {
|
|
165
|
+
if (this.collectionId && this.collectionsMap[this.collectionId]) {
|
|
166
|
+
const selectedCollection = this.collectionsMap[this.collectionId];
|
|
167
|
+
this.idCollectionScreenView = selectedCollection.read_screen_id;
|
|
168
|
+
this.idCollectionScreenEdit = selectedCollection.create_screen_id;
|
|
169
|
+
} else {
|
|
170
|
+
this.idCollectionScreenView = null;
|
|
171
|
+
this.idCollectionScreenEdit = null;
|
|
172
|
+
}
|
|
158
173
|
}
|
|
159
174
|
}
|
|
160
175
|
};
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
</div>
|
|
193
193
|
|
|
194
194
|
<div v-if="dataSource === dataSourceValues.dataConnector">
|
|
195
|
-
<div v-if="valueTypeReturned === 'single'">
|
|
195
|
+
<div v-if="valueTypeReturned === 'single' || valueTypeReturned === 'object' && $attrs['screen-type'] === 'conversational'">
|
|
196
196
|
<label for="key">{{ $t('Value') }}</label>
|
|
197
197
|
<mustache-helper/>
|
|
198
198
|
<b-form-input id="key" v-model="key" @change="keyChanged" data-cy="inspector-datasource-value"/>
|
|
@@ -61,7 +61,8 @@ export default {
|
|
|
61
61
|
screenType: "",
|
|
62
62
|
hasMustache: false,
|
|
63
63
|
flagDraft: {},
|
|
64
|
-
taskDraft: {}
|
|
64
|
+
taskDraft: {},
|
|
65
|
+
enableDraft: true
|
|
65
66
|
};
|
|
66
67
|
},
|
|
67
68
|
computed: {
|
|
@@ -167,7 +168,6 @@ export default {
|
|
|
167
168
|
this.selCollectionId = collectionId;
|
|
168
169
|
this.selRecordId = recordId;
|
|
169
170
|
this.selDisplayMode = modeId;
|
|
170
|
-
|
|
171
171
|
this.$dataProvider
|
|
172
172
|
.getCollectionRecordsView(collectionId, recordId)
|
|
173
173
|
.then((response) => {
|
|
@@ -176,22 +176,25 @@ export default {
|
|
|
176
176
|
const viewScreen = response.collection.read_screen_id;
|
|
177
177
|
const editScreen = response.collection.update_screen_id;
|
|
178
178
|
//Choose screen id regarding of the display Mode
|
|
179
|
-
this.screenCollectionId =
|
|
180
|
-
this.selDisplayMode ===
|
|
181
|
-
|
|
179
|
+
this.screenCollectionId =
|
|
180
|
+
typeof this.selDisplayMode === 'function' ?
|
|
181
|
+
(this.collectionmode.modeId === "View" ? viewScreen : editScreen) :
|
|
182
|
+
(this.selDisplayMode === "View" ? viewScreen : editScreen);
|
|
182
183
|
this.loadScreen(this.screenCollectionId);
|
|
183
184
|
|
|
184
185
|
//This section validates if Collection has draft data
|
|
185
|
-
if(this.taskDraft?.draft?.data == null || this.taskDraft.draft.data === '')
|
|
186
|
+
if (this.taskDraft?.draft?.data == null || this.taskDraft.draft.data === '' || !this.enableDraft)
|
|
187
|
+
{
|
|
186
188
|
this.localData = respData;
|
|
187
189
|
}else{
|
|
188
190
|
this.localData = _.merge({}, respData, this.taskDraft.draft.data);
|
|
189
191
|
}
|
|
190
|
-
|
|
192
|
+
|
|
191
193
|
})
|
|
192
194
|
.catch(() => {
|
|
193
195
|
this.localData = {};
|
|
194
196
|
globalObject.ProcessMaker.alert(this.$t('This content does not exist. We could not locate indicated data'), "danger");
|
|
197
|
+
this.placeholder = "Select a collection";
|
|
195
198
|
});;
|
|
196
199
|
},
|
|
197
200
|
isMustache(record) {
|
|
@@ -213,6 +216,7 @@ export default {
|
|
|
213
216
|
},
|
|
214
217
|
record(record) {
|
|
215
218
|
this.hasMustache = false;
|
|
219
|
+
this.enableDraft = false;
|
|
216
220
|
if (record && !isNaN(record) && record > 0 && this.collection.collectionId) {
|
|
217
221
|
this.selRecordId = record;
|
|
218
222
|
this.loadRecordCollection(this.collection.collectionId, record, this.selDisplayMode);
|
|
@@ -160,12 +160,12 @@ export default {
|
|
|
160
160
|
},
|
|
161
161
|
watch: {
|
|
162
162
|
listOption() {
|
|
163
|
-
this.title = this.checkTitle(this.listOption);
|
|
163
|
+
this.title = this.$t(this.checkTitle(this.listOption));
|
|
164
164
|
this.dataControl = {};
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
167
|
mounted() {
|
|
168
|
-
this.title = this.checkTitle(this.listOption);
|
|
168
|
+
this.title = this.$t(this.checkTitle(this.listOption));
|
|
169
169
|
},
|
|
170
170
|
methods: {
|
|
171
171
|
/**
|
|
@@ -431,20 +431,22 @@ export default {
|
|
|
431
431
|
}
|
|
432
432
|
|
|
433
433
|
// Adds radio buttons or checkbox to the table depending selected option
|
|
434
|
-
if
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
434
|
+
if(this.source?.sourceOptions === "Collection") {
|
|
435
|
+
if (['single-field', 'single-record'].includes(this.source?.dataSelectionOptions)) {
|
|
436
|
+
fields.unshift({
|
|
437
|
+
key: 'radio',
|
|
438
|
+
label: '',
|
|
439
|
+
sortable: false,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
if (this.source?.dataSelectionOptions === 'multiple-records') {
|
|
444
|
+
fields.unshift({
|
|
445
|
+
key: 'checkbox',
|
|
446
|
+
label: '',
|
|
447
|
+
sortable: false
|
|
448
|
+
});
|
|
449
|
+
}
|
|
448
450
|
}
|
|
449
451
|
|
|
450
452
|
return fields;
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
<button
|
|
235
235
|
v-if="!(isAiSection(element) && aiPreview(element))"
|
|
236
236
|
data-test="copy-control-btn"
|
|
237
|
-
class="btn btn-sm btn-
|
|
237
|
+
class="btn btn-sm btn-primary mr-2"
|
|
238
238
|
:title="$t('Copy Control')"
|
|
239
239
|
@click="duplicateItem(index)"
|
|
240
240
|
>
|
|
@@ -255,9 +255,7 @@
|
|
|
255
255
|
v-model="element.items"
|
|
256
256
|
:validation-errors="validationErrors"
|
|
257
257
|
class="card-body"
|
|
258
|
-
:class="
|
|
259
|
-
? elementCssClassModern(element)
|
|
260
|
-
: elementCssClass(element)"
|
|
258
|
+
:class="elementCssClass(element)"
|
|
261
259
|
:selected="selected"
|
|
262
260
|
:config="element.config"
|
|
263
261
|
:ai-element="element"
|
|
@@ -300,7 +298,7 @@
|
|
|
300
298
|
@removeFromClipboard="removeFromClipboard(extendedPages[tabPage].items[index])"
|
|
301
299
|
/>
|
|
302
300
|
<button
|
|
303
|
-
class="btn btn-sm btn-
|
|
301
|
+
class="btn btn-sm btn-primary mr-2"
|
|
304
302
|
:title="$t('Copy Control')"
|
|
305
303
|
@click="duplicateItem(index)"
|
|
306
304
|
>
|
|
@@ -321,9 +319,7 @@
|
|
|
321
319
|
:tabindex="element.config.interactive ? 0 : -1"
|
|
322
320
|
class="card-body m-0 pb-4 pt-4"
|
|
323
321
|
:class="[
|
|
324
|
-
|
|
325
|
-
? elementCssClassModern(element)
|
|
326
|
-
: elementCssClass(element),
|
|
322
|
+
elementCssClass(element),
|
|
327
323
|
{ 'prevent-interaction': !element.config.interactive }
|
|
328
324
|
]"
|
|
329
325
|
:screen-type="screenType"
|
|
@@ -481,6 +481,15 @@ export default [
|
|
|
481
481
|
jsonData: '',
|
|
482
482
|
},
|
|
483
483
|
form: '',
|
|
484
|
+
source: {
|
|
485
|
+
collectionFields: [],
|
|
486
|
+
collectionFieldsColumns: [],
|
|
487
|
+
pmql: null,
|
|
488
|
+
sourceOptions: "Variable",
|
|
489
|
+
variableStore: null,
|
|
490
|
+
dataSelectionOptions: "no-selection",
|
|
491
|
+
singleField: null
|
|
492
|
+
}
|
|
484
493
|
},
|
|
485
494
|
inspector: [
|
|
486
495
|
keyNameProperty,
|
|
@@ -5,6 +5,7 @@ export default {
|
|
|
5
5
|
const css = [];
|
|
6
6
|
element.config.bgcolor ? css.push(element.config.bgcolor) : null;
|
|
7
7
|
element.config.color ? css.push(element.config.color) : null;
|
|
8
|
+
element.config.bgcolormodern ? css.push(element.config.bgcolormodern) : null;
|
|
8
9
|
return css.join(' ');
|
|
9
10
|
},
|
|
10
11
|
elementCssClassModern(element) {
|