rb-document-form-constructor 0.0.2 → 0.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/rb-document-form-constructor.esm.js +236 -56
- package/dist/rb-document-form-constructor.min.js +2 -2
- package/dist/rb-document-form-constructor.ssr.js +225 -56
- package/dist/scss/_variables.scss +2 -0
- package/dist/scss/components/_doc-form.scss +32 -0
- package/dist/scss/components.scss +3 -0
- package/package.json +1 -1
- package/src/components/DocForm.vue +43 -0
- package/src/components/DocTemplateConstructor.vue +24 -9
- package/src/components/DocTemplateFacetList.vue +11 -3
- package/src/components/DocTemplateFieldSidebar.vue +8 -2
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
<div class="rb-layout-buttons">
|
|
9
9
|
<b-button pill variant="outline-gray" @click="addSection(1)">
|
|
10
10
|
<rb-text>1 колонка</rb-text>
|
|
11
|
-
<rb-icon icon="
|
|
11
|
+
<rb-icon :icon="iconAdd"></rb-icon>
|
|
12
12
|
</b-button>
|
|
13
13
|
<b-button pill variant="outline-gray" @click="addSection(2)">
|
|
14
14
|
<rb-text>2 колонки</rb-text>
|
|
15
|
-
<rb-icon icon="
|
|
15
|
+
<rb-icon :icon="iconAdd"></rb-icon>
|
|
16
16
|
</b-button>
|
|
17
17
|
<b-button pill variant="outline-gray" @click="addSection(3)">
|
|
18
18
|
<rb-text>3 колонки</rb-text>
|
|
19
|
-
<rb-icon icon="
|
|
19
|
+
<rb-icon :icon="iconAdd"></rb-icon>
|
|
20
20
|
</b-button>
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
<b-card v-for="(section, index) in formConfig.sections" :key="section.labelRu"
|
|
31
31
|
class="rb-form-card" :data-hash="hash">
|
|
32
32
|
<template #header>
|
|
33
|
-
<rb-icon icon="
|
|
33
|
+
<rb-icon :icon="iconDrag"
|
|
34
34
|
class="cursor-pointer rb-row-drag-handle"></rb-icon>
|
|
35
35
|
<rb-text class="flex-fill" @click="editSection(section)">
|
|
36
36
|
{{section.labelRu}}
|
|
37
37
|
</rb-text>
|
|
38
38
|
<span class="rb-actions">
|
|
39
|
-
<rb-icon icon="
|
|
39
|
+
<rb-icon :icon="iconEdit" class="cursor-pointer"
|
|
40
40
|
@click="editSection(section)"></rb-icon>
|
|
41
|
-
<rb-icon icon="
|
|
41
|
+
<rb-icon :icon="iconDelete" class="cursor-pointer"
|
|
42
42
|
@click="removeSection(section, index)"></rb-icon>
|
|
43
43
|
</span>
|
|
44
44
|
</template>
|
|
@@ -54,15 +54,15 @@
|
|
|
54
54
|
:animation="200"
|
|
55
55
|
group="fields"
|
|
56
56
|
ghost-class="rb-moving-item"
|
|
57
|
-
handle=".
|
|
57
|
+
handle=".rb-field-drag-handle">
|
|
58
58
|
<b-form-row v-for="field in column.fields" :key="field.name"
|
|
59
59
|
class="cursor-pointer" @click="showProperties(field)">
|
|
60
60
|
<b-col lg="12">
|
|
61
61
|
<b-form-group :label="field.labelRu">
|
|
62
62
|
<template #label>
|
|
63
|
-
<rb-icon icon="
|
|
63
|
+
<rb-icon :icon="iconDrag" class="rb-field-drag-handle"></rb-icon>
|
|
64
64
|
<rb-text>{{field.labelRu}}</rb-text>
|
|
65
|
-
<rb-icon icon="
|
|
65
|
+
<rb-icon :icon="iconDelete"
|
|
66
66
|
@click.prevent="onRemoveField($event, field, column)">
|
|
67
67
|
</rb-icon>
|
|
68
68
|
</template>
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
import DocTemplateFieldSidebar from "@/components/DocTemplateFieldSidebar";
|
|
98
98
|
import DocTemplateSectionModal from "@/components/DocTemplateSectionModal";
|
|
99
99
|
import draggable from 'vuedraggable';
|
|
100
|
+
import {UtFormConfig} from "../utils/UtFormConfig";
|
|
100
101
|
|
|
101
102
|
export default {
|
|
102
103
|
name: 'DocTemplateConstructor',
|
|
@@ -124,6 +125,20 @@
|
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
},
|
|
128
|
+
computed: {
|
|
129
|
+
iconAdd() {
|
|
130
|
+
return UtFormConfig.config.icons.iconAdd;
|
|
131
|
+
},
|
|
132
|
+
iconEdit() {
|
|
133
|
+
return UtFormConfig.config.icons.iconEdit;
|
|
134
|
+
},
|
|
135
|
+
iconDelete() {
|
|
136
|
+
return UtFormConfig.config.icons.iconDelete;
|
|
137
|
+
},
|
|
138
|
+
iconDrag() {
|
|
139
|
+
return UtFormConfig.config.icons.iconDrag;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
127
142
|
methods: {
|
|
128
143
|
showProperties(field) {
|
|
129
144
|
this.sidebarVisible = true;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<div class="rb-facet" v-for="facet in innerFacets" :key="facet.name">
|
|
16
16
|
<h6 class="rb-facet-label d-flex">
|
|
17
17
|
<rb-text class="flex-fill">{{facet.labelRu}}</rb-text>
|
|
18
|
-
<rb-icon :icon="
|
|
18
|
+
<rb-icon :icon="facet.expanded? iconCollapseFacet: iconExpandFacet" class="cursor-pointer"
|
|
19
19
|
@click="facet.expanded = !facet.expanded"></rb-icon>
|
|
20
20
|
</h6>
|
|
21
21
|
|
|
@@ -54,6 +54,14 @@
|
|
|
54
54
|
facetSearchStr: null,
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
+
computed: {
|
|
58
|
+
iconExpandFacet() {
|
|
59
|
+
return UtFormConfig.config.icons.iconExpandFacet;
|
|
60
|
+
},
|
|
61
|
+
iconCollapseFacet() {
|
|
62
|
+
return UtFormConfig.config.icons.iconCollapseFacet;
|
|
63
|
+
},
|
|
64
|
+
},
|
|
57
65
|
watch: {
|
|
58
66
|
facetSearchStr() {
|
|
59
67
|
this.findInFacets(this.facetSearchStr);
|
|
@@ -73,7 +81,7 @@
|
|
|
73
81
|
},
|
|
74
82
|
findInFacets(str) {
|
|
75
83
|
str = str.toLowerCase();
|
|
76
|
-
if(!str || str.length === 0) {
|
|
84
|
+
if (!str || str.length === 0) {
|
|
77
85
|
this.innerFacets = this.allFacets;
|
|
78
86
|
}
|
|
79
87
|
let facets = JSON.parse(JSON.stringify(this.allFacets));
|
|
@@ -81,7 +89,7 @@
|
|
|
81
89
|
let facetFound = false;
|
|
82
90
|
facet.fields = facet.fields.filter(field => {
|
|
83
91
|
let fieldFound = field.labelRu.toLowerCase().indexOf(str) >= 0;
|
|
84
|
-
if(fieldFound) {
|
|
92
|
+
if (fieldFound) {
|
|
85
93
|
facetFound = true;
|
|
86
94
|
}
|
|
87
95
|
return fieldFound;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
v-model="innerVisible">
|
|
4
4
|
<template #header>
|
|
5
5
|
<b-button class="rb-sidebar-close-btn" variant="secondary" @click="hide">
|
|
6
|
-
<rb-icon :icon="innerVisible?
|
|
6
|
+
<rb-icon :icon="innerVisible? iconCloseSidebar: iconOpenSidebar"></rb-icon>
|
|
7
7
|
</b-button>
|
|
8
8
|
<h4>Редактор свойств</h4>
|
|
9
9
|
</template>
|
|
@@ -131,7 +131,13 @@
|
|
|
131
131
|
computed: {
|
|
132
132
|
inputOptions() {
|
|
133
133
|
return this.field ? UtFormConfig.getInputTypes(this.field) : [];
|
|
134
|
-
}
|
|
134
|
+
},
|
|
135
|
+
iconCloseSidebar() {
|
|
136
|
+
return UtFormConfig.config.icons.iconCloseFieldSidebar;
|
|
137
|
+
},
|
|
138
|
+
iconOpenSidebar() {
|
|
139
|
+
return UtFormConfig.config.icons.iconOpenFieldSidebar;
|
|
140
|
+
},
|
|
135
141
|
},
|
|
136
142
|
watch: {
|
|
137
143
|
visible() {
|