rb-document-form-constructor 0.6.1 → 0.6.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.
@@ -3,14 +3,9 @@
3
3
 
4
4
  if (Object.getOwnPropertySymbols) {
5
5
  var symbols = Object.getOwnPropertySymbols(object);
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);
6
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
7
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
8
+ })), keys.push.apply(keys, symbols);
14
9
  }
15
10
 
16
11
  return keys;
@@ -18,19 +13,12 @@
18
13
 
19
14
  function _objectSpread2(target) {
20
15
  for (var i = 1; i < arguments.length; i++) {
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
- }
16
+ var source = null != arguments[i] ? arguments[i] : {};
17
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
18
+ _defineProperty$1(target, key, source[key]);
19
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
20
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
21
+ });
34
22
  }
35
23
 
36
24
  return target;
@@ -5234,6 +5222,7 @@ var UtFormConstructor = {
5234
5222
  runRule: function runRule(context, script) {
5235
5223
  context = context ? context : {};
5236
5224
  context['console'] = console;
5225
+ context['Date'] = new Date();
5237
5226
 
5238
5227
  var func = function func(script) {
5239
5228
  return notevil(script, context);
@@ -5445,7 +5434,7 @@ var __vue_inject_styles__$5 = undefined;
5445
5434
  var __vue_scope_id__$5 = undefined;
5446
5435
  /* module identifier */
5447
5436
 
5448
- var __vue_module_identifier__$5 = "data-v-ecb48d16";
5437
+ var __vue_module_identifier__$5 = "data-v-0dc54a8c";
5449
5438
  /* functional template */
5450
5439
 
5451
5440
  var __vue_is_functional_template__$5 = false;
@@ -10997,7 +10986,7 @@ var __vue_inject_styles__$4 = undefined;
10997
10986
  var __vue_scope_id__$4 = undefined;
10998
10987
  /* module identifier */
10999
10988
 
11000
- var __vue_module_identifier__$4 = "data-v-3e6871e0";
10989
+ var __vue_module_identifier__$4 = "data-v-12095172";
11001
10990
  /* functional template */
11002
10991
 
11003
10992
  var __vue_is_functional_template__$4 = false;
@@ -11120,6 +11109,7 @@ var script$3 = {
11120
11109
  formConfig: function formConfig() {
11121
11110
  this.validationState = {};
11122
11111
  this.execApplyDefaultValues();
11112
+ this.execApplyDefaultValRule();
11123
11113
  }
11124
11114
  },
11125
11115
  methods: {
@@ -11221,13 +11211,32 @@ var script$3 = {
11221
11211
  });
11222
11212
  });
11223
11213
  }
11214
+ },
11215
+ execApplyDefaultValRule: function execApplyDefaultValRule() {
11216
+ var _this4 = this;
11217
+
11218
+ this.formConfig.sections.forEach(function (el) {
11219
+ el.columns.forEach(function (c) {
11220
+ c.fields.forEach(function (f) {
11221
+ var rule = f.rules.find(function (rule) {
11222
+ return rule.event === 'defaultValue';
11223
+ });
11224
+
11225
+ if (rule) {
11226
+ _this4.$set(_this4.doc, f.name, f.defaultValue = eval(rule.script));
11227
+ }
11228
+ });
11229
+ });
11230
+ });
11224
11231
  }
11225
11232
  },
11226
11233
  mounted: function mounted() {
11227
11234
  this.execApplyDefaultValues();
11235
+ this.execApplyDefaultValRule();
11228
11236
  },
11229
11237
  activated: function activated() {
11230
11238
  this.execApplyDefaultValues();
11239
+ this.execApplyDefaultValRule();
11231
11240
  }
11232
11241
  };/* script */
11233
11242
  var __vue_script__$3 = script$3;
