rb-document-form-constructor 0.9.13 → 0.9.15

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.
@@ -1,53 +1,42 @@
1
- 'use strict';var Vue=require('vue');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var Vue__default=/*#__PURE__*/_interopDefaultLegacy(Vue);function _iterableToArrayLimit(arr, i) {
2
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
3
- if (null != _i) {
4
- var _s,
5
- _e,
6
- _x,
7
- _r,
8
- _arr = [],
9
- _n = !0,
10
- _d = !1;
11
- try {
12
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
13
- if (Object(_i) !== _i) return;
14
- _n = !1;
15
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
16
- } catch (err) {
17
- _d = !0, _e = err;
18
- } finally {
19
- try {
20
- if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
21
- } finally {
22
- if (_d) throw _e;
23
- }
24
- }
25
- return _arr;
26
- }
27
- }
28
- function ownKeys(object, enumerableOnly) {
1
+ 'use strict';var Vue=require('vue');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var Vue__default=/*#__PURE__*/_interopDefaultLegacy(Vue);function ownKeys(object, enumerableOnly) {
29
2
  var keys = Object.keys(object);
3
+
30
4
  if (Object.getOwnPropertySymbols) {
31
5
  var symbols = Object.getOwnPropertySymbols(object);
32
- enumerableOnly && (symbols = symbols.filter(function (sym) {
33
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
34
- })), keys.push.apply(keys, symbols);
6
+
7
+ if (enumerableOnly) {
8
+ symbols = symbols.filter(function (sym) {
9
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
10
+ });
11
+ }
12
+
13
+ keys.push.apply(keys, symbols);
35
14
  }
15
+
36
16
  return keys;
37
17
  }
18
+
38
19
  function _objectSpread2(target) {
39
20
  for (var i = 1; i < arguments.length; i++) {
40
- var source = null != arguments[i] ? arguments[i] : {};
41
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
42
- _defineProperty$1(target, key, source[key]);
43
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
44
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
45
- });
21
+ var source = arguments[i] != null ? arguments[i] : {};
22
+
23
+ if (i % 2) {
24
+ ownKeys(Object(source), true).forEach(function (key) {
25
+ _defineProperty$1(target, key, source[key]);
26
+ });
27
+ } else if (Object.getOwnPropertyDescriptors) {
28
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
29
+ } else {
30
+ ownKeys(Object(source)).forEach(function (key) {
31
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
32
+ });
33
+ }
46
34
  }
35
+
47
36
  return target;
48
37
  }
38
+
49
39
  function _defineProperty$1(obj, key, value) {
50
- key = _toPropertyKey(key);
51
40
  if (key in obj) {
52
41
  Object.defineProperty(obj, key, {
53
42
  value: value,
@@ -58,14 +47,48 @@ function _defineProperty$1(obj, key, value) {
58
47
  } else {
59
48
  obj[key] = value;
60
49
  }
50
+
61
51
  return obj;
62
52
  }
53
+
63
54
  function _slicedToArray(arr, i) {
64
55
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
65
56
  }
57
+
66
58
  function _arrayWithHoles(arr) {
67
59
  if (Array.isArray(arr)) return arr;
68
60
  }
61
+
62
+ function _iterableToArrayLimit(arr, i) {
63
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
64
+
65
+ if (_i == null) return;
66
+ var _arr = [];
67
+ var _n = true;
68
+ var _d = false;
69
+
70
+ var _s, _e;
71
+
72
+ try {
73
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
74
+ _arr.push(_s.value);
75
+
76
+ if (i && _arr.length === i) break;
77
+ }
78
+ } catch (err) {
79
+ _d = true;
80
+ _e = err;
81
+ } finally {
82
+ try {
83
+ if (!_n && _i["return"] != null) _i["return"]();
84
+ } finally {
85
+ if (_d) throw _e;
86
+ }
87
+ }
88
+
89
+ return _arr;
90
+ }
91
+
69
92
  function _unsupportedIterableToArray(o, minLen) {
70
93
  if (!o) return;
71
94
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -74,32 +97,23 @@ function _unsupportedIterableToArray(o, minLen) {
74
97
  if (n === "Map" || n === "Set") return Array.from(o);
75
98
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
76
99
  }
100
+
77
101
  function _arrayLikeToArray(arr, len) {
78
102
  if (len == null || len > arr.length) len = arr.length;
103
+
79
104
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
105
+
80
106
  return arr2;
81
107
  }
108
+
82
109
  function _nonIterableRest() {
83
110
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
84
- }
85
- function _toPrimitive(input, hint) {
86
- if (typeof input !== "object" || input === null) return input;
87
- var prim = input[Symbol.toPrimitive];
88
- if (prim !== undefined) {
89
- var res = prim.call(input, hint || "default");
90
- if (typeof res !== "object") return res;
91
- throw new TypeError("@@toPrimitive must return a primitive value.");
92
- }
93
- return (hint === "string" ? String : Number)(input);
94
- }
95
- function _toPropertyKey(arg) {
96
- var key = _toPrimitive(arg, "string");
97
- return typeof key === "symbol" ? key : String(key);
98
111
  }var UtFormConfig = {
99
112
  findField: function findField(fieldName, formConfig) {
100
113
  if (!formConfig || !formConfig.sections) {
101
114
  return null;
102
115
  }
116
+
103
117
  var found = null;
104
118
  formConfig.sections.every(function (r) {
105
119
  if (r.columns) {
@@ -109,11 +123,13 @@ function _toPropertyKey(arg) {
109
123
  found = f;
110
124
  }
111
125
  });
126
+
112
127
  if (found) {
113
128
  return false;
114
129
  }
115
130
  });
116
131
  }
132
+
117
133
  if (found) {
118
134
  return false;
119
135
  }
@@ -124,6 +140,7 @@ function _toPropertyKey(arg) {
124
140
  if (!formConfig || !formConfig.sections) {
125
141
  return null;
126
142
  }
143
+
127
144
  var found = null;
128
145
  formConfig.sections.every(function (s) {
129
146
  if (s.columns) {
@@ -136,15 +153,18 @@ function _toPropertyKey(arg) {
136
153
  }
137
154
  });
138
155
  }
156
+
139
157
  if (found) {
140
158
  return false;
141
159
  }
142
160
  });
161
+
143
162
  if (found) {
144
163
  return false;
145
164
  }
146
165
  });
147
166
  }
167
+
148
168
  if (found) {
149
169
  return false;
150
170
  }
@@ -182,19 +202,27 @@ function _toPropertyKey(arg) {
182
202
  };var __clone = function __clone(data) {
183
203
  return JSON.parse(JSON.stringify(data));
184
204
  };
205
+
185
206
  var _assign = function __assign() {
186
207
  _assign = Object.assign || function __assign(t) {
187
208
  for (var s, i = 1, n = arguments.length; i < n; i++) {
188
209
  s = arguments[i];
189
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
210
+
211
+ for (var p in s) {
212
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
213
+ }
190
214
  }
215
+
191
216
  return t;
192
217
  };
218
+
193
219
  return _assign.apply(this, arguments);
194
220
  };
