rb-document-form-constructor 0.8.61 → 0.8.63

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.8.61",
3
+ "version": "0.8.63",
4
4
  "description": "",
5
5
  "main": "dist/rb-document-form-constructor.ssr.js",
6
6
  "browser": "dist/rb-document-form-constructor.esm.js",
@@ -20,7 +20,15 @@
20
20
  "build:unpkg": "cross-env kNODE_ENV=production rollup --config build/rollup.config.js --format iife"
21
21
  },
22
22
  "dependencies": {
23
- "nanoid": "^4.0.2",
23
+ "bootstrap": "^4.5.0",
24
+ "bootstrap-vue": "^2.15.0",
25
+ "debounce": "^1.2.1",
26
+ "jquery": "^3.6.0",
27
+ "notevil": "^1.3.3",
28
+ "sass": "^1.32.0",
29
+ "sass-loader": "^10.1.0",
30
+ "typeof": "^1.0.0",
31
+ "uuid": "^9.0.0",
24
32
  "vuedraggable": "^2.24.3"
25
33
  },
26
34
  "devDependencies": {
@@ -29,6 +37,7 @@
29
37
  "@rollup/plugin-alias": "^3.1.2",
30
38
  "@rollup/plugin-babel": "^5.3.0",
31
39
  "@rollup/plugin-commonjs": "^14.0.0",
40
+ "@rollup/plugin-json": "^6.0.0",
32
41
  "@rollup/plugin-node-resolve": "^9.0.0",
33
42
  "@rollup/plugin-replace": "^2.4.2",
34
43
  "@vue/cli-plugin-babel": "^4.5.13",
@@ -38,21 +47,17 @@
38
47
  "rb-bv-components": "^2.5.26",
39
48
  "rimraf": "^3.0.2",
40
49
  "rollup": "^2.52.8",
41
- "rollup-plugin-analyzer": "^4.0.0",
42
50
  "rollup-plugin-copy-assets": "^2.0.3",
43
51
  "rollup-plugin-sass": "^1.2.6",
44
52
  "rollup-plugin-terser": "^7.0.2",
45
53
  "rollup-plugin-visualizer": "^5.9.2",
46
54
  "rollup-plugin-vue": "^5.1.9",
47
55
  "rubles": "^0.2.0",
48
- "sass": "^1.32.0",
49
- "sass-loader": "^10.1.0",
50
56
  "vue": "^2.6.14",
57
+ "vue-i18n": "^8.28.2",
51
58
  "vue-template-compiler": "^2.6.14"
52
59
  },
53
60
  "peerDependencies": {
54
- "bootstrap": "^4.5.3",
55
- "bootstrap-vue": "^2.21.2",
56
61
  "vue": "^2.6.14"
57
62
  },
58
63
  "engines": {
@@ -1,7 +1,6 @@
1
1
  <template>
2
- <b-form v-if="formConfig" class="rb-doc-form">
2
+ <b-form v-if="formConfig && formConfig.sections" class="rb-doc-form" @submit.prevent>
3
3
  <b-container
4
- v-if="formConfig && formConfig.sections"
5
4
  v-for="section in formConfig.sections"
6
5
  :key="section.labelRu"
7
6
  class="rb-form-section"
@@ -62,6 +61,7 @@
62
61
  import Vue from 'vue';
63
62
  import {UtFormConstructor} from '../utils/UtFormConstructor';
64
63
  import typeOf from 'typeof';
64
+ import {i18n} from '../locales/i18n'
65
65
  import {UtFormConfig} from '@/utils/UtFormConfig';
66
66
  // import safeEval from "notevil";
67
67
 
@@ -108,9 +108,9 @@ export default {
108
108
  },
109
109
  getDisplayField(value) {
110
110
  if (!value[this.displayField]) {
111
- return value.labelRu
111
+ return value.labelRu;
112
112
  } else {
113
- return value[this.displayField]
113
+ return value[this.displayField];
114
114
  }
115
115
  },
116
116
  onEventFired(eventName, event, field) {
@@ -166,7 +166,7 @@ export default {
166
166
  return true;
167
167
  }
168
168
 
169
- if (typeof this.doc[fieldName] === 'string' && this.doc[fieldName] === '') {
169
+ if (typeOf(this.doc[fieldName] === 'string') && this.doc[fieldName] === '') {
170
170
  return true;
171
171
  }
172
172
  return false;
@@ -192,11 +192,11 @@ export default {
192
192
  let feedback = '';
193
193
 
194
194
  if (f.required && this.isValueEmpty(f.name)) {
195
- feedback += `Поле "${this.getDisplayField(f)}" обязательно`;
195
+ feedback += i18n.t('validate.required', {field: this.getDisplayField(f)});
196
196
  }
197
197
 
198
198
  if (f.type === 'integer' && this.isValueLessThanMin(f.name, f.input.propsData.min)) {
199
- feedback += `\nМинимальное значение для этого поля ${f.input.propsData.min}`;
199
+ feedback += `\n${i18n.t('validate.min', {min: f.input.propsData.min})}`;
200
200
  }
201
201
  // TODO: Костыль так как на бэке нету типа memo
202
202
  if (f.input.type === 'b-form-textarea' && this.isValueLessThanMax(f.name, f.input.propsData?.max)) {
@@ -245,7 +245,7 @@ export default {
245
245
  c.fields.forEach((f) => {
246
246
  if (f.defaultValue) {
247
247
  let defValue;
248
- if (this.defaultValue && typeof f.defaultValue === 'function') {
248
+ if (this.defaultValue && typeOf(f.defaultValue) === 'function') {
249
249
  defValue = f.defaultValue();
250
250
  } else {
251
251
  defValue = f.defaultValue == null ? null : f.defaultValue;
@@ -133,7 +133,7 @@
133
133
 
134
134
  <script>
135
135
  import FieldRuleFormModal from "./FieldRuleFormModal";
136
- import {nanoid} from 'nanoid';
136
+ import {v4 as uuidv4} from 'uuid';
137
137
  import {UtFormConstructor} from "../utils/UtFormConstructor";
138
138
 
139
139
  export default {
@@ -160,7 +160,7 @@
160
160
  rule: {},
161
161
  mode: 'ins',
162
162
  },
163
- rulesHash: nanoid(),
163
+ rulesHash: uuidv4(),
164
164
  }
165
165
  },
166
166
  computed: {
@@ -252,7 +252,7 @@
252
252
  this.field.rules.push({
253
253
  ...rule
254
254
  });
255
- this.rulesHash = nanoid();
255
+ this.rulesHash = uuidv4();
256
256
  }
257
257
  }
258
258
  this.$bvModal.show(this.modalId);
@@ -277,7 +277,7 @@
277
277
  if (index >= 0) {
278
278
  this.field.rules.splice(index, 1);
279
279
  }
280
- this.rulesHash = nanoid();
280
+ this.rulesHash = uuidv4();
281
281
  }
282
282
  },
283
283
  created() {
@@ -135,7 +135,7 @@
135
135
 
136
136
  <script>
137
137
  import {UtFormConfig} from "../utils/UtFormConfig";
138
- import { nanoid } from 'nanoid';
138
+ import {v4 as uuidv4} from 'uuid';
139
139
  import {UtFormConstructor} from "../utils/UtFormConstructor";
140
140
  import DocForm from "./DocForm";
141
141
 
@@ -230,7 +230,7 @@ export default {
230
230
  },
231
231
  getDefaultRule() {
232
232
  return {
233
- id: nanoid(),
233
+ id: uuidv4(),
234
234
  name: null,
235
235
  event: null,
236
236
  script: null,