@@ -11291,7 +11300,8 @@ var __vue_render__$3 = function __vue_render__() {
11291
11300
  attrs: {
11292
11301
  "disabled": !_vm.editable || !field.editable,
11293
11302
  "id": field.name,
11294
- "state": _vm.validationState[field.name]
11303
+ "state": _vm.validationState[field.name],
11304
+ "required": field.required
11295
11305
  },
11296
11306
  on: {
11297
11307
  "input": function input($event) {
@@ -11326,7 +11336,7 @@ var __vue_inject_styles__$3 = undefined;
11326
11336
  var __vue_scope_id__$3 = undefined;
11327
11337
  /* module identifier */
11328
11338
 
11329
- var __vue_module_identifier__$3 = "data-v-e41de5ae";
11339
+ var __vue_module_identifier__$3 = "data-v-54849ec5";
11330
11340
  /* functional template */
11331
11341
 
11332
11342
  var __vue_is_functional_template__$3 = false;
@@ -11638,7 +11648,11 @@ var __vue_render__$2 = function __vue_render__() {
11638
11648
  attrs: {
11639
11649
  "value": 'validate'
11640
11650
  }
11641
- }, [_vm._v("\n Валидация\n ")])], 1)], 1)], 1), _vm._v(" "), _c('b-col', {
11651
+ }, [_vm._v("\n Валидация\n ")]), _vm._v(" "), _c('b-form-select-option', {
11652
+ attrs: {
11653
+ "value": 'defaultValue'
11654
+ }
11655
+ }, [_vm._v("\n Установить значение по умолчанию\n ")])], 1)], 1)], 1), _vm._v(" "), _c('b-col', {
11642
11656
  attrs: {
11643
11657
  "lg": "12"
11644
11658
  }
@@ -11746,7 +11760,7 @@ var __vue_inject_styles__$2 = undefined;
11746
11760
  var __vue_scope_id__$2 = undefined;
11747
11761
  /* module identifier */
11748
11762
 
11749
- var __vue_module_identifier__$2 = "data-v-6e658458";
11763
+ var __vue_module_identifier__$2 = "data-v-2b82f62a";
11750
11764
  /* functional template */
11751
11765
 
11752
11766
  var __vue_is_functional_template__$2 = false;
@@ -12168,7 +12182,7 @@ var __vue_inject_styles__$1 = undefined;
12168
12182
  var __vue_scope_id__$1 = undefined;
12169
12183
  /* module identifier */
12170
12184
 
12171
- var __vue_module_identifier__$1 = "data-v-a9918f24";
12185
+ var __vue_module_identifier__$1 = "data-v-a0db2474";
12172
12186
  /* functional template */
12173
12187
 
12174
12188
  var __vue_is_functional_template__$1 = false;
@@ -12588,7 +12602,7 @@ var __vue_inject_styles__ = undefined;
12588
12602
  var __vue_scope_id__ = undefined;
12589
12603
  /* module identifier */
12590
12604
 
12591
- var __vue_module_identifier__ = "data-v-657f3983";
12605
+ var __vue_module_identifier__ = "data-v-342f1f8b";
12592
12606
  /* functional template */
12593
12607
 
12594
12608
  var __vue_is_functional_template__ = false;
@@ -1,3 +1,3 @@
1
- .cursor-pointer {
2
- cursor: pointer;
3
- }
1
+ .cursor-pointer {
2
+ cursor: pointer;
3
+ }
@@ -1,17 +1,17 @@
1
- // DocTemplateFacetList
2
- $rb-facet-list-border-color: $border-color !default;
3
-
4
- // DocTemplateConstructor
5
- $rb-doc-template-constructor-title-color: #333 !default;
6
- $rb-doc-template-constructor-title-font-size: 16px !default;
7
- $rb-doc-template-section-bg: #E9EAEA !default;
8
- $rb-doc-template-constructor-form-column-border-color: #D5D5D6;
9
-
10
- // DocTemplateFieldSidebar
11
- $rb-doc-template-field-sidebar-font-size-lg: 1rem !default;
12
- $rb-doc-template-field-sidebar-top: 72px !default;
13
- $rb-doc-template-field-sidebar-close-button-left: -46px !default;
14
-
15
- // DocForm
16
- $rb-doc-form-font-size-lg: 1rem !default;
17
- $rb-doc-form-legend-line-height: $line-height-base !default;
1
+ // DocTemplateFacetList
2
+ $rb-facet-list-border-color: $border-color !default;
3
+
4
+ // DocTemplateConstructor
5
+ $rb-doc-template-constructor-title-color: #333 !default;
6
+ $rb-doc-template-constructor-title-font-size: 16px !default;
7
+ $rb-doc-template-section-bg: #E9EAEA !default;
8
+ $rb-doc-template-constructor-form-column-border-color: #D5D5D6;
9
+
10
+ // DocTemplateFieldSidebar
11
+ $rb-doc-template-field-sidebar-font-size-lg: 1rem !default;
12
+ $rb-doc-template-field-sidebar-top: 72px !default;
13
+ $rb-doc-template-field-sidebar-close-button-left: -46px !default;
14
+
15
+ // DocForm
16
+ $rb-doc-form-font-size-lg: 1rem !default;
17
+ $rb-doc-form-legend-line-height: $line-height-base !default;
@@ -1,36 +1,36 @@
1
- .rb-doc-form {
2
- h4 {
3
- font-weight: bold;
4
- font-size: $rb-doc-form-font-size-lg;
5
- }
6
-
7
- .rb-form-section {
8
- padding-bottom: 10px;
9
- padding-top: 10px;
10
- }
11
-
12
- .rb-form-column {
13
- flex: 1;
14
- }
15
-
16
- .rb-form-column:first-child {
17
- margin-left: 0;
18
- }
19
-
20
- .rb-form-column:last-child {
21
- margin-right: 0;
22
- }
23
-
24
- .rb-form-column {
25
- margin-left: 10px;
26
- margin-right: 10px;
27
- }
28
-
29
- legend.col-form-label {
30
- max-width: 100%;
31
- display: block;
32
- overflow: hidden;
33
- text-overflow: ellipsis;
34
- white-space: nowrap;
35
- }
36
- }
1
+ .rb-doc-form {
2
+ h4 {
3
+ font-weight: bold;
4
+ font-size: $rb-doc-form-font-size-lg;
5
+ }
6
+
7
+ .rb-form-section {
8
+ padding-bottom: 10px;
9
+ padding-top: 10px;
10
+ }
11
+
12
+ .rb-form-column {
13
+ flex: 1;
14
+ }
15
+
16
+ .rb-form-column:first-child {
17
+ margin-left: 0;
18
+ }
19
+
20
+ .rb-form-column:last-child {
21
+ margin-right: 0;
22
+ }
23
+
24
+ .rb-form-column {
25
+ margin-left: 10px;
26
+ margin-right: 10px;
27
+ }
28
+
29
+ legend.col-form-label {
30
+ max-width: 100%;
31
+ display: block;
32
+ overflow: hidden;
33
+ text-overflow: ellipsis;
34
+ white-space: nowrap;
35
+ }
36
+ }
@@ -1,112 +1,112 @@
1
- .rb-doc-template-constructor {
2
- height: 100%;
3
-
4
- h4 {
5
- color: $rb-doc-template-constructor-title-color;
6
- font-weight: bold;
7
- font-size: $rb-doc-template-constructor-title-font-size;
8
- }
9
-
10
- .rb-form-constructor {
11
- height: 100%;
12
- overflow-y: auto;
13
- background-color: white;
14
- }
15
-
16
- .rb-constructor-toolbar {
17
- padding: 16px 16px 16px 16px;
18
- background-color: white;
19
- border-bottom: 1px solid $border-color;
20
-
21
- h4 {
22
- margin-bottom: 0;
23
- line-height: 38px;
24
- margin-right: 10px;
25
- }
26
-
27
- .btn {
28
- margin-left: 10px;
29
- }
30
- }
31
-
32
- .rb-constructor-body {
33
- padding: 16px;
34
-
35
- .card {
36
- border-width: 2px;
37
- border-style: dashed;
38
- background-color: $rb-doc-template-section-bg;
39
-
40
- .card-header, .card-body {
41
- background-color: $rb-doc-template-section-bg;
42
- border-color: $border-color;
43
-
44
- }
45
- }
46
-
47
- .rb-form-card {
48
- margin-bottom: 20px;
49
-
50
- .rb-form-column {
51
- flex: 1;
52
- }
53
-
54
- .card-header {
55
- border-bottom-width: 0;
56
- display: flex;
57
- flex-direction: row;
58
-
59
- .rb-text {
60
- font-size: 16px;
61
- line-height: 24px;
62
- font-weight: bold;
63
- }
64
-
65
- .rb-icon {
66
- line-height: 24px;
67
- font-size: 16px;
68
- }
69
- }
70
- }
71
-
72
- .rb-form-column {
73
- .form-group:hover {
74
- legend.col-form-label .rb-actions {
75
- visibility: visible;
76
- }
77
- }
78
-
79
- legend.col-form-label {
80
- font-size: $font-size-base;
81
- font-weight: bold;
82
- margin-bottom: 12px;
83
- display: flex;
84
- flex-direction: row;
85
- color: $rb-doc-template-constructor-title-color;
86
-
87
- .rb-text {
88
- flex: 1;
89
- }
90
-
91
- .rb-actions {
92
- visibility: hidden;
93
- }
94
- }
95
-
96
- .form-control:disabled,
97
- .btn.disabled {
98
- background-color: white;
99
- opacity: 1;
100
- }
101
- }
102
-
103
- .rb-form-column {
104
- padding: 10px;
105
- border: 2px dashed $rb-doc-template-constructor-form-column-border-color;
106
- }
107
-
108
- .rb-form-column:not(.rb-single-column) {
109
- margin: 0 10px;
110
- }
111
- }
112
- }
1
+ .rb-doc-template-constructor {
2
+ height: 100%;
3
+
4
+ h4 {
5
+ color: $rb-doc-template-constructor-title-color;
6
+ font-weight: bold;
7
+ font-size: $rb-doc-template-constructor-title-font-size;
8
+ }
9
+
10
+ .rb-form-constructor {
11
+ height: 100%;
12
+ overflow-y: auto;
13
+ background-color: white;
14
+ }
15
+
16
+ .rb-constructor-toolbar {
17
+ padding: 16px 16px 16px 16px;
18
+ background-color: white;
19
+ border-bottom: 1px solid $border-color;
20
+
21
+ h4 {
22
+ margin-bottom: 0;
23
+ line-height: 38px;
24
+ margin-right: 10px;
25
+ }
26
+
27
+ .btn {
28
+ margin-left: 10px;
29
+ }
30
+ }
31
+
32
+ .rb-constructor-body {
33
+ padding: 16px;
34
+
35
+ .card {
36
+ border-width: 2px;
37
+ border-style: dashed;
38
+ background-color: $rb-doc-template-section-bg;
39
+
40
+ .card-header, .card-body {
41
+ background-color: $rb-doc-template-section-bg;
42
+ border-color: $border-color;
43
+
44
+ }
45
+ }
46
+
47
+ .rb-form-card {
48
+ margin-bottom: 20px;
49
+
50
+ .rb-form-column {
51
+ flex: 1;
52
+ }
53
+
54
+ .card-header {
55
+ border-bottom-width: 0;
56
+ display: flex;
57
+ flex-direction: row;
58
+
59
+ .rb-text {
60
+ font-size: 16px;
61
+ line-height: 24px;
62
+ font-weight: bold;
63
+ }
64
+
65
+ .rb-icon {
66
+ line-height: 24px;
67
+ font-size: 16px;
68
+ }
69
+ }
70
+ }
71
+
72
+ .rb-form-column {
73
+ .form-group:hover {
74
+ legend.col-form-label .rb-actions {
75
+ visibility: visible;
76
+ }
77
+ }
78
+
79
+ legend.col-form-label {
80
+ font-size: $font-size-base;
81
+ font-weight: bold;
82
+ margin-bottom: 12px;
83
+ display: flex;
84
+ flex-direction: row;
85
+ color: $rb-doc-template-constructor-title-color;
86
+
87
+ .rb-text {
88
+ flex: 1;
89
+ }
90
+
91
+ .rb-actions {
92
+ visibility: hidden;
93
+ }
94
+ }
95
+
96
+ .form-control:disabled,
97
+ .btn.disabled {
98
+ background-color: white;
99
+ opacity: 1;
100
+ }
101
+ }
102
+
103
+ .rb-form-column {
104
+ padding: 10px;
105
+ border: 2px dashed $rb-doc-template-constructor-form-column-border-color;
106
+ }
107
+
108
+ .rb-form-column:not(.rb-single-column) {
109
+ margin: 0 10px;
110
+ }
111
+ }
112
+ }
@@ -1,41 +1,41 @@
1
- .rb-facets-sidebar {
2
- height: 100%;
3
- width: 264px;
4
- overflow-y: auto;
5
- background-color: white;
6
- border-right: 1px solid $rb-facet-list-border-color;
7
-
8
- h4 {
9
- padding: 24px 16px 16px 16px;
10
- }
11
-
12
- h6 {
13
- padding-left: 16px;
14
- padding-right: 16px;
15
- font-weight: 500;
16
- }
17
-
18
- form {
19
- padding-left: 16px;
20
- padding-right: 16px;
21
- }
22
-
23
- .rb-facet-label {
24
- font-weight: bold;
25
- }
26
-
27
- .rb-facet-list {
28
- .rb-facet {
29
- padding: 10px 0;
30
- }
31
-
32
- & > .rb-facet:not(:last-child) {
33
- border-bottom: 1px solid $rb-facet-list-border-color;
34
- }
35
-
36
- .list-group-item {
37
- border-radius: 0;
38
- border: none;
39
- }
40
- }
41
- }
1
+ .rb-facets-sidebar {
2
+ height: 100%;
3
+ width: 264px;
4
+ overflow-y: auto;
5
+ background-color: white;
6
+ border-right: 1px solid $rb-facet-list-border-color;
7
+
8
+ h4 {
9
+ padding: 24px 16px 16px 16px;
10
+ }
11
+
12
+ h6 {
13
+ padding-left: 16px;
14
+ padding-right: 16px;
15
+ font-weight: 500;
16
+ }
17
+
18
+ form {
19
+ padding-left: 16px;
20
+ padding-right: 16px;
21
+ }
22
+
23
+ .rb-facet-label {
24
+ font-weight: bold;
25
+ }
26
+
27
+ .rb-facet-list {
28
+ .rb-facet {
29
+ padding: 10px 0;
30
+ }
31
+
32
+ & > .rb-facet:not(:last-child) {
33
+ border-bottom: 1px solid $rb-facet-list-border-color;
34
+ }
35
+
36
+ .list-group-item {
37
+ border-radius: 0;
38
+ border: none;
39
+ }
40
+ }
41
+ }