@byteluck-fe/model-driven-core 2.7.0-alpha.2 → 2.7.0-alpha.21

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 (33) hide show
  1. package/dist/esm/common/BaseControl/designer.js +259 -220
  2. package/dist/esm/common/BaseControl/property.js +68 -53
  3. package/dist/esm/common/BaseControl/runtime.js +37 -15
  4. package/dist/esm/common/ColumnControl/designer.js +39 -24
  5. package/dist/esm/common/ColumnControl/property.js +97 -48
  6. package/dist/esm/common/ColumnControl/runtime.js +39 -24
  7. package/dist/esm/common/ControlArray.js +12 -12
  8. package/dist/esm/common/FormControl/designer.js +42 -26
  9. package/dist/esm/common/FormControl/property.js +130 -69
  10. package/dist/esm/common/FormControl/runtime.js +40 -24
  11. package/dist/esm/common/LayoutControl/designer.js +151 -116
  12. package/dist/esm/common/LayoutControl/property.js +22 -22
  13. package/dist/esm/common/LayoutControl/runtime.js +41 -25
  14. package/dist/esm/common/ListControl/designer.js +141 -106
  15. package/dist/esm/common/ListControl/property.js +40 -23
  16. package/dist/esm/common/ListControl/runtime.js +43 -27
  17. package/dist/esm/common/SearchViewControl/designer.js +39 -24
  18. package/dist/esm/common/SearchViewControl/property.js +38 -23
  19. package/dist/esm/common/SearchViewControl/runtime.js +39 -24
  20. package/dist/esm/common/WrapControl/designer.js +39 -24
  21. package/dist/esm/common/WrapControl/property.js +22 -22
  22. package/dist/esm/common/WrapControl/runtime.js +39 -24
  23. package/dist/esm/framework/RegisterControls.js +215 -130
  24. package/dist/esm/framework/index.js +714 -248
  25. package/dist/esm/framework/isDataBind.js +8 -0
  26. package/dist/esm/index.js +1 -0
  27. package/dist/index.umd.js +1 -1
  28. package/dist/types/common/ColumnControl/property.d.ts +1 -1
  29. package/dist/types/common/ListControl/property.d.ts +2 -0
  30. package/dist/types/framework/index.d.ts +3 -2
  31. package/dist/types/framework/isDataBind.d.ts +2 -0
  32. package/dist/types/index.d.ts +1 -0
  33. package/package.json +3 -3
