@byteluck-fe/model-driven-core 2.5.0-beta.9 → 2.5.3

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.
Files changed (44) hide show
  1. package/dist/esm/api-doc-index.js +4 -4
  2. package/dist/esm/common/BaseControl/designer.js +241 -121
  3. package/dist/esm/common/BaseControl/index.js +7 -7
  4. package/dist/esm/common/BaseControl/property.js +77 -60
  5. package/dist/esm/common/BaseControl/runtime.js +45 -24
  6. package/dist/esm/common/ColumnControl/designer.js +41 -27
  7. package/dist/esm/common/ColumnControl/index.js +6 -6
  8. package/dist/esm/common/ColumnControl/property.js +122 -74
  9. package/dist/esm/common/ColumnControl/runtime.js +41 -27
  10. package/dist/esm/common/ControlArray.js +21 -21
  11. package/dist/esm/common/FormControl/designer.js +47 -32
  12. package/dist/esm/common/FormControl/index.js +6 -6
  13. package/dist/esm/common/FormControl/property.js +181 -116
  14. package/dist/esm/common/FormControl/runtime.js +42 -27
  15. package/dist/esm/common/LayoutControl/designer.js +205 -77
  16. package/dist/esm/common/LayoutControl/index.js +6 -6
  17. package/dist/esm/common/LayoutControl/property.js +25 -25
  18. package/dist/esm/common/LayoutControl/runtime.js +44 -29
  19. package/dist/esm/common/ListControl/designer.js +199 -74
  20. package/dist/esm/common/ListControl/index.js +6 -6
  21. package/dist/esm/common/ListControl/property.js +41 -27
  22. package/dist/esm/common/ListControl/runtime.js +47 -32
  23. package/dist/esm/common/SearchViewControl/designer.js +41 -27
  24. package/dist/esm/common/SearchViewControl/index.js +6 -6
  25. package/dist/esm/common/SearchViewControl/property.js +40 -26
  26. package/dist/esm/common/SearchViewControl/runtime.js +41 -27
  27. package/dist/esm/common/Validator.js +5 -5
  28. package/dist/esm/common/WrapControl/designer.js +41 -27
  29. package/dist/esm/common/WrapControl/index.js +6 -6
  30. package/dist/esm/common/WrapControl/property.js +25 -25
  31. package/dist/esm/common/WrapControl/runtime.js +41 -27
  32. package/dist/esm/common/controlHooksEmitter.js +1 -1
  33. package/dist/esm/common/index.js +12 -12
  34. package/dist/esm/common/initLinkOperationRules.js +6 -6
  35. package/dist/esm/common/initOptionAndDataSourceRules.js +82 -82
  36. package/dist/esm/framework/RegisterControls.js +31 -19
  37. package/dist/esm/framework/index.js +825 -405
  38. package/dist/esm/index.js +3 -3
  39. package/dist/index.umd.js +1 -1
  40. package/dist/types/common/Validator.d.ts +1 -1
  41. package/dist/types/common/controlHooksEmitter.d.ts +1 -1
  42. package/dist/types/framework/index.d.ts +2 -1
  43. package/dist/types/type.d.ts +23 -23
  44. package/package.json +3 -3
