rb-document-form-constructor 0.5.1 → 0.5.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rb-document-form-constructor",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "",
5
5
  "main": "dist/rb-document-form-constructor.ssr.js",
6
6
  "browser": "dist/rb-document-form-constructor.esm.js",
@@ -2,7 +2,7 @@
2
2
  <b-form v-if="formConfig" class="rb-doc-form">
3
3
  <div v-for="(section) in formConfig.sections" :key="section.labelRu" v-if="formConfig && formConfig.sections"
4
4
  class="rb-form-section">
5
- <h4>{{section.labelRu}}</h4>
5
+ <h4>{{ section.labelRu }}</h4>
6
6
 
7
7
  <div class="d-flex flex-row">
8
8
  <div class="rb-form-column" v-for="column in section.columns" :key="column.index">
@@ -15,6 +15,7 @@
15
15
  <component v-bind:is="field.input.type"
16
16
  v-model="doc[field.name]"
17
17
  :disabled="!editable || !field.editable"
18
+ :id="field.name"
18
19
  :state="validationState[field.name]"
19
20
  :ref="field.name"
20
21
  @input="onEventFired('input', $event, field)"
@@ -22,8 +23,8 @@
22
23
  @click="onEventFired('click', $event, field)"
23
24
  v-bind="field.input.propsData"></component>
24
25
  <template #label>
25
- {{field.labelRu}} <span v-if="showRequiredInLabel && field.required"
26
- class="text-danger">*</span>
26
+ {{ field.labelRu }} <span v-if="showRequiredInLabel && field.required"
27
+ class="text-danger">*</span>
27
28
  </template>
28
29
  </b-form-group>
29
30
  </b-col>
@@ -89,12 +90,12 @@
89
90
  isValueEmpty(fieldName) {
90
91
  console.info('isValueEmpty', fieldName, this.doc[fieldName]);
91
92
 
92
- if(this.doc[fieldName] == null) {
93
+ if (this.doc[fieldName] == null) {
93
94
  console.info(`${fieldName} is empty`);
94
95
  return true;
95
96
  }
96
97
 
97
- if(typeOf(this.doc[fieldName] === 'string') && this.doc[fieldName] === '') {
98
+ if (typeOf(this.doc[fieldName] === 'string') && this.doc[fieldName] === '') {
98
99
  console.info(`${fieldName} is empty`);
99
100
  return true;
100
101
  }
@@ -33,7 +33,7 @@
33
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
- {{section.labelRu}}
36
+ {{ section.labelRu }}
37
37
  </rb-text>
38
38
  <span class="rb-actions">
39
39
  <rb-icon :icon="iconEdit" class="cursor-pointer"
@@ -61,12 +61,13 @@
61
61
  <b-form-group :label="field.labelRu">
62
62
  <template #label>
63
63
  <rb-icon :icon="iconDrag" class="rb-field-drag-handle"></rb-icon>
64
- <rb-text>{{field.labelRu}}</rb-text>
64
+ <rb-text>{{ field.labelRu }}</rb-text>
65
65
  <rb-icon :icon="iconDelete" class="rb-remove-field"
66
66
  @click.prevent="onRemoveField($event, field, column)">
67
67
  </rb-icon>
68
68
  </template>
69
69
  <component v-bind:is="field.input.type"
70
+ :id="field.name"
70
71
  v-if="field.input"
71
72
  v-bind="getFieldExtendedPropsData(field)"
72
73
  disabled
@@ -15,7 +15,7 @@
15
15
  <div class="rb-facet" v-for="facet in innerFacets"
16
16
  :key="facet.name" v-if="facet.fields.length > 0">
17
17
  <h6 class="rb-facet-label d-flex cursor-pointer" @click="facet.expanded = !facet.expanded">
18
- <rb-text class="flex-fill">{{facet.labelRu}}</rb-text>
18
+ <rb-text class="flex-fill">{{ facet.labelRu }}</rb-text>
19
19
  <rb-icon :icon="facet.expanded? iconCollapseFacet: iconExpandFacet"></rb-icon>
20
20
  </h6>
21
21
 
@@ -27,9 +27,10 @@
27
27
  @end="onFieldMoveEnd($event)"
28
28
  ghost-class="rb-facet-field-moving">
29
29
  <b-list-group-item v-for="field in facet.fields"
30
+ :id="field.name + 'Sidebar'"
30
31
  :key="field.name"
31
32
  class="cursor-pointer">
32
- <rb-text>{{field.labelRu}}</rb-text>
33
+ <rb-text>{{ field.labelRu }}</rb-text>
33
34
  </b-list-group-item>
34
35
  </draggable>
35
36
  </b-list-group>
@@ -102,7 +103,7 @@
102
103
  },
103
104
  handleFacetsProp() {
104
105
  let innerFacets = this.facets.map(f => ({...f, expanded: false}));
105
- if(innerFacets) {
106
+ if (innerFacets) {
106
107
  innerFacets.forEach(facet => {
107
108
  facet.fields = facet.fields.filter(field => !field.hiddenOnFormConfig);
108
109
  })