rb-document-form-constructor 0.8.47 → 0.8.49

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.
@@ -4933,6 +4933,12 @@ let fcInputs = {
4933
4933
  default: null,
4934
4934
  label: 'Надпись внутри',
4935
4935
  visible: true
4936
+ },
4937
+ max: {
4938
+ type: 'number',
4939
+ default: 30,
4940
+ label: 'Максимальное значение',
4941
+ visible: true
4936
4942
  }
4937
4943
  },
4938
4944
  propsData: {},
@@ -11250,6 +11256,16 @@ var script$3 = {
11250
11256
  return false;
11251
11257
  },
11252
11258
 
11259
+ isValueLessThanMax(fieldname, max) {
11260
+ if (this.doc[fieldname] && max) {
11261
+ var _this$doc$fieldname;
11262
+
11263
+ return ((_this$doc$fieldname = this.doc[fieldname]) === null || _this$doc$fieldname === void 0 ? void 0 : _this$doc$fieldname.length) > parseInt(max);
11264
+ }
11265
+
11266
+ return false;
11267
+ },
11268
+
11253
11269
  isValueLessThanMin(fieldname, min) {
11254
11270
  if (this.doc[fieldname] && min) {
11255
11271
  return parseInt(this.doc[fieldname]) < parseInt(min);
@@ -11262,6 +11278,9 @@ var script$3 = {
11262
11278
  this.formConfig.sections.forEach(s => {
11263
11279
  s.columns.forEach(c => {
11264
11280
  c.fields.forEach(f => {
11281
+ var _f$input$propsData, _f$input$propsData2;
11282
+
11283
+ console.log(f.type);
11265
11284
  let feedback = '';
11266
11285
 
11267
11286
  if (f.required && this.isValueEmpty(f.name)) {
@@ -11272,6 +11291,14 @@ var script$3 = {
11272
11291
  feedback += `\nМинимальное значение для этого поля ${f.input.propsData.min}`;
11273
11292
  }
11274
11293
 
11294
+ console.log((_f$input$propsData = f.input.propsData) === null || _f$input$propsData === void 0 ? void 0 : _f$input$propsData.max);
11295
+
11296
+ if (f.type === 'memo' && this.isValueLessThanMax(f.name, (_f$input$propsData2 = f.input.propsData) === null || _f$input$propsData2 === void 0 ? void 0 : _f$input$propsData2.max)) {
11297
+ var _f$input$propsData3;
11298
+
11299
+ feedback += `\nМаксимальное значение для этого поля ${(_f$input$propsData3 = f.input.propsData) === null || _f$input$propsData3 === void 0 ? void 0 : _f$input$propsData3.max}`;
11300
+ }
11301
+
11275
11302
  if (feedback) {
11276
11303
  Vue.set(this.validationState, f.name, false);
11277
11304
  Vue.set(this.validationState, `${f.name}__feedback`, feedback);
@@ -12569,7 +12596,7 @@ var script = {
12569
12596
  let field = event.item._underlying_vm_;
12570
12597
 
12571
12598
  if (!field.hasOwnProperty('defaultValue')) {
12572
- field.defaultValue = null;
12599
+ this.$set(field, 'defaultValue', undefined);
12573
12600
  }
12574
12601
 
12575
12602
  let found = this.multipleFieldAreOnFormConfig(field);
@@ -12712,7 +12739,7 @@ var __vue_render__ = function () {
12712
12739
  return _vm.editSection(section);
12713
12740
  }
12714
12741
  }
12715
- }, [_vm._v("\n " + _vm._s(section.labelRu) + "\n ")]), _vm._v(" "), _c('span', {
12742
+ }, [_vm._v("\n " + _vm._s(section.labelRu) + "\n ")]), _vm._v(" "), _c('span', {
12716
12743
  staticClass: "rb-actions"
12717
12744
  }, [_c('rb-icon', {
12718
12745
  staticClass: "cursor-pointer",