@@ -1,47 +1,49 @@
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 isNativeReflectConstruct() {
13
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
14
- if (Reflect.construct.sham) return false;
15
- if (typeof Proxy === "function") return true;
16
- try {
17
- Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));
18
- return true;
19
- } catch (e) {
20
- return false;
21
- }
22
- }
23
12
  function _construct(Parent, args, Class) {
24
- if (isNativeReflectConstruct()) {
13
+ if (_is_native_reflect_construct()) {
25
14
  _construct = Reflect.construct;
26
15
  } else {
27
- _construct = function _construct(Parent, args, Class) {
16
+ _construct = function construct(Parent, args, Class) {
28
17
  var a = [
29
18
  null
30
19
  ];
31
20
  a.push.apply(a, args);
32
21
  var Constructor = Function.bind.apply(Parent, a);
33
22
  var instance = new Constructor();
34
- if (Class) _setPrototypeOf(instance, Class.prototype);
23
+ if (Class) _set_prototype_of(instance, Class.prototype);
35
24
  return instance;
36
25
  };
37
26
  }
38
27
  return _construct.apply(null, arguments);
39
28
  }
40
- function _getPrototypeOf(o) {
41
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
29
+ function _define_property(obj, key, value) {
30
+ if (key in obj) {
31
+ Object.defineProperty(obj, key, {
32
+ value: value,
33
+ enumerable: true,
34
+ configurable: true,
35
+ writable: true
36
+ });
37
+ } else {
38
+ obj[key] = value;
39
+ }
40
+ return obj;
41
+ }
42
+ function _get_prototype_of(o) {
43
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
42
44
  return o.__proto__ || Object.getPrototypeOf(o);
43
45
  };
44
- return _getPrototypeOf(o);
46
+ return _get_prototype_of(o);
45
47
  }
46
48
  function _inherits(subClass, superClass) {
47
49
  if (typeof superClass !== "function" && superClass !== null) {
@@ -54,32 +56,32 @@ function _inherits(subClass, superClass) {
54
56
  configurable: true
55
57
  }
56
58
  });
57
- if (superClass) _setPrototypeOf(subClass, superClass);
59
+ if (superClass) _set_prototype_of(subClass, superClass);
58
60
  }
59
- function _isNativeFunction(fn) {
61
+ function _is_native_function(fn) {
60
62
  return Function.toString.call(fn).indexOf("[native code]") !== -1;
61
63
  }
62
- function _possibleConstructorReturn(self, call) {
63
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
64
+ function _possible_constructor_return(self, call) {
65
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
64
66
  return call;
65
67
  }
66
- return _assertThisInitialized(self);
68
+ return _assert_this_initialized(self);
67
69
  }
68
- function _setPrototypeOf(o, p) {
69
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
70
+ function _set_prototype_of(o, p) {
71
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
70
72
  o.__proto__ = p;
71
73
  return o;
72
74
  };
73
- return _setPrototypeOf(o, p);
75
+ return _set_prototype_of(o, p);
74
76
  }
75
- var _typeof = function(obj) {
77
+ function _type_of(obj) {
76
78
  "@swc/helpers - typeof";
77
79
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
78
- };
79
- function _wrapNativeSuper(Class) {
80
+ }
81
+ function _wrap_native_super(Class) {
80
82
  var _cache = typeof Map === "function" ? new Map() : undefined;
81
- _wrapNativeSuper = function _wrapNativeSuper(Class) {
82
- if (Class === null || !_isNativeFunction(Class)) return Class;
83
+ _wrap_native_super = function wrapNativeSuper(Class) {
84
+ if (Class === null || !_is_native_function(Class)) return Class;
83
85
  if (typeof Class !== "function") {
84
86
  throw new TypeError("Super expression must either be null or a function");
85
87
  }
@@ -88,7 +90,7 @@ function _wrapNativeSuper(Class) {
88
90
  _cache.set(Class, Wrapper);
89
91
  }
90
92
  function Wrapper() {
91
- return _construct(Class, arguments, _getPrototypeOf(this).constructor);
93
+ return _construct(Class, arguments, _get_prototype_of(this).constructor);
92
94
  }
93
95
  Wrapper.prototype = Object.create(Class.prototype, {
94
96
  constructor: {
@@ -98,11 +100,11 @@ function _wrapNativeSuper(Class) {
98
100
  configurable: true
99
101
  }
100
102
  });
101
- return _setPrototypeOf(Wrapper, Class);
103
+ return _set_prototype_of(Wrapper, Class);
102
104
  };
103
- return _wrapNativeSuper(Class);
105
+ return _wrap_native_super(Class);
104
106
  }
105
- function _isNativeReflectConstruct() {
107
+ function _is_native_reflect_construct() {
106
108
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
107
109
  if (Reflect.construct.sham) return false;
108
110
  if (typeof Proxy === "function") return true;
@@ -113,51 +115,64 @@ function _isNativeReflectConstruct() {
113
115
  return false;
114
116
  }
115
117
  }
116
- function _createSuper(Derived) {
117
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
118
+ function _create_super(Derived) {
119
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
118
120
  return function _createSuperInternal() {
119
- var Super = _getPrototypeOf(Derived), result;
121
+ var Super = _get_prototype_of(Derived), result;
120
122
  if (hasNativeReflectConstruct) {
121
- var NewTarget = _getPrototypeOf(this).constructor;
123
+ var NewTarget = _get_prototype_of(this).constructor;
122
124
  result = Reflect.construct(Super, arguments, NewTarget);
123
125
  } else {
124
126
  result = Super.apply(this, arguments);
125
127
  }
126
- return _possibleConstructorReturn(this, result);
128
+ return _possible_constructor_return(this, result);
127
129
  };
128
130
  }
129
131
  import { BaseStyle } from "../../framework";
130
132
  var PropertyRules = function PropertyRules(props) {
131
133
  "use strict";
132
- _classCallCheck(this, PropertyRules);
133
- this.isHide = {
134
+ _class_call_check(this, PropertyRules);
135
+ _define_property(this, "isHide", {
134
136
  type: "boolean"
135
- };
137
+ });
136
138
  };
137
139
  var PropertyRuntimeRules = /*#__PURE__*/ function(Array1) {
138
140
  "use strict";
139
141
  _inherits(PropertyRuntimeRules, Array1);
140
- var _super = _createSuper(PropertyRuntimeRules);
142
+ var _super = _create_super(PropertyRuntimeRules);
141
143
  function PropertyRuntimeRules(props) {
142
- _classCallCheck(this, PropertyRuntimeRules);
144
+ _class_call_check(this, PropertyRuntimeRules);
143
145
  return _super.call(this);
144
146
  }
145
147
  return PropertyRuntimeRules;
146
- }(_wrapNativeSuper(Array));
148
+ }(_wrap_native_super(Array));
147
149
  /**
148
150
  * 全局属性
149
151
  * @public
150
152
  */ var Property = function Property(props) {
151
153
  "use strict";
152
154
  var caption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
153
- _classCallCheck(this, Property);
155
+ _class_call_check(this, Property);
156
+ var _props, _props1, _props2;
157
+ /**
158
+ * 是否隐藏
159
+ * @public
160
+ * @defaultValue false
161
+ */ _define_property(this, "isHide", void 0);
162
+ _define_property(this, "className", void 0);
163
+ _define_property(this, "style", void 0);
164
+ /**
165
+ * 标题
166
+ * @public
167
+ * @defaultValue ''
168
+ */ _define_property(this, "caption", void 0);
154
169
  var _props_isHide;
155
- this.isHide = (_props_isHide = props === null || props === void 0 ? void 0 : props.isHide) !== null && _props_isHide !== void 0 ? _props_isHide : false;
156
- this.style = new BaseStyle(props === null || props === void 0 ? void 0 : props.style);
170
+ this.isHide = (_props_isHide = (_props = props) === null || _props === void 0 ? void 0 : _props.isHide) !== null && _props_isHide !== void 0 ? _props_isHide : false;
171
+ this.style = new BaseStyle((_props1 = props) === null || _props1 === void 0 ? void 0 : _props1.style);
157
172
  var _props_caption;
158
- this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : caption;
173
+ this.caption = (_props_caption = (_props2 = props) === null || _props2 === void 0 ? void 0 : _props2.caption) !== null && _props_caption !== void 0 ? _props_caption : caption;
159
174
  };
160
- Property.Rules = PropertyRules;
161
- Property.RuntimeRules = PropertyRuntimeRules;
175
+ _define_property(Property, "Rules", PropertyRules);
176
+ _define_property(Property, "RuntimeRules", PropertyRuntimeRules);
162
177
  export default Property;
163
178
  export { Property, PropertyRules, PropertyRuntimeRules };
@@ -1,4 +1,4 @@
1
- function _classCallCheck(instance, Constructor) {
1
+ function _class_call_check(instance, Constructor) {
2
2
  if (!(instance instanceof Constructor)) {
3
3
  throw new TypeError("Cannot call a class as a function");
4
4
  }
@@ -12,11 +12,24 @@ function _defineProperties(target, props) {
12
12
  Object.defineProperty(target, descriptor.key, descriptor);
13
13
  }
14
14
  }
15
- function _createClass(Constructor, protoProps, staticProps) {
15
+ function _create_class(Constructor, protoProps, staticProps) {
16
16
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
17
17
  if (staticProps) _defineProperties(Constructor, staticProps);
18
18
  return Constructor;
19
19
  }
20
+ function _define_property(obj, key, value) {
21
+ if (key in obj) {
22
+ Object.defineProperty(obj, key, {
23
+ value: value,
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true
27
+ });
28
+ } else {
29
+ obj[key] = value;
30
+ }
31
+ return obj;
32
+ }
20
33
  function _instanceof(left, right) {
21
34
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
22
35
  return !!right[Symbol.hasInstance](left);
@@ -30,27 +43,35 @@ import { PAGE_STATUS } from "../../framework";
30
43
  var Control = /*#__PURE__*/ function _target() {
31
44
  "use strict";
32
45
  function Control(props) {
33
- _classCallCheck(this, Control);
34
- this.customEvents = [];
35
- this.parent = null;
46
+ _class_call_check(this, Control);
47
+ var _props, _props1, _props2, _props3, _props4, _props5;
48
+ _define_property(this, "id", void 0 // 唯一标识符
49
+ );
50
+ _define_property(this, "type", void 0);
51
+ _define_property(this, "controlType", void 0);
52
+ _define_property(this, "props", void 0);
53
+ _define_property(this, "fieldType", void 0);
54
+ _define_property(this, "customEvents", []);
55
+ _define_property(this, "pageStatus", void 0);
56
+ _define_property(this, "parent", null);
36
57
  var _ref = _instanceof(this, Control) ? this.constructor : void 0, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, name = _ref.name, controlCustomEvents = _ref.controlCustomEvents;
37
58
  if (!controlType) {
38
59
  referenceError("The ".concat(name, " controlType is not define"));
39
60
  }
40
61
  var _props_id;
41
- this.id = (_props_id = props === null || props === void 0 ? void 0 : props.id) !== null && _props_id !== void 0 ? _props_id : genNonDuplicateId(10);
62
+ this.id = (_props_id = (_props = props) === null || _props === void 0 ? void 0 : _props.id) !== null && _props_id !== void 0 ? _props_id : genNonDuplicateId(10);
42
63
  var _props_type;
43
- this.type = (_props_type = props === null || props === void 0 ? void 0 : props.type) !== null && _props_type !== void 0 ? _props_type : controlType;
44
- this.props = new Property(props === null || props === void 0 ? void 0 : props.props);
64
+ this.type = (_props_type = (_props1 = props) === null || _props1 === void 0 ? void 0 : _props1.type) !== null && _props_type !== void 0 ? _props_type : controlType;
65
+ this.props = new Property((_props2 = props) === null || _props2 === void 0 ? void 0 : _props2.props);
45
66
  this.customEvents = controlCustomEvents;
46
67
  var _props_controlType;
47
- this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : "base";
68
+ this.controlType = (_props_controlType = (_props3 = props) === null || _props3 === void 0 ? void 0 : _props3.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : "base";
48
69
  var _props_fieldType;
49
- this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
70
+ this.fieldType = (_props_fieldType = (_props4 = props) === null || _props4 === void 0 ? void 0 : _props4.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
50
71
  var _props_pageStatus;
51
- this.pageStatus = (_props_pageStatus = props === null || props === void 0 ? void 0 : props.pageStatus) !== null && _props_pageStatus !== void 0 ? _props_pageStatus : PAGE_STATUS.UNKNOWN;
72
+ this.pageStatus = (_props_pageStatus = (_props5 = props) === null || _props5 === void 0 ? void 0 : _props5.pageStatus) !== null && _props_pageStatus !== void 0 ? _props_pageStatus : PAGE_STATUS.UNKNOWN;
52
73
  }
53
- _createClass(Control, [
74
+ _create_class(Control, [
54
75
  {
55
76
  key: "rules",
56
77
  get: function get() {
@@ -65,8 +86,9 @@ var Control = /*#__PURE__*/ function _target() {
65
86
  ]);
66
87
  return Control;
67
88
  }();
68
- Control.controlType = "control";
69
- Control.__is_control__ = true;
70
- Control.controlCustomEvents = [];
89
+ _define_property(Control, "controlType", "control");
90
+ _define_property(Control, "controlFieldType", void 0);
91
+ _define_property(Control, "__is_control__", true);
92
+ _define_property(Control, "controlCustomEvents", []);
71
93
  export default Control;
72
94
  export { Control as RuntimeControl };
@@ -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,17 +69,17 @@ 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
85
  import { DesignerControl } from "../BaseControl";
@@ -74,13 +87,15 @@ import ColumnControlProperty from "./property";
74
87
  var ColumnControl = /*#__PURE__*/ function(DesignerControl) {
75
88
  "use strict";
76
89
  _inherits(ColumnControl, DesignerControl);
77
- var _super = _createSuper(ColumnControl);
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;
94
+ var _props;
81
95
  _this = _super.call(this, props);
82
- _this.controlType = "column";
83
- _this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
96
+ _define_property(_assert_this_initialized(_this), "controlType", "column");
97
+ _define_property(_assert_this_initialized(_this), "props", void 0);
98
+ _this.props = new ColumnControlProperty((_props = props) === null || _props === void 0 ? void 0 : _props.props);
84
99
  return _this;
85
100
  }
86
101
  return ColumnControl;