@@ -1,19 +1,32 @@
1
- function _assertThisInitialized(self) {
1
+ function _assert_this_initialized(self) {
2
2
  if (self === void 0) {
3
3
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
4
  }
5
5
  return self;
6
6
  }
7
- function _classCallCheck(instance, Constructor) {
7
+ function _class_call_check(instance, Constructor) {
8
8
  if (!(instance instanceof Constructor)) {
9
9
  throw new TypeError("Cannot call a class as a function");
10
10
  }
11
11
  }
12
- function _getPrototypeOf(o) {
13
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
12
+ function _define_property(obj, key, value) {
13
+ if (key in obj) {
14
+ Object.defineProperty(obj, key, {
15
+ value: value,
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ } else {
21
+ obj[key] = value;
22
+ }
23
+ return obj;
24
+ }
25
+ function _get_prototype_of(o) {
26
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
14
27
  return o.__proto__ || Object.getPrototypeOf(o);
15
28
  };
16
- return _getPrototypeOf(o);
29
+ return _get_prototype_of(o);
17
30
  }
18
31
  function _inherits(subClass, superClass) {
19
32
  if (typeof superClass !== "function" && superClass !== null) {
@@ -26,26 +39,26 @@ function _inherits(subClass, superClass) {
26
39
  configurable: true
27
40
  }
28
41
  });
29
- if (superClass) _setPrototypeOf(subClass, superClass);
42
+ if (superClass) _set_prototype_of(subClass, superClass);
30
43
  }
31
- function _possibleConstructorReturn(self, call) {
32
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
44
+ function _possible_constructor_return(self, call) {
45
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
33
46
  return call;
34
47
  }
35
- return _assertThisInitialized(self);
48
+ return _assert_this_initialized(self);
36
49
  }
37
- function _setPrototypeOf(o, p) {
38
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
50
+ function _set_prototype_of(o, p) {
51
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
39
52
  o.__proto__ = p;
40
53
  return o;
41
54
  };
42
- return _setPrototypeOf(o, p);
55
+ return _set_prototype_of(o, p);
43
56
  }
44
- var _typeof = function(obj) {
57
+ function _type_of(obj) {
45
58
  "@swc/helpers - typeof";
46
59
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
47
- };
48
- function _isNativeReflectConstruct() {
60
+ }
61
+ function _is_native_reflect_construct() {
49
62
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
50
63
  if (Reflect.construct.sham) return false;
51
64
  if (typeof Proxy === "function") return true;
@@ -56,107 +69,142 @@ function _isNativeReflectConstruct() {
56
69
  return false;
57
70
  }
58
71
  }
59
- function _createSuper(Derived) {
60
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
72
+ function _create_super(Derived) {
73
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
61
74
  return function _createSuperInternal() {
62
- var Super = _getPrototypeOf(Derived), result;
75
+ var Super = _get_prototype_of(Derived), result;
63
76
  if (hasNativeReflectConstruct) {
64
- var NewTarget = _getPrototypeOf(this).constructor;
77
+ var NewTarget = _get_prototype_of(this).constructor;
65
78
  result = Reflect.construct(Super, arguments, NewTarget);
66
79
  } else {
67
80
  result = Super.apply(this, arguments);
68
81
  }
69
- return _possibleConstructorReturn(this, result);
82
+ return _possible_constructor_return(this, result);
70
83
  };
71
84
  }
72
- import { Property, PropertyRules } from '../BaseControl';
73
- import { RulesMessage } from '@byteluck-fe/model-driven-shared';
74
- import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
75
- import { DataBind, AutoWidth } from '../../framework';
76
- var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules1) {
85
+ import { Property, PropertyRules } from "../BaseControl";
86
+ import { RulesMessage } from "@byteluck-fe/model-driven-shared";
87
+ import { initOptionAndDataSourceRules } from "../initOptionAndDataSourceRules";
88
+ import { DataBind, AutoWidth } from "../../framework";
89
+ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
77
90
  "use strict";
78
- _inherits(ColumnControlPropertyRules, PropertyRules1);
79
- var _super = _createSuper(ColumnControlPropertyRules);
91
+ _inherits(ColumnControlPropertyRules, PropertyRules);
92
+ var _super = _create_super(ColumnControlPropertyRules);
80
93
  function ColumnControlPropertyRules(props) {
81
- _classCallCheck(this, ColumnControlPropertyRules);
94
+ _class_call_check(this, ColumnControlPropertyRules);
82
95
  var _this;
83
96
  _this = _super.call(this, props);
84
- _this.caption = {
85
- type: 'string',
97
+ _define_property(_assert_this_initialized(_this), "caption", {
98
+ type: "string",
86
99
  required: true,
87
- message: RulesMessage.getMessage('pleaseEnterCaption')
88
- };
89
- _this.width = {
90
- type: 'number',
100
+ message: RulesMessage.getMessage("pleaseEnterCaption")
101
+ });
102
+ _define_property(_assert_this_initialized(_this), "width", {
103
+ type: "number",
91
104
  required: false,
92
- message: RulesMessage.getMessage('pleaseEnterColumnWidth')
93
- };
94
- _this.width.required = props.widthType === 'px';
105
+ message: RulesMessage.getMessage("pleaseEnterColumnWidth")
106
+ });
107
+ _this.width.required = props.widthType === "px";
95
108
  return _this;
96
109
  }
97
110
  return ColumnControlPropertyRules;
98
111
  }(PropertyRules);
99
- var ColumnControlProperty = /**
112
+ /**
100
113
  * 列基本属性
101
114
  * @public
102
- */ /*#__PURE__*/ function(Property1) {
115
+ */ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
103
116
  "use strict";
104
- _inherits(ColumnControlProperty, Property1);
105
- var _super = _createSuper(ColumnControlProperty);
117
+ _inherits(ColumnControlProperty, Property);
118
+ var _super = _create_super(ColumnControlProperty);
106
119
  function ColumnControlProperty(props) {
107
- _classCallCheck(this, ColumnControlProperty);
120
+ _class_call_check(this, ColumnControlProperty);
108
121
  var _this;
109
122
  _this = _super.call(this, props);
110
- var ref;
111
- _this.width = (ref = props === null || props === void 0 ? void 0 : props.width) !== null && ref !== void 0 ? ref : 150;
112
- _this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || 'auto';
113
- var ref1;
114
- _this.caption = (ref1 = props === null || props === void 0 ? void 0 : props.caption) !== null && ref1 !== void 0 ? ref1 : '';
115
- var ref2;
116
- _this.fixed = (ref2 = props === null || props === void 0 ? void 0 : props.fixed) !== null && ref2 !== void 0 ? ref2 : 'none';
123
+ /**
124
+ * 宽度类型
125
+ * @defaultValue 'auto'
126
+ */ _define_property(_assert_this_initialized(_this), "widthType", void 0);
127
+ /**
128
+ * 宽度
129
+ * @defaultValue 150
130
+ */ _define_property(_assert_this_initialized(_this), "width", void 0);
131
+ /**
132
+ * 标题
133
+ */ _define_property(_assert_this_initialized(_this), "caption", void 0);
134
+ /**
135
+ * 绑定数据项
136
+ */ _define_property(_assert_this_initialized(_this), "dataBind", void 0);
137
+ /**
138
+ * 自适应页面宽度
139
+ */ _define_property(_assert_this_initialized(_this), "autoWidth", void 0);
140
+ /**
141
+ * 冻结
142
+ * @defaultValue 'none'
143
+ */ _define_property(_assert_this_initialized(_this), "fixed", void 0);
144
+ /**
145
+ * 表头排序
146
+ * @defaultValue true
147
+ */ _define_property(_assert_this_initialized(_this), "sort", void 0);
148
+ /**
149
+ * 对齐
150
+ */ _define_property(_assert_this_initialized(_this), "align", void 0);
151
+ /**
152
+ * @internal
153
+ */ _define_property(_assert_this_initialized(_this), "colSpan", void 0);
154
+ /**
155
+ * 自动高度
156
+ * @defaultValue false
157
+ */ _define_property(_assert_this_initialized(_this), "autoHeight", void 0);
158
+ var _props_width;
159
+ _this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
160
+ _this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || "auto";
161
+ var _props_caption;
162
+ _this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
163
+ var _props_fixed;
164
+ _this.fixed = (_props_fixed = props === null || props === void 0 ? void 0 : props.fixed) !== null && _props_fixed !== void 0 ? _props_fixed : "none";
117
165
  _this.autoWidth = new AutoWidth(props === null || props === void 0 ? void 0 : props.autoWidth);
118
166
  _this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
119
- var ref3;
120
- _this.sort = (ref3 = props === null || props === void 0 ? void 0 : props.sort) !== null && ref3 !== void 0 ? ref3 : true;
167
+ var _props_sort;
168
+ _this.sort = (_props_sort = props === null || props === void 0 ? void 0 : props.sort) !== null && _props_sort !== void 0 ? _props_sort : true;
121
169
  _this.align = props === null || props === void 0 ? void 0 : props.align;
122
170
  _this.colSpan = props === null || props === void 0 ? void 0 : props.colSpan;
123
- var ref4;
124
- _this.autoHeight = (ref4 = props === null || props === void 0 ? void 0 : props.autoHeight) !== null && ref4 !== void 0 ? ref4 : false;
171
+ var _props_autoHeight;
172
+ _this.autoHeight = (_props_autoHeight = props === null || props === void 0 ? void 0 : props.autoHeight) !== null && _props_autoHeight !== void 0 ? _props_autoHeight : false;
125
173
  return _this;
126
174
  }
127
175
  return ColumnControlProperty;
128
176
  }(Property);
129
- ColumnControlProperty.Rules = ColumnControlPropertyRules;
177
+ _define_property(ColumnControlProperty, "Rules", ColumnControlPropertyRules);
130
178
  var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnControlPropertyRules) {
131
179
  "use strict";
132
180
  _inherits(ColumnOptionAndDataSourcePropertyRules, ColumnControlPropertyRules);
133
- var _super = _createSuper(ColumnOptionAndDataSourcePropertyRules);
181
+ var _super = _create_super(ColumnOptionAndDataSourcePropertyRules);
134
182
  function ColumnOptionAndDataSourcePropertyRules(props) {
135
- _classCallCheck(this, ColumnOptionAndDataSourcePropertyRules);
183
+ _class_call_check(this, ColumnOptionAndDataSourcePropertyRules);
136
184
  var _this;
137
185
  _this = _super.call(this, props);
138
- _this.optionConfig = {
139
- type: 'enum',
186
+ _define_property(_assert_this_initialized(_this), "optionConfig", {
187
+ type: "enum",
140
188
  enum: [
141
- 'custom',
142
- 'datasource',
143
- 'none'
189
+ "custom",
190
+ "datasource",
191
+ "none"
144
192
  ],
145
- message: RulesMessage.getMessage('PleaseSelectTheCorrectOptionSettings')
146
- };
147
- _this.options = [
193
+ message: RulesMessage.getMessage("PleaseSelectTheCorrectOptionSettings")
194
+ });
195
+ _define_property(_assert_this_initialized(_this), "options", [
148
196
  {
149
- type: 'array',
150
- message: RulesMessage.getMessage('isNotArray')
151
- },
152
- ];
153
- _this.datasourceBind = [
197
+ type: "array",
198
+ message: RulesMessage.getMessage("isNotArray")
199
+ }
200
+ ]);
201
+ _define_property(_assert_this_initialized(_this), "datasourceBind", [
154
202
  {
155
- type: 'object',
156
- message: RulesMessage.getMessage('isNotObject')
157
- },
158
- ];
159
- initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
203
+ type: "object",
204
+ message: RulesMessage.getMessage("isNotObject")
205
+ }
206
+ ]);
207
+ initOptionAndDataSourceRules.call(_assert_this_initialized(_this), props);
160
208
  return _this;
161
209
  }
162
210
  return ColumnOptionAndDataSourcePropertyRules;
@@ -1,19 +1,32 @@
1
- function _assertThisInitialized(self) {
1
+ function _assert_this_initialized(self) {
2
2
  if (self === void 0) {
3
3
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
4
  }
5
5
  return self;
6
6
  }
7
- function _classCallCheck(instance, Constructor) {
7
+ function _class_call_check(instance, Constructor) {
8
8
  if (!(instance instanceof Constructor)) {
9
9
  throw new TypeError("Cannot call a class as a function");
10
10
  }
11
11
  }
12
- function _getPrototypeOf(o) {
13
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
12
+ function _define_property(obj, key, value) {
13
+ if (key in obj) {
14
+ Object.defineProperty(obj, key, {
15
+ value: value,
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ } else {
21
+ obj[key] = value;
22
+ }
23
+ return obj;
24
+ }
25
+ function _get_prototype_of(o) {
26
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
14
27
  return o.__proto__ || Object.getPrototypeOf(o);
15
28
  };
16
- return _getPrototypeOf(o);
29
+ return _get_prototype_of(o);
17
30
  }
18
31
  function _inherits(subClass, superClass) {
19
32
  if (typeof superClass !== "function" && superClass !== null) {
@@ -26,26 +39,26 @@ function _inherits(subClass, superClass) {
26
39
  configurable: true
27
40
  }
28
41
  });
29
- if (superClass) _setPrototypeOf(subClass, superClass);
42
+ if (superClass) _set_prototype_of(subClass, superClass);
30
43
  }
31
- function _possibleConstructorReturn(self, call) {
32
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
44
+ function _possible_constructor_return(self, call) {
45
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
33
46
  return call;
34
47
  }
35
- return _assertThisInitialized(self);
48
+ return _assert_this_initialized(self);
36
49
  }
37
- function _setPrototypeOf(o, p) {
38
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
50
+ function _set_prototype_of(o, p) {
51
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
39
52
  o.__proto__ = p;
40
53
  return o;
41
54
  };
42
- return _setPrototypeOf(o, p);
55
+ return _set_prototype_of(o, p);
43
56
  }
44
- var _typeof = function(obj) {
57
+ function _type_of(obj) {
45
58
  "@swc/helpers - typeof";
46
59
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
47
- };
48
- function _isNativeReflectConstruct() {
60
+ }
61
+ function _is_native_reflect_construct() {
49
62
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
50
63
  if (Reflect.construct.sham) return false;
51
64
  if (typeof Proxy === "function") return true;
@@ -56,30 +69,31 @@ function _isNativeReflectConstruct() {
56
69
  return false;
57
70
  }
58
71
  }
59
- function _createSuper(Derived) {
60
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
72
+ function _create_super(Derived) {
73
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
61
74
  return function _createSuperInternal() {
62
- var Super = _getPrototypeOf(Derived), result;
75
+ var Super = _get_prototype_of(Derived), result;
63
76
  if (hasNativeReflectConstruct) {
64
- var NewTarget = _getPrototypeOf(this).constructor;
77
+ var NewTarget = _get_prototype_of(this).constructor;
65
78
  result = Reflect.construct(Super, arguments, NewTarget);
66
79
  } else {
67
80
  result = Super.apply(this, arguments);
68
81
  }
69
- return _possibleConstructorReturn(this, result);
82
+ return _possible_constructor_return(this, result);
70
83
  };
71
84
  }
72
- import { RuntimeControl } from '../BaseControl';
73
- import ColumnControlProperty from './property';
74
- var ColumnControl = /*#__PURE__*/ function(RuntimeControl1) {
85
+ import { RuntimeControl } from "../BaseControl";
86
+ import ColumnControlProperty from "./property";
87
+ var ColumnControl = /*#__PURE__*/ function(RuntimeControl) {
75
88
  "use strict";
76
- _inherits(ColumnControl, RuntimeControl1);
77
- var _super = _createSuper(ColumnControl);
89
+ _inherits(ColumnControl, RuntimeControl);
90
+ var _super = _create_super(ColumnControl);
78
91
  function ColumnControl(props) {
79
- _classCallCheck(this, ColumnControl);
92
+ _class_call_check(this, ColumnControl);
80
93
  var _this;
81
94
  _this = _super.call(this, props);
82
- _this.controlType = 'column';
95
+ _define_property(_assert_this_initialized(_this), "controlType", "column");
96
+ _define_property(_assert_this_initialized(_this), "props", void 0);
83
97
  _this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
84
98
  return _this;
85
99
  }
@@ -1,33 +1,33 @@
1
- function _arrayLikeToArray(arr, len) {
1
+ function _array_like_to_array(arr, len) {
2
2
  if (len == null || len > arr.length) len = arr.length;
3
3
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
4
  return arr2;
5
5
  }
6
- function _arrayWithoutHoles(arr) {
7
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
6
+ function _array_without_holes(arr) {
7
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
8
8
  }
9
- function _iterableToArray(iter) {
9
+ function _iterable_to_array(iter) {
10
10
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11
11
  }
12
- function _nonIterableSpread() {
12
+ function _non_iterable_spread() {
13
13
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14
14
  }
15
- function _toConsumableArray(arr) {
16
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
15
+ function _to_consumable_array(arr) {
16
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
17
17
  }
18
- function _unsupportedIterableToArray(o, minLen) {
18
+ function _unsupported_iterable_to_array(o, minLen) {
19
19
  if (!o) return;
20
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
20
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
21
21
  var n = Object.prototype.toString.call(o).slice(8, -1);
22
22
  if (n === "Object" && o.constructor) n = o.constructor.name;
23
23
  if (n === "Map" || n === "Set") return Array.from(n);
24
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
24
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
25
25
  }
26
- import { isArray, isPlainObject } from '@byteluck-fe/model-driven-shared';
26
+ import { isArray, isPlainObject } from "@byteluck-fe/model-driven-shared";
27
27
  export function setPropertyDontEnum(obj, property) {
28
- var ref;
29
- // 如果没有被设置过不允许枚举的话,说明是第一次被设置,需要设置属性不允许枚举
30
- if ((ref = Object.getOwnPropertyDescriptors(obj)[property]) === null || ref === void 0 ? void 0 : ref.enumerable) {
28
+ var _Object_getOwnPropertyDescriptors_property;
29
+ //如果没有被设置过不允许枚举的话,说明是第一次被设置,需要设置属性不允许枚举
30
+ if ((_Object_getOwnPropertyDescriptors_property = Object.getOwnPropertyDescriptors(obj)[property]) === null || _Object_getOwnPropertyDescriptors_property === void 0 ? void 0 : _Object_getOwnPropertyDescriptors_property.enumerable) {
31
31
  Object.defineProperty(obj, property, {
32
32
  enumerable: false
33
33
  });
@@ -36,17 +36,17 @@ export function setPropertyDontEnum(obj, property) {
36
36
  export function defineParent(control, parent) {
37
37
  control.parent = parent;
38
38
  // 如果没有被设置过不允许枚举的话,说明是第一次被代理,需要设置parent属性不允许枚举
39
- setPropertyDontEnum(control, 'parent');
39
+ setPropertyDontEnum(control, "parent");
40
40
  }
41
41
  export function defineArrayParent(controls, parent) {
42
42
  controls.forEach(function(item) {
43
43
  defineParent(item, parent);
44
44
  });
45
45
  }
46
- var targetKey = Symbol('targetKey');
46
+ var targetKey = Symbol("targetKey");
47
47
  function getTargetValue(value) {
48
- var _targetKey;
49
- return (_targetKey = value[targetKey]) !== null && _targetKey !== void 0 ? _targetKey : value;
48
+ var _value_targetKey;
49
+ return (_value_targetKey = value[targetKey]) !== null && _value_targetKey !== void 0 ? _value_targetKey : value;
50
50
  }
51
51
  function proxyState(target, parent) {
52
52
  defineArrayParent(target, parent);
@@ -62,7 +62,7 @@ function proxyState(target, parent) {
62
62
  return (_Reflect = Reflect).get.apply(_Reflect, [
63
63
  t,
64
64
  p
65
- ].concat(_toConsumableArray(args)));
65
+ ].concat(_to_consumable_array(args)));
66
66
  },
67
67
  set: function set(t, property, value) {
68
68
  for(var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++){
@@ -70,14 +70,14 @@ function proxyState(target, parent) {
70
70
  }
71
71
  var _Reflect;
72
72
  // 更改长度为当前长度,代表没变,直接返回true,否则在safari 13.x版本的严格模式会引起页面崩溃
73
- if (isArray(target) && property === 'length' && value === target.length) {
73
+ if (isArray(target) && property === "length" && value === target.length) {
74
74
  return true;
75
75
  }
76
76
  var result = (_Reflect = Reflect).set.apply(_Reflect, [
77
77
  t,
78
78
  property,
79
79
  value
80
- ].concat(_toConsumableArray(args)));
80
+ ].concat(_to_consumable_array(args)));
81
81
  if (isPlainObject(value)) {
82
82
  defineParent(value, parent);
83
83
  }
@@ -1,19 +1,32 @@
1
- function _assertThisInitialized(self) {
1
+ function _assert_this_initialized(self) {
2
2
  if (self === void 0) {
3
3
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
4
  }
5
5
  return self;
6
6
  }
7
- function _classCallCheck(instance, Constructor) {
7
+ function _class_call_check(instance, Constructor) {
8
8
  if (!(instance instanceof Constructor)) {
9
9
  throw new TypeError("Cannot call a class as a function");
10
10
  }
11
11
  }
12
- function _getPrototypeOf(o) {
13
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
12
+ function _define_property(obj, key, value) {
13
+ if (key in obj) {
14
+ Object.defineProperty(obj, key, {
15
+ value: value,
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ } else {
21
+ obj[key] = value;
22
+ }
23
+ return obj;
24
+ }
25
+ function _get_prototype_of(o) {
26
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
14
27
  return o.__proto__ || Object.getPrototypeOf(o);
15
28
  };
16
- return _getPrototypeOf(o);
29
+ return _get_prototype_of(o);
17
30
  }
18
31
  function _inherits(subClass, superClass) {
19
32
  if (typeof superClass !== "function" && superClass !== null) {
@@ -26,26 +39,26 @@ function _inherits(subClass, superClass) {
26
39
  configurable: true
27
40
  }
28
41
  });
29
- if (superClass) _setPrototypeOf(subClass, superClass);
42
+ if (superClass) _set_prototype_of(subClass, superClass);
30
43
  }
31
- function _possibleConstructorReturn(self, call) {
32
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
44
+ function _possible_constructor_return(self, call) {
45
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
33
46
  return call;
34
47
  }
35
- return _assertThisInitialized(self);
48
+ return _assert_this_initialized(self);
36
49
  }
37
- function _setPrototypeOf(o, p) {
38
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
50
+ function _set_prototype_of(o, p) {
51
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
39
52
  o.__proto__ = p;
40
53
  return o;
41
54
  };
42
- return _setPrototypeOf(o, p);
55
+ return _set_prototype_of(o, p);
43
56
  }
44
- var _typeof = function(obj) {
57
+ function _type_of(obj) {
45
58
  "@swc/helpers - typeof";
46
59
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
47
- };
48
- function _isNativeReflectConstruct() {
60
+ }
61
+ function _is_native_reflect_construct() {
49
62
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
50
63
  if (Reflect.construct.sham) return false;
51
64
  if (typeof Proxy === "function") return true;
@@ -56,39 +69,41 @@ function _isNativeReflectConstruct() {
56
69
  return false;
57
70
  }
58
71
  }
59
- function _createSuper(Derived) {
60
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
72
+ function _create_super(Derived) {
73
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
61
74
  return function _createSuperInternal() {
62
- var Super = _getPrototypeOf(Derived), result;
75
+ var Super = _get_prototype_of(Derived), result;
63
76
  if (hasNativeReflectConstruct) {
64
- var NewTarget = _getPrototypeOf(this).constructor;
77
+ var NewTarget = _get_prototype_of(this).constructor;
65
78
  result = Reflect.construct(Super, arguments, NewTarget);
66
79
  } else {
67
80
  result = Super.apply(this, arguments);
68
81
  }
69
- return _possibleConstructorReturn(this, result);
82
+ return _possible_constructor_return(this, result);
70
83
  };
71
84
  }
72
- import { DesignerControl } from '../BaseControl';
73
- import BaseControlProperty from './property';
74
- var FormControl = /*#__PURE__*/ function(DesignerControl1) {
85
+ import { DesignerControl } from "../BaseControl";
86
+ import BaseControlProperty from "./property";
87
+ var FormControl = /*#__PURE__*/ function(DesignerControl) {
75
88
  "use strict";
76
- _inherits(FormControl, DesignerControl1);
77
- var _super = _createSuper(FormControl);
89
+ _inherits(FormControl, DesignerControl);
90
+ var _super = _create_super(FormControl);
78
91
  function FormControl(props) {
79
- _classCallCheck(this, FormControl);
92
+ _class_call_check(this, FormControl);
80
93
  var _this;
81
94
  _this = _super.call(this, props);
82
- _this.controlType = 'form';
95
+ _define_property(_assert_this_initialized(_this), "controlType", "form");
96
+ _define_property(_assert_this_initialized(_this), "props", void 0);
83
97
  _this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
84
98
  return _this;
85
99
  }
86
100
  return FormControl;
87
101
  }(DesignerControl);
88
- FormControl.controlEventKeys = [
89
- 'on_change',
90
- 'on_focus',
91
- 'on_blur',
92
- ];
102
+ _define_property(FormControl, "controlEventKeys", [
103
+ "on_change",
104
+ "on_focus",
105
+ "on_blur"
106
+ ]);
107
+ _define_property(FormControl, "controlCustomAttributes", void 0);
93
108
  export default FormControl;
94
109
  export { FormControl as DesignerFormControl };
@@ -1,11 +1,11 @@
1
- import Designer from './designer';
2
- import Runtime from './runtime';
3
- import Property from './property';
1
+ import Designer from "./designer";
2
+ import Runtime from "./runtime";
3
+ import Property from "./property";
4
4
  export default {
5
5
  Designer: Designer,
6
6
  Runtime: Runtime,
7
7
  Property: Property
8
8
  };
9
- export * from './designer';
10
- export * from './runtime';
11
- export * from './property';
9
+ export * from "./designer";
10
+ export * from "./runtime";
11
+ export * from "./property";