@processmaker/screen-builder 2.83.6 → 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 +4289 -4200
- 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/form-avatar.vue +79 -0
- 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);
|
|
@@ -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,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',
|