@byteluck-fe/model-driven-controls 7.0.0-props.22 → 7.0.0-props.23

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.
@@ -76,6 +76,7 @@ function _inherits(subClass, superClass) {
76
76
  if (superClass) _set_prototype_of(subClass, superClass);
77
77
  }
78
78
  function _instanceof(left, right) {
79
+ "@swc/helpers - instanceof";
79
80
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
80
81
  return !!right[Symbol.hasInstance](left);
81
82
  } else {
@@ -84,19 +84,21 @@ var CounterPropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
84
84
  var _this;
85
85
  _this = _call_super(this, CounterPropertyRules, [
86
86
  props
87
- ]), _define_property(_this, "defaultValue", {
88
- type: 'number',
89
- min: undefined,
90
- max: undefined,
91
- message: getLocaleText('CMD.pleaseEnterNumberRange', null, '请输入大于等于{min}且小于等于{max}的数值')
92
- }), _define_property(_this, "max", {
87
+ ]), _define_property(_this, "defaultValue", [
88
+ {
89
+ type: 'number',
90
+ min: 0,
91
+ max: 100,
92
+ message: getLocaleText('CMD.pleaseEnterNumberRange', null, '请输入大于等于{min}且小于等于{max}的数值')
93
+ }
94
+ ]), _define_property(_this, "max", {
93
95
  type: 'any'
94
96
  });
95
97
  var valueMax = props.max === '' ? 100 : props.max;
96
98
  var valueMin = props.min === '' ? 0 : props.min;
97
- _this.defaultValue.max = valueMax;
98
- _this.defaultValue.min = valueMin;
99
- _this.defaultValue.message = getLocaleText('CMD.pleaseEnterNumberRange', {
99
+ _this.defaultValue[0].max = valueMax;
100
+ _this.defaultValue[0].min = valueMin;
101
+ _this.defaultValue[0].message = getLocaleText('CMD.pleaseEnterNumberRange', {
100
102
  max: valueMax,
101
103
  min: valueMin
102
104
  }, '请输入大于等于{min}且小于等于{max}的数值');
@@ -74,19 +74,40 @@ function _is_native_reflect_construct() {
74
74
  })();
75
75
  }
76
76
  import { getLocaleText } from '@byteluck-fe/locale-message';
77
+ import { BaseControlPropertyRules } from '@byteluck-fe/model-driven-core';
77
78
  import { AttachmentProperty } from '../Attachment';
78
79
  import { ImageCompressType } from '../../framework';
79
80
  import ImageControl from './designer';
81
+ var MB10 = 10485760;
82
+ var MB30 = 31457280;
83
+ var ImageControlPropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
84
+ "use strict";
85
+ _inherits(ImageControlPropertyRules, BaseControlPropertyRules);
86
+ function ImageControlPropertyRules(props) {
87
+ _class_call_check(this, ImageControlPropertyRules);
88
+ var _this;
89
+ _this = _call_super(this, ImageControlPropertyRules, [
90
+ props
91
+ ]), _define_property(_this, "maxSize", {
92
+ type: 'number',
93
+ min: 0,
94
+ max: MB30,
95
+ message: getLocaleText('CMD.attachmentMaxSize', null, '附件大小必须在0MB至30MB之间')
96
+ });
97
+ return _this;
98
+ }
99
+ return ImageControlPropertyRules;
100
+ }(BaseControlPropertyRules);
80
101
  var ImageProperty = /*#__PURE__*/ function(AttachmentProperty) {
81
102
  "use strict";
82
103
  _inherits(ImageProperty, AttachmentProperty);
83
104
  function ImageProperty(props) {
84
105
  _class_call_check(this, ImageProperty);
85
106
  var _this;
86
- var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
107
+ var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
87
108
  _this = _call_super(this, ImageProperty, [
88
109
  props
89
- ]), _define_property(_this, "compressTypeCode", void 0), _define_property(_this, "compressRatio", void 0), _define_property(_this, "maxPixel", void 0);
110
+ ]), _define_property(_this, "compressTypeCode", void 0), _define_property(_this, "compressRatio", void 0), _define_property(_this, "maxPixel", void 0), _define_property(_this, "maxSize", void 0);
90
111
  _this.showType = 'image';
91
112
  _this.maxLimit = (_ref = props === null || props === void 0 ? void 0 : props.maxLimit) !== null && _ref !== void 0 ? _ref : 10;
92
113
  _this.caption = (_ref1 = (_ref2 = props === null || props === void 0 ? void 0 : props.caption) !== null && _ref2 !== void 0 ? _ref2 : ImageControl.controlName) !== null && _ref1 !== void 0 ? _ref1 : getLocaleText('CMD.image', null, '图片');
@@ -94,9 +115,11 @@ var ImageProperty = /*#__PURE__*/ function(AttachmentProperty) {
94
115
  _this.compressTypeCode = (_ref4 = props === null || props === void 0 ? void 0 : props.compressTypeCode) !== null && _ref4 !== void 0 ? _ref4 : ImageCompressType.NO_COMPRESS; // 默认不压缩
95
116
  _this.compressRatio = (_ref5 = props === null || props === void 0 ? void 0 : props.compressRatio) !== null && _ref5 !== void 0 ? _ref5 : 1; // 默认压缩比例1
96
117
  _this.maxPixel = (_ref6 = props === null || props === void 0 ? void 0 : props.maxPixel) !== null && _ref6 !== void 0 ? _ref6 : 1080; // 默认最大像素1080
118
+ _this.maxSize = (_ref7 = props === null || props === void 0 ? void 0 : props.maxSize) !== null && _ref7 !== void 0 ? _ref7 : MB10;
97
119
  return _this;
98
120
  }
99
121
  return ImageProperty;
100
122
  }(AttachmentProperty);
123
+ _define_property(ImageProperty, "Rules", ImageControlPropertyRules);
101
124
  export default ImageProperty;
102
125
  export { ImageProperty };
@@ -105,6 +105,7 @@ function _inherits(subClass, superClass) {
105
105
  if (superClass) _set_prototype_of(subClass, superClass);
106
106
  }
107
107
  function _instanceof(left, right) {
108
+ "@swc/helpers - instanceof";
108
109
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
109
110
  return !!right[Symbol.hasInstance](left);
110
111
  } else {