rb-document-form-constructor 0.4.3 → 0.4.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.
|
@@ -84,8 +84,8 @@ const UtFormConfig = {
|
|
|
84
84
|
|
|
85
85
|
parseFacets(formConfig) {
|
|
86
86
|
let facets = [];
|
|
87
|
-
formConfig.sections.
|
|
88
|
-
section.columns.
|
|
87
|
+
formConfig.sections.forEach(section => {
|
|
88
|
+
section.columns.forEach(c => {
|
|
89
89
|
c.fields.forEach(f => {
|
|
90
90
|
if (facets.indexOf(f.facet) < 0) {
|
|
91
91
|
facets.push(f.facet);
|
|
@@ -5395,18 +5395,18 @@ var DocTemplateSectionModal = __vue_component__$6;
|
|
|
5395
5395
|
* @author owenm <owen23355@gmail.com>
|
|
5396
5396
|
* @license MIT
|
|
5397
5397
|
*/
|
|
5398
|
-
function _typeof(obj) {
|
|
5398
|
+
function _typeof$1(obj) {
|
|
5399
5399
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
5400
|
-
_typeof = function (obj) {
|
|
5400
|
+
_typeof$1 = function (obj) {
|
|
5401
5401
|
return typeof obj;
|
|
5402
5402
|
};
|
|
5403
5403
|
} else {
|
|
5404
|
-
_typeof = function (obj) {
|
|
5404
|
+
_typeof$1 = function (obj) {
|
|
5405
5405
|
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
5406
5406
|
};
|
|
5407
5407
|
}
|
|
5408
5408
|
|
|
5409
|
-
return _typeof(obj);
|
|
5409
|
+
return _typeof$1(obj);
|
|
5410
5410
|
}
|
|
5411
5411
|
|
|
5412
5412
|
function _defineProperty(obj, key, value) {
|
|
@@ -6459,7 +6459,7 @@ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
|
|
|
6459
6459
|
var group = {};
|
|
6460
6460
|
var originalGroup = options.group;
|
|
6461
6461
|
|
|
6462
|
-
if (!originalGroup || _typeof(originalGroup) != 'object') {
|
|
6462
|
+
if (!originalGroup || _typeof$1(originalGroup) != 'object') {
|
|
6463
6463
|
originalGroup = {
|
|
6464
6464
|
name: originalGroup
|
|
6465
6465
|
};
|
|
@@ -11030,6 +11030,24 @@ function v4(options, buf, offset) {
|
|
|
11030
11030
|
return stringify(rnds);
|
|
11031
11031
|
}
|
|
11032
11032
|
|
|
11033
|
+
var toString = Object.prototype.toString;
|
|
11034
|
+
|
|
11035
|
+
var _typeof = function(object) {
|
|
11036
|
+
var type = typeof object;
|
|
11037
|
+
|
|
11038
|
+
if (type === 'undefined') {
|
|
11039
|
+
return 'undefined';
|
|
11040
|
+
}
|
|
11041
|
+
|
|
11042
|
+
if (object) {
|
|
11043
|
+
type = object.constructor.name;
|
|
11044
|
+
} else if (type === 'object') {
|
|
11045
|
+
type = toString.call(object).slice(8, -1);
|
|
11046
|
+
}
|
|
11047
|
+
|
|
11048
|
+
return type.toLowerCase();
|
|
11049
|
+
};
|
|
11050
|
+
|
|
11033
11051
|
//
|
|
11034
11052
|
var script$3 = {
|
|
11035
11053
|
name: 'DocForm',
|
|
@@ -11046,6 +11064,10 @@ var script$3 = {
|
|
|
11046
11064
|
refSuffix: {
|
|
11047
11065
|
type: String,
|
|
11048
11066
|
default: 'Id'
|
|
11067
|
+
},
|
|
11068
|
+
editable: {
|
|
11069
|
+
type: Boolean,
|
|
11070
|
+
default: true
|
|
11049
11071
|
}
|
|
11050
11072
|
},
|
|
11051
11073
|
|
|
@@ -11118,7 +11140,15 @@ var script$3 = {
|
|
|
11118
11140
|
this.formConfig.sections.forEach(r => {
|
|
11119
11141
|
r.columns.forEach(c => {
|
|
11120
11142
|
c.fields.forEach(f => {
|
|
11121
|
-
|
|
11143
|
+
let defValue = null;
|
|
11144
|
+
|
|
11145
|
+
if (this.defaultValue && _typeof(f.defaultValue) === 'function') {
|
|
11146
|
+
defValue = f.defaultValue();
|
|
11147
|
+
} else {
|
|
11148
|
+
defValue = this.defaultValue == null ? null : f.defaultValue;
|
|
11149
|
+
}
|
|
11150
|
+
|
|
11151
|
+
this.$set(this.doc, f.name, f.defaultValue = defValue);
|
|
11122
11152
|
});
|
|
11123
11153
|
});
|
|
11124
11154
|
});
|
|
@@ -11138,7 +11168,7 @@ var __vue_render__$3 = function () {
|
|
|
11138
11168
|
|
|
11139
11169
|
var _c = _vm._self._c || _h;
|
|
11140
11170
|
|
|
11141
|
-
return _c('b-form', {
|
|
11171
|
+
return _vm.formConfig ? _c('b-form', {
|
|
11142
11172
|
staticClass: "rb-doc-form"
|
|
11143
11173
|
}, _vm._l(_vm.formConfig.sections, function (section) {
|
|
11144
11174
|
return _vm.formConfig && _vm.formConfig.sections ? _c('div', {
|
|
@@ -11168,7 +11198,7 @@ var __vue_render__$3 = function () {
|
|
|
11168
11198
|
refInFor: true,
|
|
11169
11199
|
tag: "component",
|
|
11170
11200
|
attrs: {
|
|
11171
|
-
"disabled": !field.editable,
|
|
11201
|
+
"disabled": !_vm.editable || !field.editable,
|
|
11172
11202
|
"state": _vm.validationState[field.name]
|
|
11173
11203
|
},
|
|
11174
11204
|
on: {
|
|
@@ -11192,7 +11222,7 @@ var __vue_render__$3 = function () {
|
|
|
11192
11222
|
}, 'component', field.input.propsData, false)), _vm._v(" "), !_vm.validationState[field.name] ? _c('b-form-invalid-feedback', [_vm._v("\n " + _vm._s(_vm.validationState[field.name + "__feedback"]) + "\n ")]) : _vm._e()], 1)], 1)], 1) : _vm._e()];
|
|
11193
11223
|
})], 2);
|
|
11194
11224
|
}), 0)]) : _vm._e();
|
|
11195
|
-
}), 0);
|
|
11225
|
+
}), 0) : _vm._e();
|
|
11196
11226
|
};
|
|
11197
11227
|
|
|
11198
11228
|
var __vue_staticRenderFns__$3 = [];
|
|
@@ -12235,22 +12265,15 @@ var script = {
|
|
|
12235
12265
|
|
|
12236
12266
|
multipleFieldAreOnFormConfig(field) {
|
|
12237
12267
|
let count = 0;
|
|
12238
|
-
this.formConfig.sections.
|
|
12239
|
-
|
|
12268
|
+
this.formConfig.sections.forEach(s => {
|
|
12269
|
+
s.columns.forEach(c => {
|
|
12240
12270
|
c.fields.forEach(f => {
|
|
12241
12271
|
if (f.name === field.name) {
|
|
12242
12272
|
count++;
|
|
12273
|
+
F;
|
|
12243
12274
|
}
|
|
12244
12275
|
});
|
|
12245
|
-
|
|
12246
|
-
if (count > 1) {
|
|
12247
|
-
return false;
|
|
12248
|
-
}
|
|
12249
12276
|
});
|
|
12250
|
-
|
|
12251
|
-
if (count > 1) {
|
|
12252
|
-
return false;
|
|
12253
|
-
}
|
|
12254
12277
|
});
|
|
12255
12278
|
return count > 1;
|
|
12256
12279
|
},
|