221
+
195
222
  var __mergeInputInMapOfArrays = function __mergeInputInMapOfArrays(inputs, formConfigInputs) {
196
223
  for (var dataType in formConfigInputs) {
197
224
  var foundInputs = inputs[dataType];
225
+
198
226
  if (foundInputs) {
199
227
  __mergeInputsInArray(foundInputs, formConfigInputs[dataType]);
200
228
  } else {
@@ -202,16 +230,19 @@ var __mergeInputInMapOfArrays = function __mergeInputInMapOfArrays(inputs, formC
202
230
  }
203
231
  }
204
232
  };
233
+
205
234
  var __mergeInputsInMap = function __mergeInputsInMap(inputs, formConfigInputs) {
206
235
  for (var name in formConfigInputs) {
207
236
  inputs[name] = _assign(inputs[name] ? inputs[name] : {}, formConfigInputs[name] ? formConfigInputs[name] : {});
208
237
  }
209
238
  };
239
+
210
240
  var __mergeInputsInArray = function __mergeInputsInArray(inputs, formConfigInputs) {
211
241
  formConfigInputs.forEach(function (input) {
212
242
  var index = inputs.findIndex(function (item) {
213
243
  return item.name === input.name;
214
244
  });
245
+
215
246
  if (index >= 0) {
216
247
  inputs[index] = input;
217
248
  } else {
@@ -219,13 +250,16 @@ var __mergeInputsInArray = function __mergeInputsInArray(inputs, formConfigInput
219
250
  }
220
251
  });
221
252
  };
253
+
222
254
  var __applyDefaultProps = function __applyDefaultProps(input, field) {
223
255
  for (var propName in input.props) {
224
256
  if (field) {
225
257
  if (field.input.propsData[propName]) {
226
- var _input$propsData, _input$props;
258
+ var _input$propsData, _input$props, _input$props$type;
259
+
227
260
  input.propsData[propName] = field.input.propsData[propName];
228
- if ((_input$propsData = input.propsData) !== null && _input$propsData !== void 0 && _input$propsData.type && (_input$props = input.props) !== null && _input$props !== void 0 && (_input$props = _input$props.type) !== null && _input$props !== void 0 && _input$props.default) {
261
+
262
+ if ((_input$propsData = input.propsData) !== null && _input$propsData !== void 0 && _input$propsData.type && (_input$props = input.props) !== null && _input$props !== void 0 && (_input$props$type = _input$props.type) !== null && _input$props$type !== void 0 && _input$props$type.default) {
229
263
  input.propsData.type = input.props.type.default;
230
264
  }
231
265
  }
@@ -234,6 +268,7 @@ var __applyDefaultProps = function __applyDefaultProps(input, field) {
234
268
  }
235
269
  }
236
270
  };
271
+
237
272
  var __applyRefProps = function __applyRefProps(input, refConfig) {
238
273
  if (refConfig !== null && refConfig !== void 0 && refConfig.propsData) {
239
274
  for (var propName in refConfig.propsData) {
@@ -241,11 +276,13 @@ var __applyRefProps = function __applyRefProps(input, refConfig) {
241
276
  }
242
277
  }
243
278
  };
279
+
244
280
  var __filterInputsByMultiple = function __filterInputsByMultiple(inputs, multiple) {
245
281
  return inputs.filter(function (i) {
246
282
  return i.multiple && multiple || !i.multiple && !multiple;
247
283
  });
248
284
  };
285
+
249
286
  var fcInputs = {
250
287
  string: {
251
288
  text: 'Текст',
@@ -449,28 +486,36 @@ var UtFormConstructor = {
449
486
  config: {},
450
487
  init: function init(formConfig) {
451
488
  this.config = __clone(baseConfig);
489
+
452
490
  if (formConfig) {
453
491
  if (formConfig.inputs) {
454
492
  __mergeInputsInMap(this.config.inputs, formConfig.inputs);
455
493
  }
494
+
456
495
  if (formConfig.primitiveInputs) {
457
496
  __mergeInputInMapOfArrays(this.config.primitiveInputs, formConfig.primitiveInputs);
458
497
  }
498
+
459
499
  if (formConfig.dictInputs) {
460
500
  __mergeInputsInArray(this.config.dictInputs, formConfig.dictInputs);
461
501
  }
502
+
462
503
  if (formConfig.refInputs) {
463
504
  __mergeInputInMapOfArrays(this.config.refInputs, formConfig.refInputs);
464
505
  }
506
+
465
507
  if (formConfig.refInputConfigs) {
466
508
  this.config.refInputConfigs = formConfig.refInputConfigs;
467
509
  }
510
+
468
511
  if (formConfig.icons) {
469
512
  this.config.icons = _assign(this.config.icons, formConfig.icons);
470
513
  }
514
+
471
515
  if (formConfig.rules) {
472
516
  this.config.rules = formConfig.rules;
473
517
  }
518
+
474
519
  if (formConfig.ruleContext) {
475
520
  this.config.ruleContext = formConfig.ruleContext;
476
521
  }
@@ -478,9 +523,11 @@ var UtFormConstructor = {
478
523
  },
479
524
  getInputTypes: function getInputTypes(field) {
480
525
  var inputs = [];
526
+
481
527
  if (!field) {
482
528
  return inputs;
483
529
  }
530
+
484
531
  if (field.dict && !this.config.refInputs[field.ref]) {
485
532
  inputs = __filterInputsByMultiple(this.config.dictInputs, field.multiple);
486
533
  } else if (field.ref) {
@@ -488,6 +535,7 @@ var UtFormConstructor = {
488
535
  } else {
489
536
  inputs = __filterInputsByMultiple(this.config.primitiveInputs[field.type], field.multiple);
490
537
  }
538
+
491
539
  return inputs;
492
540
  },
493
541
  hasMultipleInputTypes: function hasMultipleInputTypes(field) {
@@ -499,38 +547,49 @@ var UtFormConstructor = {
499
547
  getDefaultInput: function getDefaultInput(field) {
500
548
  var input = null;
501
549
  var inputs = this.getInputTypes(field);
550
+
502
551
  if (!inputs) {
503
552
  input = this.primitiveInputs[0];
504
553
  }
554
+
505
555
  if (field.ref && this.config.refInputs[field.ref]) {
506
556
  input = __clone(inputs[0]);
557
+
507
558
  __applyDefaultProps(input);
559
+
508
560
  if (this.config.refInputConfigs[field.ref] && this.config.refInputConfigs[field.ref][input.name]) {
509
561
  __applyRefProps(input, this.config.refInputConfigs[field.ref][input.name]);
510
562
  }
511
563
  } else if (field.dict) {
512
564
  input = __clone(inputs[0]);
513
565
  input.props.dict.default = field.ref;
566
+
514
567
  __applyDefaultProps(input);
515
568
  } else {
516
569
  input = __clone(inputs[0]);
570
+
517
571
  __applyDefaultProps(input);
518
572
  }
573
+
519
574
  return input;
520
575
  },
521
576
  getInputTypeByName: function getInputTypeByName(name, field) {
522
577
  var input = __clone(this.config.inputs[name]);
578
+
523
579
  if (field.ref && this.config.refInputs[field.ref]) {
524
580
  __applyDefaultProps(input);
581
+
525
582
  if (this.config.refInputConfigs[field.ref] && this.config.refInputConfigs[field.ref][input.name]) {
526
583
  __applyRefProps(input, this.config.refInputConfigs[field.ref][input.name]);
527
584
  }
528
585
  } else if (field.dict) {
529
586
  input.props.dict.default = field.ref;
530
- __applyDefaultProps(input);
587
+
588
+ __applyDefaultProps(input, field);
531
589
  } else {
532
590
  __applyDefaultProps(input, field);
533
591
  }
592
+
534
593
  input.propsData['ref'] = field.name;
535
594
  return input;
536
595
  },
@@ -548,13 +607,17 @@ var UtFormConstructor = {
548
607
  context['Date'] = Date;
549
608
  context['Math'] = Math;
550
609
  var appendScript = '';
610
+
551
611
  for (var v in context) {
552
612
  appendScript = appendScript + "var ".concat(v, " = this.").concat(v, ";\n");
553
613
  }
614
+
554
615
  appendScript = appendScript ? appendScript + '\n' : '';
616
+
555
617
  var func = function func(script) {
556
618
  return eval(script);
557
619
  };
620
+
558
621
  func.call(context, appendScript + script);
559
622
  }
560
623
  };//
@@ -576,7 +639,6 @@ var UtFormConstructor = {
576
639
  //
577
640
  //
578
641
  //
579
-
580
642
  var script$5 = {
581
643
  name: 'DocTemplateSectionModal',
582
644
  props: {
@@ -611,10 +673,13 @@ var script$5 = {
611
673
  methods: {
612
674
  onOk: function onOk() {
613
675
  var _this = this;
676
+
614
677
  this.section = this.label;
678
+
615
679
  if (this.onAfterOk) {
616
680
  this.onAfterOk();
617
681
  }
682
+
618
683
  this.$nextTick(function () {
619
684
  _this.$bvModal.hide(_this.id);
620
685
  });
@@ -700,12 +765,15 @@ var script$5 = {
700
765
  return script;
701
766
  }/* script */
702
767
  var __vue_script__$5 = script$5;
703
-
704
768
  /* template */
769
+
705
770
  var __vue_render__$5 = function __vue_render__() {
706
771
  var _vm = this;
772
+
707
773
  var _h = _vm.$createElement;
774
+
708
775
  var _c = _vm._self._c || _h;
776
+
709
777
  return _c('b-modal', {
710
778
  attrs: {
711
779
  "id": "rb-doc-template-section-modal",
@@ -746,15 +814,19 @@ var __vue_render__$5 = function __vue_render__() {
746
814
  }
747
815
  })], 1)], 1)], 1)], 1)], 1);
748
816
  };
749
- var __vue_staticRenderFns__$5 = [];
750
817
 
818
+ var __vue_staticRenderFns__$5 = [];
751
819
  /* style */
820
+
752
821
  var __vue_inject_styles__$5 = undefined;
753
822
  /* scoped */
823
+
754
824
  var __vue_scope_id__$5 = undefined;
755
825
  /* module identifier */
756
- var __vue_module_identifier__$5 = "data-v-4f837662";
826
+
827
+ var __vue_module_identifier__$5 = "data-v-779f90b2";
757
828
  /* functional template */
829
+
758
830
  var __vue_is_functional_template__$5 = false;
759
831
  /* style inject */
760
832
 
@@ -766,6 +838,7 @@ var __vue_component__$6 = /*#__PURE__*/normalizeComponent({
766
838
  render: __vue_render__$5,
767
839
  staticRenderFns: __vue_staticRenderFns__$5
768
840
  }, __vue_inject_styles__$5, __vue_script__$5, __vue_scope_id__$5, __vue_is_functional_template__$5, __vue_module_identifier__$5, false, undefined, undefined, undefined);
841
+
769
842
  var DocTemplateSectionModal = __vue_component__$6;var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
770
843
 
771
844
  function createCommonjsModule(fn, basedir, module) {
@@ -6195,17 +6268,21 @@ if (typeof window !== "undefined" && "Vue" in window) {
6195
6268
  },
6196
6269
  findInFacets: function findInFacets(str) {
6197
6270
  str = str.toLowerCase();
6271
+
6198
6272
  if (!str || str.length === 0) {
6199
6273
  this.innerFacets = this.allFacets;
6200
6274
  }
6275
+
6201
6276
  var facets = JSON.parse(JSON.stringify(this.allFacets));
6202
6277
  facets = facets.filter(function (facet) {
6203
6278
  var facetFound = false;
6204
6279
  facet.fields = facet.fields.filter(function (field) {
6205
6280
  var fieldFound = field.labelRu.toLowerCase().indexOf(str) >= 0 || field.name.toLowerCase().indexOf(str) >= 0;
6281
+
6206
6282
  if (fieldFound) {
6207
6283
  facetFound = true;
6208
6284
  }
6285
+
6209
6286
  return fieldFound;
6210
6287
  });
6211
6288
  return facetFound;
@@ -6218,6 +6295,7 @@ if (typeof window !== "undefined" && "Vue" in window) {
6218
6295
  expanded: false
6219
6296
  });
6220
6297
  });
6298
+
6221
6299
  if (innerFacets) {
6222
6300
  innerFacets.forEach(function (facet) {
6223
6301
  facet.fields = facet.fields.filter(function (field) {
@@ -6225,6 +6303,7 @@ if (typeof window !== "undefined" && "Vue" in window) {
6225
6303
  });
6226
6304
  });
6227
6305
  }
6306
+
6228
6307
  this.innerFacets = JSON.parse(JSON.stringify(innerFacets));
6229
6308
  this.allFacets = JSON.parse(JSON.stringify(innerFacets));
6230
6309
  }
@@ -6234,12 +6313,15 @@ if (typeof window !== "undefined" && "Vue" in window) {
6234
6313
  }
6235
6314
  };/* script */
6236
6315
  var __vue_script__$4 = script$4;
6237
-
6238
6316
  /* template */
6317
+
6239
6318
  var __vue_render__$4 = function __vue_render__() {
6240
6319
  var _vm = this;
6320
+
6241
6321
  var _h = _vm.$createElement;
6322
+
6242
6323
  var _c = _vm._self._c || _h;
6324
+
6243
6325
  return _c('div', {
6244
6326
  staticClass: "rb-facets-sidebar"
6245
6327
  }, [_vm._ssrNode("<div class=\"d-flex justify-content-between align-items-center\">", "</div>", [_vm._ssrNode("<h4>Компоненты</h4> "), _vm._t("action")], 2), _vm._ssrNode(" "), _c('b-form', [_c('b-form-row', [_c('b-col', {
@@ -6304,15 +6386,19 @@ var __vue_render__$4 = function __vue_render__() {
6304
6386
  }), 1)], 1) : _vm._e()], 2) : _vm._e();
6305
6387
  }), 0)], 2);
6306
6388
  };
6307
- var __vue_staticRenderFns__$4 = [];
6308
6389
 
6390
+ var __vue_staticRenderFns__$4 = [];
6309
6391
  /* style */
6392
+
6310
6393
  var __vue_inject_styles__$4 = undefined;
6311
6394
  /* scoped */
6395
+
6312
6396
  var __vue_scope_id__$4 = undefined;
6313
6397
  /* module identifier */
6314
- var __vue_module_identifier__$4 = "data-v-0746865a";
6398
+
6399
+ var __vue_module_identifier__$4 = "data-v-6cf21488";
6315
6400
  /* functional template */
6401
+
6316
6402
  var __vue_is_functional_template__$4 = false;
6317
6403
  /* style inject */
6318
6404
 
@@ -6324,6 +6410,7 @@ var __vue_component__$5 = /*#__PURE__*/normalizeComponent({
6324
6410
  render: __vue_render__$4,
6325
6411
  staticRenderFns: __vue_staticRenderFns__$4
6326
6412
  }, __vue_inject_styles__$4, __vue_script__$4, __vue_scope_id__$4, __vue_is_functional_template__$4, __vue_module_identifier__$4, false, undefined, undefined, undefined);
6413
+
6327
6414
  var DocTemplateFacetList = __vue_component__$5;var toString = Object.prototype.toString;
6328
6415
 
6329
6416
  var _typeof = function(object) {
@@ -6402,6 +6489,7 @@ var _typeof = function(object) {
6402
6489
  if ((field.dict || field.ref) && !field.multiple) {
6403
6490
  return field.name.substring(0, field.name.length - 2);
6404
6491
  }
6492
+
6405
6493
  return field.name;
6406
6494
  },
6407
6495
  getResolveValue: function getResolveValue(field) {
@@ -6427,14 +6515,18 @@ var _typeof = function(object) {
6427
6515
  },
6428
6516
  getResolveFieldName: function getResolveFieldName(field) {
6429
6517
  var _resolveFieldName;
6518
+
6430
6519
  var resolveFieldName = field === null || field === void 0 ? void 0 : field.name;
6520
+
6431
6521
  if ((_resolveFieldName = resolveFieldName) !== null && _resolveFieldName !== void 0 && _resolveFieldName.endsWith('Id')) {
6432
6522
  resolveFieldName = field.name.substring(0, field.name.length - 2);
6433
6523
  }
6524
+
6434
6525
  return resolveFieldName;
6435
6526
  },
6436
6527
  onEventFired: function onEventFired(eventName, event, field) {
6437
6528
  var _this = this;
6529
+
6438
6530
  if (field.rules) {
6439
6531
  field.rules.forEach(function (rule) {
6440
6532
  if (rule.event === eventName && rule.script) {
@@ -6448,6 +6540,7 @@ var _typeof = function(object) {
6448
6540
  },
6449
6541
  onGlobalEventFired: function onGlobalEventFired(eventName, event) {
6450
6542
  var _this2 = this;
6543
+
6451
6544
  var fields = UtFormConfig.getFields(this.formConfig);
6452
6545
  fields.forEach(function (f) {
6453
6546
  if (f.rules) {
@@ -6473,52 +6566,67 @@ var _typeof = function(object) {
6473
6566
  },
6474
6567
  isValueEmpty: function isValueEmpty(fieldName) {
6475
6568
  var _this$doc$fieldName;
6569
+
6476
6570
  if (this.doc[fieldName] == null) {
6477
6571
  return true;
6478
6572
  }
6573
+
6479
6574
  if (Array.isArray(this.doc[fieldName]) && !((_this$doc$fieldName = this.doc[fieldName]) !== null && _this$doc$fieldName !== void 0 && _this$doc$fieldName.length)) {
6480
6575
  return true;
6481
6576
  }
6577
+
6482
6578
  if (_typeof(this.doc[fieldName] === 'string') && this.doc[fieldName] === '') {
6483
6579
  return true;
6484
6580
  }
6581
+
6485
6582
  return false;
6486
6583
  },
6487
6584
  isValueLessThanMax: function isValueLessThanMax(fieldname, max) {
6488
6585
  if (this.doc[fieldname] && max) {
6489
6586
  var _this$doc$fieldname;
6587
+
6490
6588
  return ((_this$doc$fieldname = this.doc[fieldname]) === null || _this$doc$fieldname === void 0 ? void 0 : _this$doc$fieldname.length) > parseInt(max);
6491
6589
  }
6590
+
6492
6591
  return false;
6493
6592
  },
6494
6593
  isValueLessThanMin: function isValueLessThanMin(fieldname, min) {
6495
6594
  if (this.doc[fieldname] && min) {
6496
6595
  return parseInt(this.doc[fieldname]) < parseInt(min);
6497
6596
  }
6597
+
6498
6598
  return false;
6499
6599
  },
6500
6600
  validate: function validate() {
6501
6601
  var _this3 = this;
6602
+
6502
6603
  var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};
6503
6604
  this.formConfig.sections.forEach(function (s) {
6504
6605
  s.columns.forEach(function (c) {
6505
6606
  c.fields.forEach(function (f) {
6506
6607
  var _f$input$propsData, _f$input$propsData3;
6608
+
6507
6609
  var feedback = '';
6610
+
6508
6611
  if (f.required && _this3.isValueEmpty(f.name)) {
6509
6612
  feedback += _this3.getDisplayField(f);
6510
6613
  }
6614
+
6511
6615
  if (f.type === 'integer' && _this3.isValueLessThanMin(f.name, f.input.propsData.min)) {
6512
6616
  feedback += f.input.propsData.min;
6513
- }
6514
- // TODO: Костыль так как на бэке нету типа memo
6617
+ } // TODO: Костыль так как на бэке нету типа memo
6618
+
6619
+
6515
6620
  if (f.input.type === 'b-form-textarea' && _this3.isValueLessThanMax(f.name, (_f$input$propsData = f.input.propsData) === null || _f$input$propsData === void 0 ? void 0 : _f$input$propsData.max)) {
6516
6621
  var _f$input$propsData2;
6622
+
6517
6623
  feedback += "\n\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u043F\u043E\u043B\u044F ".concat((_f$input$propsData2 = f.input.propsData) === null || _f$input$propsData2 === void 0 ? void 0 : _f$input$propsData2.max);
6518
6624
  }
6625
+
6519
6626
  if (f.required && (_f$input$propsData3 = f.input.propsData) !== null && _f$input$propsData3 !== void 0 && _f$input$propsData3.isInlineTableInput) {
6520
- var _this3$$refs$f$name$, _this3$$refs, _this3$$refs$getIsDir, _UtArray$removeDuplic;
6521
- var findErrors = (_this3$$refs$f$name$ = (_this3$$refs = _this3.$refs) === null || _this3$$refs === void 0 || (_this3$$refs = _this3$$refs[f.name]) === null || _this3$$refs === void 0 || (_this3$$refs = _this3$$refs[0]) === null || _this3$$refs === void 0 || (_this3$$refs$getIsDir = _this3$$refs.getIsDirty) === null || _this3$$refs$getIsDir === void 0 ? void 0 : _this3$$refs$getIsDir.call(_this3$$refs)) !== null && _this3$$refs$f$name$ !== void 0 ? _this3$$refs$f$name$ : [];
6627
+ var _this3$$refs$f$name$, _this3$$refs, _this3$$refs$f$name, _this3$$refs$f$name$2, _this3$$refs$f$name$3, _UtArray$removeDuplic;
6628
+
6629
+ var findErrors = (_this3$$refs$f$name$ = (_this3$$refs = _this3.$refs) === null || _this3$$refs === void 0 ? void 0 : (_this3$$refs$f$name = _this3$$refs[f.name]) === null || _this3$$refs$f$name === void 0 ? void 0 : (_this3$$refs$f$name$2 = _this3$$refs$f$name[0]) === null || _this3$$refs$f$name$2 === void 0 ? void 0 : (_this3$$refs$f$name$3 = _this3$$refs$f$name$2.getIsDirty) === null || _this3$$refs$f$name$3 === void 0 ? void 0 : _this3$$refs$f$name$3.call(_this3$$refs$f$name$2)) !== null && _this3$$refs$f$name$ !== void 0 ? _this3$$refs$f$name$ : [];
6522
6630
  var errors = (_UtArray$removeDuplic = UtArray.removeDuplicate(findErrors, 'field')) === null || _UtArray$removeDuplic === void 0 ? void 0 : _UtArray$removeDuplic.map(function (f) {
6523
6631
  return f === null || f === void 0 ? void 0 : f.label;
6524
6632
  }).join(', ');
@@ -6526,13 +6634,16 @@ var _typeof = function(object) {
6526
6634
  field: errors
6527
6635
  }) : _this3.isValueEmpty(f.name) ? _this3.getDisplayField(f) : '';
6528
6636
  }
6637
+
6529
6638
  if (feedback) {
6530
6639
  Vue__default["default"].set(_this3.validationState, f.name, false);
6531
6640
  Vue__default["default"].set(_this3.validationState, "".concat(f.name, "__feedback"), feedback);
6532
6641
  } else {
6533
6642
  Vue__default["default"].set(_this3.validationState, f.name, null);
6534
6643
  }
6644
+
6535
6645
  callback(feedback, _this3.$refs, f, _this3.doc);
6646
+
6536
6647
  _this3.onEventFired('validate', {
6537
6648
  validationState: _this3.validationState,
6538
6649
  doc: _this3.doc
@@ -6540,34 +6651,44 @@ var _typeof = function(object) {
6540
6651
  });
6541
6652
  });
6542
6653
  });
6654
+
6543
6655
  for (var fieldName in this.validationState) {
6544
6656
  if (this.validationState[fieldName] === false) {
6545
6657
  return false;
6546
6658
  }
6547
6659
  }
6660
+
6548
6661
  return true;
6549
6662
  },
6550
6663
  getColumnSize: function getColumnSize(section) {
6551
6664
  var MAX_COLUMN_SIZE = 12;
6665
+
6552
6666
  if (!section || !section.columnCount) {
6553
6667
  return MAX_COLUMN_SIZE;
6554
6668
  }
6669
+
6555
6670
  var colSize = Math.floor(MAX_COLUMN_SIZE / section.columnCount);
6556
6671
  return colSize;
6557
6672
  },
6673
+ isNotUndefinedAndNull: function isNotUndefinedAndNull(value) {
6674
+ return !(value === null || value === undefined);
6675
+ },
6558
6676
  execApplyDefaultValues: function execApplyDefaultValues() {
6559
6677
  var _this4 = this;
6678
+
6560
6679
  if (this.applyDefaultValues) {
6561
6680
  this.formConfig.sections.forEach(function (r) {
6562
6681
  r.columns.forEach(function (c) {
6563
6682
  c.fields.forEach(function (f) {
6564
- if (f.defaultValue) {
6683
+ if (_this4.isNotUndefinedAndNull(f.defaultValue)) {
6565
6684
  var defValue;
6685
+
6566
6686
  if (_this4.defaultValue && _typeof(f.defaultValue) === 'function') {
6567
6687
  defValue = f.defaultValue();
6568
6688
  } else {
6569
6689
  defValue = f.defaultValue == null ? null : f.defaultValue;
6570
6690
  }
6691
+
6571
6692
  _this4.$set(_this4.doc, f.name, f.defaultValue = defValue);
6572
6693
  }
6573
6694
  });
@@ -6577,6 +6698,7 @@ var _typeof = function(object) {
6577
6698
  },
6578
6699
  execApplyDefaultValRule: function execApplyDefaultValRule() {
6579
6700
  var _this5 = this;
6701
+
6580
6702
  this.formConfig.sections.forEach(function (el) {
6581
6703
  el.columns.forEach(function (c) {
6582
6704
  c.fields.forEach(function (f) {
@@ -6585,6 +6707,7 @@ var _typeof = function(object) {
6585
6707
  var rule = f.rules.find(function (rule) {
6586
6708
  return rule.event === 'defaultValue';
6587
6709
  });
6710
+
6588
6711
  if (rule && !_this5.doc[f.name]) {
6589
6712
  _this5.$set(_this5.doc, f.name, f.defaultValue = eval(rule.script));
6590
6713
  }
@@ -6607,12 +6730,15 @@ var _typeof = function(object) {
6607
6730
  }
6608
6731
  };/* script */
6609
6732
  var __vue_script__$3 = script$3;
6610
-
6611
6733
  /* template */
6734
+
6612
6735
  var __vue_render__$3 = function __vue_render__() {
6613
6736
  var _vm = this;
6737
+
6614
6738
  var _h = _vm.$createElement;
6739
+
6615
6740
  var _c = _vm._self._c || _h;
6741
+
6616
6742
  return _vm.formConfig && _vm.formConfig.sections ? _c('b-form', {
6617
6743
  staticClass: "rb-doc-form",
6618
6744
  on: {
@@ -6719,15 +6845,19 @@ var __vue_render__$3 = function __vue_render__() {
6719
6845
  })], 2)], 1);
6720
6846
  }), 0) : _vm._e();
6721
6847
  };
6722
- var __vue_staticRenderFns__$3 = [];
6723
6848
 
6849
+ var __vue_staticRenderFns__$3 = [];
6724
6850
  /* style */
6851
+
6725
6852
  var __vue_inject_styles__$3 = undefined;
6726
6853
  /* scoped */
6854
+
6727
6855
  var __vue_scope_id__$3 = undefined;
6728
6856
  /* module identifier */
6729
- var __vue_module_identifier__$3 = "data-v-48644863";
6857
+
6858
+ var __vue_module_identifier__$3 = "data-v-3f70ce98";
6730
6859
  /* functional template */
6860
+
6731
6861
  var __vue_is_functional_template__$3 = false;
6732
6862
  /* style inject */
6733
6863
 
@@ -6739,15 +6869,19 @@ var __vue_component__$4 = /*#__PURE__*/normalizeComponent({
6739
6869
  render: __vue_render__$3,
6740
6870
  staticRenderFns: __vue_staticRenderFns__$3
6741
6871
  }, __vue_inject_styles__$3, __vue_script__$3, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, false, undefined, undefined, undefined);
6872
+
6742
6873
  var DocForm = __vue_component__$4;var generateRandomString = function generateRandomString(length) {
6743
6874
  var result = '';
6744
6875
  var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
6745
6876
  var charactersLength = characters.length;
6877
+
6746
6878
  for (var i = 0; i < length; i++) {
6747
6879
  result += characters.charAt(Math.floor(Math.random() * charactersLength));
6748
6880
  }
6881
+
6749
6882
  return result;
6750
6883
  };
6884
+
6751
6885
  var UtRandom = {
6752
6886
  getRandomString: function getRandomString(length) {
6753
6887
  return generateRandomString(length);
@@ -6802,6 +6936,7 @@ var script$2 = {
6802
6936
  methods: {
6803
6937
  validateFields: function validateFields(fieldName) {
6804
6938
  var _this = this;
6939
+
6805
6940
  var fields = fieldName ? [fieldName] : ['name', 'event', 'script'];
6806
6941
  fields.forEach(function (field) {
6807
6942
  if (!_this.innerRule[field]) {
@@ -6819,8 +6954,10 @@ var script$2 = {
6819
6954
  applyRuleToInnerFormConfig: function applyRuleToInnerFormConfig() {
6820
6955
  if (this.innerFormConfig) {
6821
6956
  var foundRule = UtFormConfig.findRule(this.innerRule.id, this.innerFormConfig);
6957
+
6822
6958
  if (!foundRule) {
6823
6959
  var foundField = UtFormConfig.findField(this.field.name, this.innerFormConfig);
6960
+
6824
6961
  if (foundField) {
6825
6962
  foundField.rules = foundField.rules ? foundField.rules : [];
6826
6963
  foundField.rules.push(this.rule);
@@ -6878,6 +7015,7 @@ var script$2 = {
6878
7015
  var rule = this.rulePresets.find(function (rule) {
6879
7016
  return rule.name === ruleName;
6880
7017
  });
7018
+
6881
7019
  if (rule) {
6882
7020
  Object.assign(this.innerRule, rule);
6883
7021
  this.innerRule.script = this.innerRule.script.trim();
@@ -6885,13 +7023,17 @@ var script$2 = {
6885
7023
  },
6886
7024
  onOk: function onOk() {
6887
7025
  var _this2 = this;
7026
+
6888
7027
  this.validateFields();
7028
+
6889
7029
  if (this.state.name && this.state.script) {
6890
7030
  if (this.onAfterOk) {
6891
7031
  this.onAfterOk(this.innerRule);
6892
7032
  }
7033
+
6893
7034
  this.$nextTick(function () {
6894
7035
  _this2.resetModal();
7036
+
6895
7037
  _this2.$bvModal.hide(_this2.id);
6896
7038
  });
6897
7039
  }
@@ -6902,12 +7044,15 @@ var script$2 = {
6902
7044
  }
6903
7045
  };/* script */
6904
7046
  var __vue_script__$2 = script$2;
6905
-
6906
7047
  /* template */
7048
+
6907
7049
  var __vue_render__$2 = function __vue_render__() {
6908
7050
  var _vm = this;
7051
+
6909
7052
  var _h = _vm.$createElement;
7053
+
6910
7054
  var _c = _vm._self._c || _h;
7055
+
6911
7056
  return _c('b-modal', {
6912
7057
  attrs: {
6913
7058
  "id": _vm.id,
@@ -7160,15 +7305,19 @@ var __vue_render__$2 = function __vue_render__() {
7160
7305
  }
7161
7306
  })], 1) : _vm._e()], 1)], 1)], 1);
7162
7307
  };
7163
- var __vue_staticRenderFns__$2 = [];
7164
7308
 
7309
+ var __vue_staticRenderFns__$2 = [];
7165
7310
  /* style */
7311
+
7166
7312
  var __vue_inject_styles__$2 = undefined;
7167
7313
  /* scoped */
7314
+
7168
7315
  var __vue_scope_id__$2 = undefined;
7169
7316
  /* module identifier */
7170
- var __vue_module_identifier__$2 = "data-v-cc4d6922";
7317
+
7318
+ var __vue_module_identifier__$2 = "data-v-6383ddb8";
7171
7319
  /* functional template */
7320
+
7172
7321
  var __vue_is_functional_template__$2 = false;
7173
7322
  /* style inject */
7174
7323
 
@@ -7180,6 +7329,7 @@ var __vue_component__$3 = /*#__PURE__*/normalizeComponent({
7180
7329
  render: __vue_render__$2,
7181
7330
  staticRenderFns: __vue_staticRenderFns__$2
7182
7331
  }, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, false, undefined, undefined, undefined);
7332
+
7183
7333
  var FieldRuleFormModal = __vue_component__$3;var script$1 = {
7184
7334
  name: 'DocTemplateFieldSidebar',
7185
7335
  components: {
@@ -7238,6 +7388,7 @@ var FieldRuleFormModal = __vue_component__$3;var script$1 = {
7238
7388
  },
7239
7389
  value: function value() {
7240
7390
  this.field = this.value;
7391
+
7241
7392
  if (this.field && this.field.input) {
7242
7393
  this.currentInputName = this.field.input.name;
7243
7394
  }
@@ -7254,6 +7405,7 @@ var FieldRuleFormModal = __vue_component__$3;var script$1 = {
7254
7405
  },
7255
7406
  multiple: function multiple() {
7256
7407
  var input = UtFormConstructor.getDefaultInput(this.field);
7408
+
7257
7409
  if (this.field.multiple) {
7258
7410
  this.currentInputName = input.name;
7259
7411
  }
@@ -7288,6 +7440,7 @@ var FieldRuleFormModal = __vue_component__$3;var script$1 = {
7288
7440
  },
7289
7441
  addRule: function addRule() {
7290
7442
  var _this = this;
7443
+
7291
7444
  this.ruleModalCfg = {
7292
7445
  mode: 'ins',
7293
7446
  rule: {
@@ -7296,7 +7449,9 @@ var FieldRuleFormModal = __vue_component__$3;var script$1 = {
7296
7449
  },
7297
7450
  onAfterOk: function onAfterOk(rule) {
7298
7451
  _this.field.rules = _this.field.rules ? _this.field.rules : [];
7452
+
7299
7453
  _this.field.rules.push(_objectSpread2({}, rule));
7454
+
7300
7455
  _this.rulesHash = UtRandom.getRandomString(10);
7301
7456
  }
7302
7457
  };
@@ -7306,6 +7461,7 @@ var FieldRuleFormModal = __vue_component__$3;var script$1 = {
7306
7461
  if (event.target.classList && event.target.classList.contains('rb-remove-rule')) {
7307
7462
  return;
7308
7463
  }
7464
+
7309
7465
  this.ruleModalCfg = {
7310
7466
  mode: 'upd',
7311
7467
  rule: _objectSpread2({}, rule),
@@ -7319,9 +7475,11 @@ var FieldRuleFormModal = __vue_component__$3;var script$1 = {
7319
7475
  var index = this.field.rules.findIndex(function (r) {
7320
7476
  return r.id === rule.id;
7321
7477
  });
7478
+
7322
7479
  if (index >= 0) {
7323
7480
  this.field.rules.splice(index, 1);
7324
7481
  }
7482
+
7325
7483
  this.rulesHash = UtRandom.getRandomString(10);
7326
7484
  }
7327
7485
  },
@@ -7329,6 +7487,7 @@ var FieldRuleFormModal = __vue_component__$3;var script$1 = {
7329
7487
  if (this.value) {
7330
7488
  this.innerVisible = this.visible;
7331
7489
  this.field = this.value;
7490
+
7332
7491
  if (this.field && this.field.input) {
7333
7492
  this.currentInputName = this.field.input.name;
7334
7493
  }
@@ -7336,12 +7495,15 @@ var FieldRuleFormModal = __vue_component__$3;var script$1 = {
7336
7495
  }
7337
7496
  };/* script */
7338
7497
  var __vue_script__$1 = script$1;
7339
-
7340
7498
  /* template */
7499
+
7341
7500
  var __vue_render__$1 = function __vue_render__() {
7342
7501
  var _vm = this;
7502
+
7343
7503
  var _h = _vm.$createElement;
7504
+
7344
7505
  var _c = _vm._self._c || _h;
7506
+
7345
7507
  return _c('b-sidebar', {
7346
7508
  staticClass: "rb-doc-template-field-sidebar",
7347
7509
  attrs: {
@@ -7579,15 +7741,19 @@ var __vue_render__$1 = function __vue_render__() {
7579
7741
  }
7580
7742
  })], 1);
7581
7743
  };
7582
- var __vue_staticRenderFns__$1 = [];
7583
7744
 
7745
+ var __vue_staticRenderFns__$1 = [];
7584
7746
  /* style */
7747
+
7585
7748
  var __vue_inject_styles__$1 = undefined;
7586
7749
  /* scoped */
7750
+
7587
7751
  var __vue_scope_id__$1 = undefined;
7588
7752
  /* module identifier */
7589
- var __vue_module_identifier__$1 = "data-v-44fffe29";
7753
+
7754
+ var __vue_module_identifier__$1 = "data-v-6f12d00c";
7590
7755
  /* functional template */
7756
+
7591
7757
  var __vue_is_functional_template__$1 = false;
7592
7758
  /* style inject */
7593
7759
 
@@ -7599,6 +7765,7 @@ var __vue_component__$2 = /*#__PURE__*/normalizeComponent({
7599
7765
  render: __vue_render__$1,
7600
7766
  staticRenderFns: __vue_staticRenderFns__$1
7601
7767
  }, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, undefined, undefined, undefined);
7768
+
7602
7769
  var DocTemplateFieldSidebar = __vue_component__$2;var script = {
7603
7770
  name: 'DocTemplateConstructor',
7604
7771
  components: {
@@ -7656,42 +7823,50 @@ var DocTemplateFieldSidebar = __vue_component__$2;var script = {
7656
7823
  if (event.target.classList && event.target.classList.contains('rb-remove-field')) {
7657
7824
  return;
7658
7825
  }
7826
+
7659
7827
  this.sidebarVisible = true;
7660
7828
  this.sidebarField = field;
7661
7829
  },
7662
7830
  addSection: function addSection(columnCount) {
7663
7831
  var _this = this;
7832
+
7664
7833
  var section = {
7665
7834
  labelRu: null,
7666
7835
  columnCount: columnCount
7667
7836
  };
7668
7837
  this.sectionModalCfg.mode = 'ins';
7669
7838
  this.sectionModalCfg.section = section;
7839
+
7670
7840
  this.sectionModalCfg.onAfterOk = function () {
7671
7841
  section.columns = [];
7842
+
7672
7843
  for (var i = 0; i < columnCount; i++) {
7673
7844
  section.columns.push({
7674
7845
  index: i,
7675
7846
  fields: []
7676
7847
  });
7677
7848
  }
7849
+
7678
7850
  _this.formConfig.sections.push(section);
7679
7851
  };
7852
+
7680
7853
  this.$bvModal.show(this.sectionModalCfg.id);
7681
7854
  },
7682
7855
  editSection: function editSection(section) {
7683
7856
  this.sectionModalCfg.mode = 'update';
7684
7857
  this.sectionModalCfg.section = section;
7858
+
7685
7859
  this.sectionModalCfg.onAfterOk = function () {};
7860
+
7686
7861
  this.$bvModal.show(this.sectionModalCfg.id);
7687
7862
  },
7688
7863
  removeSection: function removeSection(section, index) {
7689
7864
  this.formConfig.sections.splice(index, 1);
7690
- /*UtModal.showYesNoDialog('Вы действительно хотите удалить секцию?', {
7691
- onOk: (event, modal) => {
7692
- this.formConfig.sections.splice(index, 1);
7693
- UtModal.closeModal(modal);
7694
- }
7865
+ /*UtModal.showYesNoDialog('Вы действительно хотите удалить секцию?', {
7866
+ onOk: (event, modal) => {
7867
+ this.formConfig.sections.splice(index, 1);
7868
+ UtModal.closeModal(modal);
7869
+ }
7695
7870
  });*/
7696
7871
  },
7697
7872
  multipleFieldAreOnFormConfig: function multipleFieldAreOnFormConfig(field) {
@@ -7709,11 +7884,13 @@ var DocTemplateFieldSidebar = __vue_component__$2;var script = {
7709
7884
  },
7710
7885
  removeFieldFromColumn: function removeFieldFromColumn(field, column, newIndex) {
7711
7886
  var index = newIndex != null ? newIndex : -1;
7887
+
7712
7888
  if (index < 0) {
7713
7889
  index = column.fields.findIndex(function (f) {
7714
7890
  return field.name === f.name;
7715
7891
  });
7716
7892
  }
7893
+
7717
7894
  if (index >= 0) {
7718
7895
  column.fields.splice(index, 1);
7719
7896
  }
@@ -7728,10 +7905,13 @@ var DocTemplateFieldSidebar = __vue_component__$2;var script = {
7728
7905
  onFieldMoveEnd: function onFieldMoveEnd(event) {
7729
7906
  var newIndex = event.newIndex;
7730
7907
  var field = event.item._underlying_vm_;
7908
+
7731
7909
  if (!field.hasOwnProperty('defaultValue')) {
7732
7910
  this.$set(field, 'defaultValue', undefined);
7733
7911
  }
7912
+
7734
7913
  var found = this.multipleFieldAreOnFormConfig(field);
7914
+
7735
7915
  if (found) {
7736
7916
  this.removeFieldFromColumn(field, this.columnTo, newIndex);
7737
7917
  this.resetDragVariables();
@@ -7745,6 +7925,7 @@ var DocTemplateFieldSidebar = __vue_component__$2;var script = {
7745
7925
  noCloseOnEsc: true
7746
7926
  });
7747
7927
  }
7928
+
7748
7929
  this.resetDragVariables();
7749
7930
  this.hash = (Math.random() + 1).toString(36).substring(7);
7750
7931
  },
@@ -7760,12 +7941,15 @@ var DocTemplateFieldSidebar = __vue_component__$2;var script = {
7760
7941
  }
7761
7942
  };/* script */
7762
7943
  var __vue_script__ = script;
7763
-
7764
7944
  /* template */
7945
+
7765
7946
  var __vue_render__ = function __vue_render__() {
7766
7947
  var _vm = this;
7948
+
7767
7949
  var _h = _vm.$createElement;
7950
+
7768
7951
  var _c = _vm._self._c || _h;
7952
+
7769
7953
  return _c('div', {
7770
7954
  staticClass: "rb-doc-template-constructor d-flex"
7771
7955
  }, [_c('doc-template-facet-list', {
@@ -7997,15 +8181,19 @@ var __vue_render__ = function __vue_render__() {
7997
8181
  }
7998
8182
  })], 2)], 2);
7999
8183
  };
8000
- var __vue_staticRenderFns__ = [];
8001
8184
 
8185
+ var __vue_staticRenderFns__ = [];
8002
8186
  /* style */
8187
+
8003
8188
  var __vue_inject_styles__ = undefined;
8004
8189
  /* scoped */
8190
+
8005
8191
  var __vue_scope_id__ = undefined;
8006
8192
  /* module identifier */
8007
- var __vue_module_identifier__ = "data-v-69af8b42";
8193
+
8194
+ var __vue_module_identifier__ = "data-v-8c2e2cde";
8008
8195
  /* functional template */
8196
+
8009
8197
  var __vue_is_functional_template__ = false;
8010
8198
  /* style inject */
8011
8199
 
@@ -8017,21 +8205,24 @@ var __vue_component__ = /*#__PURE__*/normalizeComponent({
8017
8205
  render: __vue_render__,
8018
8206
  staticRenderFns: __vue_staticRenderFns__
8019
8207
  }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
8020
- var __vue_component__$1 = __vue_component__;/* eslint-disable import/prefer-default-export */var components$1=/*#__PURE__*/Object.freeze({__proto__:null,UtFormConfig:UtFormConfig,UtFormConstructor:UtFormConstructor,DocTemplateSectionModal:DocTemplateSectionModal,DocTemplateFacetList:DocTemplateFacetList,DocTemplateFieldSidebar:DocTemplateFieldSidebar,DocTemplateConstructor:__vue_component__$1,FieldRuleFormModal:FieldRuleFormModal,DocForm:DocForm});// install function executed by Vue.use()
8021
- var install = function installRbDocumentFormConstructor(Vue) {
8208
+
8209
+ var __vue_component__$1 = __vue_component__;/* eslint-disable import/prefer-default-export */var components$1=/*#__PURE__*/Object.freeze({__proto__:null,UtFormConfig:UtFormConfig,UtFormConstructor:UtFormConstructor,DocTemplateSectionModal:DocTemplateSectionModal,DocTemplateFacetList:DocTemplateFacetList,DocTemplateFieldSidebar:DocTemplateFieldSidebar,DocTemplateConstructor:__vue_component__$1,FieldRuleFormModal:FieldRuleFormModal,DocForm:DocForm});var install = function installRbDocumentFormConstructor(Vue) {
8022
8210
  Object.entries(components$1).forEach(function (_ref) {
8023
8211
  var _ref2 = _slicedToArray(_ref, 2),
8024
- componentName = _ref2[0],
8025
- component = _ref2[1];
8212
+ componentName = _ref2[0],
8213
+ component = _ref2[1];
8214
+
8026
8215
  Vue.component(componentName, component);
8027
8216
  });
8028
- };var components=/*#__PURE__*/Object.freeze({__proto__:null,'default':install,UtFormConfig:UtFormConfig,UtFormConstructor:UtFormConstructor,DocTemplateSectionModal:DocTemplateSectionModal,DocTemplateFacetList:DocTemplateFacetList,DocTemplateFieldSidebar:DocTemplateFieldSidebar,DocTemplateConstructor:__vue_component__$1,FieldRuleFormModal:FieldRuleFormModal,DocForm:DocForm});// Attach named exports directly to plugin. IIFE/CJS will
8029
- // only expose one global var, with component exports exposed as properties of
8217
+ }; // Create module definition for Vue.use()
8218
+ var components=/*#__PURE__*/Object.freeze({__proto__:null,'default':install,UtFormConfig:UtFormConfig,UtFormConstructor:UtFormConstructor,DocTemplateSectionModal:DocTemplateSectionModal,DocTemplateFacetList:DocTemplateFacetList,DocTemplateFieldSidebar:DocTemplateFieldSidebar,DocTemplateConstructor:__vue_component__$1,FieldRuleFormModal:FieldRuleFormModal,DocForm:DocForm});// only expose one global var, with component exports exposed as properties of
8030
8219
  // that global var (eg. plugin.component)
8220
+
8031
8221
  Object.entries(components).forEach(function (_ref) {
8032
8222
  var _ref2 = _slicedToArray(_ref, 2),
8033
- componentName = _ref2[0],
8034
- component = _ref2[1];
8223
+ componentName = _ref2[0],
8224
+ component = _ref2[1];
8225
+
8035
8226
  if (componentName !== 'default') {
8036
8227
  install[componentName] = component;
8037
8228
  }