@processmaker/screen-builder 2.83.5 → 2.83.7
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 +4310 -4231
- package/dist/vue-form-builder.es.js.map +1 -1
- package/dist/vue-form-builder.umd.js +37 -37
- package/dist/vue-form-builder.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/index.js +2 -0
- package/src/components/renderer/card.vue +105 -43
- package/src/components/renderer/form-avatar.vue +79 -0
- package/src/components/renderer/form-list-table.vue +1 -0
- package/src/components/renderer/form-new-request.vue +11 -54
- package/src/components/renderer/index.js +1 -0
- package/src/form-builder-controls.js +45 -0
package/package.json
CHANGED
package/src/components/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import ScreenRenderer from "./screen-renderer.vue";
|
|
|
16
16
|
import AddLoopRow from "./renderer/add-loop-row.vue";
|
|
17
17
|
import FormRecordList from "./renderer/form-record-list.vue";
|
|
18
18
|
import FormImage from "./renderer/form-image.vue";
|
|
19
|
+
import FormAvatar from "./renderer/form-avatar.vue";
|
|
19
20
|
import "@processmaker/vue-form-elements/dist/vue-form-elements.css";
|
|
20
21
|
import FormButton from "./renderer/form-button.vue";
|
|
21
22
|
import FileUpload from "./renderer/file-upload.vue";
|
|
@@ -136,6 +137,7 @@ export default {
|
|
|
136
137
|
// Register the builder and renderer
|
|
137
138
|
Vue.component("AddLoopRow", AddLoopRow);
|
|
138
139
|
Vue.component("FormImage", FormImage);
|
|
140
|
+
Vue.component("FormAvatar", FormAvatar);
|
|
139
141
|
Vue.component("FormLoop", FormLoop);
|
|
140
142
|
Vue.component("FormMultiColumn", FormMultiColumn);
|
|
141
143
|
Vue.component("FormNestedScreen", FormNestedScreen);
|
|
@@ -1,43 +1,49 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
4
|
-
<div class="card-
|
|
5
|
-
<div class="
|
|
6
|
-
<div
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<template v-for="event in emptyStartEvents">
|
|
4
|
+
<div :key="event.id" class="mb-3 card-request">
|
|
5
|
+
<div class="card-body">
|
|
6
|
+
<div class="d-flex justify-content-between">
|
|
7
|
+
<div>
|
|
8
|
+
<span v-uni-id="event.id.toString()" class="card-info card-title">
|
|
9
|
+
{{ transformedName }}
|
|
10
|
+
</span>
|
|
11
|
+
<span class="card-info">
|
|
12
|
+
{{ event.name }}
|
|
13
|
+
</span>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="d-flex align-items-center">
|
|
16
|
+
<button
|
|
17
|
+
:aria-expanded="ariaExpanded"
|
|
18
|
+
:aria-controls="getComputedId(process, event)"
|
|
19
|
+
class="btn btn-ellipsis btn-sm mr-1"
|
|
20
|
+
@click="showRequestDetails(process, event)"
|
|
21
|
+
>
|
|
22
|
+
<i class="fas fa-ellipsis-v"></i>
|
|
23
|
+
</button>
|
|
24
|
+
<button
|
|
25
|
+
v-uni-aria-describedby="event.id.toString()"
|
|
26
|
+
:href="getNewRequestLinkHref(process, event)"
|
|
27
|
+
class="btn btn-custom btn-sm"
|
|
28
|
+
@click.prevent="newRequestLink(process, event)"
|
|
29
|
+
>
|
|
30
|
+
{{ $t("Start") }}
|
|
31
|
+
<i class="fas fa-play mr-1 card-icon"></i>
|
|
32
|
+
</button>
|
|
33
|
+
</div>
|
|
19
34
|
</div>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
<div
|
|
32
|
-
v-if="showdetail"
|
|
33
|
-
:id="getComputedId(process)"
|
|
34
|
-
:aria-hidden="ariaHidden"
|
|
35
|
-
>
|
|
36
|
-
<hr />
|
|
37
|
-
<p class="card-text text-muted">{{ process.description }}</p>
|
|
35
|
+
<b-collapse
|
|
36
|
+
:id="getComputedId(process, event)"
|
|
37
|
+
:aria-hidden="ariaHidden"
|
|
38
|
+
>
|
|
39
|
+
<hr />
|
|
40
|
+
<p class="card-text text-muted card-description">
|
|
41
|
+
{{ process.description }}
|
|
42
|
+
</p>
|
|
43
|
+
</b-collapse>
|
|
38
44
|
</div>
|
|
39
45
|
</div>
|
|
40
|
-
</
|
|
46
|
+
</template>
|
|
41
47
|
</div>
|
|
42
48
|
</template>
|
|
43
49
|
|
|
@@ -116,7 +122,7 @@ export default {
|
|
|
116
122
|
this.spin = 0;
|
|
117
123
|
const instance = response.data;
|
|
118
124
|
this.$cookies.set("fromTriggerStartEvent", true, "1min");
|
|
119
|
-
window.location = `/requests/${instance.id}?
|
|
125
|
+
window.location = `/requests/${instance.id}?fromTriggerStartEvent=`;
|
|
120
126
|
})
|
|
121
127
|
.catch((err) => {
|
|
122
128
|
this.disabled = false;
|
|
@@ -126,29 +132,85 @@ export default {
|
|
|
126
132
|
}
|
|
127
133
|
});
|
|
128
134
|
},
|
|
129
|
-
showRequestDetails(
|
|
135
|
+
showRequestDetails(process, event) {
|
|
130
136
|
if (this.showdetail === false) {
|
|
131
137
|
this.showdetail = true;
|
|
132
138
|
} else {
|
|
133
139
|
this.showdetail = false;
|
|
134
140
|
}
|
|
141
|
+
this.$root.$emit(
|
|
142
|
+
"bv::toggle::collapse",
|
|
143
|
+
this.getComputedId(process, event)
|
|
144
|
+
);
|
|
135
145
|
},
|
|
136
146
|
getNewRequestLinkHref(process, event) {
|
|
137
147
|
const { id } = process;
|
|
138
148
|
const startEventId = event.id;
|
|
139
149
|
return `/process_events/${id}?event=${startEventId}`;
|
|
140
150
|
},
|
|
141
|
-
getComputedId(process) {
|
|
142
|
-
return `process-${process.id}`;
|
|
151
|
+
getComputedId(process, event) {
|
|
152
|
+
return `process-${process.id}-${event.id}`;
|
|
143
153
|
}
|
|
144
154
|
}
|
|
145
155
|
};
|
|
146
156
|
</script>
|
|
147
157
|
|
|
148
158
|
<style scoped>
|
|
159
|
+
.btn-custom {
|
|
160
|
+
border-radius: 4px;
|
|
161
|
+
border: 1px solid #eceff3;
|
|
162
|
+
background: #e8f0f9;
|
|
163
|
+
display: flex;
|
|
164
|
+
height: 28px;
|
|
165
|
+
padding: 4px 9px;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
align-items: inherit;
|
|
168
|
+
gap: 6px;
|
|
169
|
+
color: #1572c2;
|
|
170
|
+
font-size: 14px;
|
|
171
|
+
font-weight: 600;
|
|
172
|
+
}
|
|
173
|
+
.btn-ellipsis {
|
|
174
|
+
background: #fff;
|
|
175
|
+
height: 28px;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
align-items: center;
|
|
178
|
+
color: #1572c2;
|
|
179
|
+
font-size: 14px;
|
|
180
|
+
}
|
|
181
|
+
.btn-ellipsis:hover {
|
|
182
|
+
border-radius: 4px;
|
|
183
|
+
background: #e8f0f9;
|
|
184
|
+
}
|
|
149
185
|
.card-request {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
186
|
+
display: flex;
|
|
187
|
+
justify-content: space-between;
|
|
188
|
+
align-items: center;
|
|
189
|
+
border-radius: 8px;
|
|
190
|
+
border: 1px solid #cdddee;
|
|
191
|
+
background: #fff;
|
|
192
|
+
}
|
|
193
|
+
.card-info {
|
|
194
|
+
-webkit-line-clamp: 1;
|
|
195
|
+
display: -webkit-box;
|
|
196
|
+
-webkit-box-orient: vertical;
|
|
197
|
+
overflow: hidden;
|
|
198
|
+
}
|
|
199
|
+
.card-description {
|
|
200
|
+
-webkit-line-clamp: 2;
|
|
201
|
+
display: -webkit-box;
|
|
202
|
+
-webkit-box-orient: vertical;
|
|
203
|
+
overflow: hidden;
|
|
204
|
+
}
|
|
205
|
+
.card-title {
|
|
206
|
+
font-weight: 700;
|
|
207
|
+
}
|
|
208
|
+
.card-icon {
|
|
209
|
+
display: flex;
|
|
210
|
+
padding: 2px 1px 0px 0px;
|
|
211
|
+
justify-content: center;
|
|
212
|
+
align-items: center;
|
|
213
|
+
gap: 10px;
|
|
214
|
+
font-size: 7px;
|
|
153
215
|
}
|
|
154
216
|
</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span>
|
|
3
|
+
<b-button
|
|
4
|
+
:variant="variant()"
|
|
5
|
+
class="avatar-button rounded-circle overflow-hidden p-0 m-0 d-inline-flex border-0"
|
|
6
|
+
:style="styleAvatar()"
|
|
7
|
+
disabled
|
|
8
|
+
>
|
|
9
|
+
<img
|
|
10
|
+
v-if="user.avatar"
|
|
11
|
+
:src="user.avatar"
|
|
12
|
+
:width="width"
|
|
13
|
+
:height="height"
|
|
14
|
+
:class="image"
|
|
15
|
+
:alt="user.fullname"
|
|
16
|
+
/>
|
|
17
|
+
<span
|
|
18
|
+
v-else
|
|
19
|
+
class="border-0 d-inline-flex align-items-center justify-content-center text-white text-uppercase text-nowrap font-weight-normal"
|
|
20
|
+
:style="styleAvatar()"
|
|
21
|
+
>
|
|
22
|
+
<span v-if="getInitials()">{{ getInitials() }}</span>
|
|
23
|
+
<span v-else>PM</span>
|
|
24
|
+
</span>
|
|
25
|
+
</b-button>
|
|
26
|
+
</span>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
export default {
|
|
31
|
+
props: {
|
|
32
|
+
width: {
|
|
33
|
+
default: 64,
|
|
34
|
+
},
|
|
35
|
+
height: {
|
|
36
|
+
default: 64,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
user: window.Processmaker.user,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
mounted() {
|
|
46
|
+
this.getInitials();
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
getInitials() {
|
|
50
|
+
return this.user.firstname && this.user.lastname
|
|
51
|
+
? this.user.firstname.match(/./u)[0] + this.user.lastname.match(/./u)[0]
|
|
52
|
+
: "";
|
|
53
|
+
},
|
|
54
|
+
variant() {
|
|
55
|
+
return this.user.avatar ? 'secondary' : 'info';
|
|
56
|
+
},
|
|
57
|
+
styleAvatar() {
|
|
58
|
+
return "width: " +
|
|
59
|
+
this.width +
|
|
60
|
+
"px; height: " +
|
|
61
|
+
this.height +
|
|
62
|
+
"px; font-size:" +
|
|
63
|
+
this.height / 2.5 +
|
|
64
|
+
"px; padding:0;";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style lang="scss" scoped>
|
|
71
|
+
.avatar-button:disabled {
|
|
72
|
+
opacity: 1;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
}
|
|
75
|
+
.empty-image {
|
|
76
|
+
font-size: 2em;
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
79
|
+
|
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<div v-if="Object.keys(processes).length && !loading" class="process-list">
|
|
4
|
-
<
|
|
5
|
-
v-for="(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<ProcessCard
|
|
14
|
-
v-if="hasEmptyStartEvents(process)"
|
|
15
|
-
:filter="filter"
|
|
16
|
-
:process="process"
|
|
17
|
-
/>
|
|
18
|
-
</b-col>
|
|
19
|
-
</template>
|
|
20
|
-
</b-card-group>
|
|
21
|
-
</b-container>
|
|
22
|
-
</div>
|
|
4
|
+
<b-container fluid>
|
|
5
|
+
<div v-for="(process, index) in processes" :key="`process-${index}`">
|
|
6
|
+
<ProcessCard
|
|
7
|
+
v-if="hasEmptyStartEvents(process)"
|
|
8
|
+
:filter="filter"
|
|
9
|
+
:process="process"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
</b-container>
|
|
23
13
|
</div>
|
|
24
14
|
<div v-else>
|
|
25
15
|
<formEmpty link="" title="No Request to Start" url="" />
|
|
@@ -61,51 +51,18 @@ export default {
|
|
|
61
51
|
.get(
|
|
62
52
|
`start_processes?page=${this.page}&per_page=${this.perPage}&filter=${this.filter}&order_by=category.name,name` +
|
|
63
53
|
"&order_direction=asc,asc" +
|
|
64
|
-
"&include=events
|
|
54
|
+
"&include=events" +
|
|
65
55
|
"&without_event_definitions=true"
|
|
66
56
|
)
|
|
67
57
|
.then((response) => {
|
|
68
58
|
const { data } = response;
|
|
69
|
-
|
|
70
|
-
this.processes = {};
|
|
71
|
-
// Now populate our processes array with data for rendering
|
|
72
|
-
this.populate(data.data);
|
|
73
|
-
// Do initial filter
|
|
74
|
-
// Set data in paginate
|
|
75
|
-
data.meta.from -= 1;
|
|
76
|
-
this.$refs.listProcess.data = data;
|
|
77
|
-
this.$refs.listProcess.setPaginationData(data.meta);
|
|
78
|
-
const dataControls = {
|
|
79
|
-
count: "0",
|
|
80
|
-
showControl: true,
|
|
81
|
-
showAvatar: false,
|
|
82
|
-
colorTextStart: "color: #57646F",
|
|
83
|
-
url: ""
|
|
84
|
-
};
|
|
85
|
-
const tasksDropdown = [];
|
|
86
|
-
this.$emit("startControl", { dataControls, tasksDropdown });
|
|
59
|
+
this.processes = data.data;
|
|
87
60
|
})
|
|
88
61
|
.catch(() => {
|
|
89
62
|
this.error = true;
|
|
90
63
|
});
|
|
91
64
|
});
|
|
92
65
|
},
|
|
93
|
-
populate(data) {
|
|
94
|
-
// Each element in data represents an individual process
|
|
95
|
-
// We need to pull out the category name, and if it's available in our processes, append it there
|
|
96
|
-
// if not, create the category in our processes array and then append it
|
|
97
|
-
for (const process of data) {
|
|
98
|
-
for (const category of process.categories) {
|
|
99
|
-
// Now determine if we have it defined in our processes list
|
|
100
|
-
if (typeof this.processes[category.name] === "undefined") {
|
|
101
|
-
// Create it
|
|
102
|
-
this.processes[category.name] = [];
|
|
103
|
-
}
|
|
104
|
-
// Now append
|
|
105
|
-
this.processes[category.name].push(process);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
66
|
fetchData(value) {
|
|
110
67
|
this.filter = value;
|
|
111
68
|
this.fetch();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as AddLoopRow } from "./add-loop-row.vue";
|
|
2
2
|
export { default as FileDownload } from "./file-download.vue";
|
|
3
3
|
export { default as FileUpload } from "./file-upload.vue";
|
|
4
|
+
export { default as FormAvatar } from "./form-avatar.vue";
|
|
4
5
|
export { default as FormButton } from "./form-button.vue";
|
|
5
6
|
export { default as FormImage } from "./form-image.vue";
|
|
6
7
|
export { default as FormInputMasked } from "./form-masked-input.vue";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import FormText from './components/renderer/form-text';
|
|
2
|
+
import FormAvatar from './components/renderer/form-avatar';
|
|
2
3
|
import FormButton from './components/renderer/form-button';
|
|
3
4
|
import FormMultiColumn from './components/renderer/form-multi-column';
|
|
4
5
|
import FormLoop from './components/renderer/form-loop';
|
|
@@ -580,6 +581,50 @@ export default [
|
|
|
580
581
|
],
|
|
581
582
|
},
|
|
582
583
|
},
|
|
584
|
+
{
|
|
585
|
+
editorComponent: FormAvatar,
|
|
586
|
+
editorBinding: 'FormAvatar',
|
|
587
|
+
rendererComponent: FormAvatar,
|
|
588
|
+
rendererBinding: 'FormAvatar',
|
|
589
|
+
control: {
|
|
590
|
+
popoverContent: "User avatar",
|
|
591
|
+
order: 3.0,
|
|
592
|
+
group: 'Dashboards',
|
|
593
|
+
label: 'User Avatar',
|
|
594
|
+
component: 'FormAvatar',
|
|
595
|
+
'editor-component': 'FormAvatar',
|
|
596
|
+
'editor-control': 'FormAvatar',
|
|
597
|
+
config: {
|
|
598
|
+
label: 'User Avatar',
|
|
599
|
+
icon: 'fas fa-user-circle',
|
|
600
|
+
variant: 'primary',
|
|
601
|
+
event: 'submit',
|
|
602
|
+
name: null,
|
|
603
|
+
value: null,
|
|
604
|
+
renderImage: false,
|
|
605
|
+
},
|
|
606
|
+
inspector: [
|
|
607
|
+
{
|
|
608
|
+
type: 'FormInput',
|
|
609
|
+
field: 'height',
|
|
610
|
+
config: {
|
|
611
|
+
label: 'Height',
|
|
612
|
+
helper: 'Avatar height',
|
|
613
|
+
type: 'number',
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
type: 'FormInput',
|
|
618
|
+
field: 'width',
|
|
619
|
+
config: {
|
|
620
|
+
label: 'Width',
|
|
621
|
+
helper: 'Avatar width',
|
|
622
|
+
type: 'number',
|
|
623
|
+
},
|
|
624
|
+
},
|
|
625
|
+
],
|
|
626
|
+
},
|
|
627
|
+
},
|
|
583
628
|
{
|
|
584
629
|
editorComponent: FormButton,
|
|
585
630
|
editorBinding: 'FormSubmit',
|