@byteluck-fe/model-driven-core 2.2.7-beta.1 → 2.3.1-beta.18

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 (28) hide show
  1. package/dist/esm/api-doc-index.js +4 -0
  2. package/dist/esm/common/BaseControl/designer.js +189 -228
  3. package/dist/esm/common/BaseControl/property.js +4 -21
  4. package/dist/esm/common/BaseControl/runtime.js +5 -26
  5. package/dist/esm/common/ColumnControl/designer.js +1 -15
  6. package/dist/esm/common/ColumnControl/property.js +15 -35
  7. package/dist/esm/common/ColumnControl/runtime.js +1 -15
  8. package/dist/esm/common/FormControl/designer.js +3 -18
  9. package/dist/esm/common/FormControl/property.js +21 -45
  10. package/dist/esm/common/FormControl/runtime.js +1 -16
  11. package/dist/esm/common/LayoutControl/designer.js +70 -104
  12. package/dist/esm/common/LayoutControl/runtime.js +1 -16
  13. package/dist/esm/common/ListControl/designer.js +61 -86
  14. package/dist/esm/common/ListControl/property.js +0 -14
  15. package/dist/esm/common/ListControl/runtime.js +1 -16
  16. package/dist/esm/common/SearchViewControl/designer.js +1 -15
  17. package/dist/esm/common/SearchViewControl/property.js +0 -14
  18. package/dist/esm/common/SearchViewControl/runtime.js +1 -15
  19. package/dist/esm/common/WrapControl/designer.js +1 -15
  20. package/dist/esm/common/WrapControl/runtime.js +1 -15
  21. package/dist/esm/framework/RegisterControls.js +128 -197
  22. package/dist/esm/framework/index.js +66 -186
  23. package/dist/index.umd.js +1 -1
  24. package/dist/types/api-doc-index.d.ts +4 -0
  25. package/dist/types/common/ColumnControl/property.d.ts +39 -0
  26. package/dist/types/common/FormControl/property.d.ts +52 -0
  27. package/dist/types/framework/index.d.ts +187 -1
  28. package/package.json +3 -3
@@ -46,20 +46,6 @@ function _classCallCheck(instance, Constructor) {
46
46
  throw new TypeError("Cannot call a class as a function");
47
47
  }
48
48
  }
49
- function _defineProperties(target, props) {
50
- for(var i = 0; i < props.length; i++){
51
- var descriptor = props[i];
52
- descriptor.enumerable = descriptor.enumerable || false;
53
- descriptor.configurable = true;
54
- if ("value" in descriptor) descriptor.writable = true;
55
- Object.defineProperty(target, descriptor.key, descriptor);
56
- }
57
- }
58
- function _createClass(Constructor, protoProps, staticProps) {
59
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
60
- if (staticProps) _defineProperties(Constructor, staticProps);
61
- return Constructor;
62
- }
63
49
  function _defineProperty(obj, key, value) {
64
50
  if (key in obj) {
65
51
  Object.defineProperty(obj, key, {
@@ -318,84 +304,73 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
318
304
  _classCallCheck(this, ListControl);
319
305
  var _this;
320
306
  _this = _super.call(this, props);
321
- _defineProperty(_assertThisInitialized(_this), "controlType", "list");
322
- _defineProperty(_assertThisInitialized(_this), "props", void 0);
307
+ _this.controlType = "list";
323
308
  _this.props = new ListControlProperty(_assertThisInitialized(_this), props === null || props === void 0 ? void 0 : props.props);
324
309
  return _this;
325
310
  }
326
- _createClass(ListControl, [
327
- {
328
- key: "validate",
329
- value: function validate(messages, ignore) {
330
- var _this = this;
331
- var _this1 = this, _superprop_get_validate = function() {
332
- return _get(_getPrototypeOf(ListControl.prototype), "validate", _this);
333
- };
334
- return _asyncToGenerator(function() {
335
- return __generator(this, function(_state) {
336
- switch(_state.label){
337
- case 0:
338
- return [
339
- 4,
340
- _superprop_get_validate().call(_this1, messages)
341
- ];
342
- case 1:
343
- _state.sent();
344
- return [
345
- 4,
346
- Promise.all(_this1.props.headers.map(function(child) {
347
- return child.validate(messages, ignore);
348
- }))
349
- ];
350
- case 2:
351
- _state.sent();
352
- return [
353
- 2,
354
- true
355
- ];
356
- }
357
- });
358
- })();
359
- }
360
- },
361
- {
362
- key: "toDataBindModel",
363
- value: function toDataBindModel() {
364
- var listModel = _get(_getPrototypeOf(ListControl.prototype), "toDataBindModel", this).call(this);
365
- var result = listModel ? [
366
- listModel
367
- ] : [];
368
- var parentId = this.id;
369
- return this.props.headers.reduce(function(arr, current) {
370
- var model = current.toDataBindModel(parentId);
371
- if (Array.isArray(model)) {
372
- var filteredModel = model.filter(function(item) {
373
- return !!item;
374
- });
375
- return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
376
- }
377
- model && arr.push(model);
378
- return arr;
379
- }, result);
380
- }
381
- },
382
- {
383
- key: "toSchema",
384
- value: function toSchema() {
385
- var superSchema = _get(_getPrototypeOf(ListControl.prototype), "toSchema", this).call(this);
386
- var headers = this.props.headers.map(function(item) {
387
- return item.toSchema();
388
- });
389
- return _objectSpreadProps(_objectSpread({}, superSchema), {
390
- props: _objectSpreadProps(_objectSpread({}, this.props), {
391
- headers: headers
392
- })
311
+ var _proto = ListControl.prototype;
312
+ _proto.validate = function validate(messages, ignore) {
313
+ var _this = this;
314
+ var _this1 = this, _superprop_get_validate = function() {
315
+ return _get(_getPrototypeOf(ListControl.prototype), "validate", _this);
316
+ };
317
+ return _asyncToGenerator(function() {
318
+ return __generator(this, function(_state) {
319
+ switch(_state.label){
320
+ case 0:
321
+ return [
322
+ 4,
323
+ _superprop_get_validate().call(_this1, messages)
324
+ ];
325
+ case 1:
326
+ _state.sent();
327
+ return [
328
+ 4,
329
+ Promise.all(_this1.props.headers.map(function(child) {
330
+ return child.validate(messages, ignore);
331
+ }))
332
+ ];
333
+ case 2:
334
+ _state.sent();
335
+ return [
336
+ 2,
337
+ true
338
+ ];
339
+ }
340
+ });
341
+ })();
342
+ };
343
+ _proto.toDataBindModel = function toDataBindModel() {
344
+ var listModel = _get(_getPrototypeOf(ListControl.prototype), "toDataBindModel", this).call(this);
345
+ var result = listModel ? [
346
+ listModel
347
+ ] : [];
348
+ var parentId = this.id;
349
+ return this.props.headers.reduce(function(arr, current) {
350
+ var model = current.toDataBindModel(parentId);
351
+ if (Array.isArray(model)) {
352
+ var filteredModel = model.filter(function(item) {
353
+ return !!item;
393
354
  });
355
+ return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
394
356
  }
395
- }
396
- ]);
357
+ model && arr.push(model);
358
+ return arr;
359
+ }, result);
360
+ };
361
+ _proto.toSchema = function toSchema() {
362
+ var superSchema = _get(_getPrototypeOf(ListControl.prototype), "toSchema", this).call(this);
363
+ var headers = this.props.headers.map(function(item) {
364
+ return item.toSchema();
365
+ });
366
+ return _objectSpreadProps(_objectSpread({}, superSchema), {
367
+ props: _objectSpreadProps(_objectSpread({}, this.props), {
368
+ headers: headers
369
+ })
370
+ });
371
+ };
397
372
  return ListControl;
398
373
  }(DesignerControl);
399
- _defineProperty(ListControl, "controlFieldType", FieldTypes.LIST);
374
+ ListControl.controlFieldType = FieldTypes.LIST;
400
375
  export default ListControl;
401
376
  export { ListControl as DesignerListControl };
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
9
9
  throw new TypeError("Cannot call a class as a function");
10
10
  }
11
11
  }
12
- function _defineProperty(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
12
  function _getPrototypeOf(o) {
26
13
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
27
14
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -92,7 +79,6 @@ var ListControlProperty = /*#__PURE__*/ function(Property) {
92
79
  _classCallCheck(this, ListControlProperty);
93
80
  var _this;
94
81
  _this = _super.call(this, props);
95
- _defineProperty(_assertThisInitialized(_this), "headers", void 0);
96
82
  defineControlArrayToProperty(_assertThisInitialized(_this), "headers", props === null || props === void 0 ? void 0 : props.headers, parent);
97
83
  return _this;
98
84
  }
@@ -23,19 +23,6 @@ function _createClass(Constructor, protoProps, staticProps) {
23
23
  if (staticProps) _defineProperties(Constructor, staticProps);
24
24
  return Constructor;
25
25
  }
26
- function _defineProperty(obj, key, value) {
27
- if (key in obj) {
28
- Object.defineProperty(obj, key, {
29
- value: value,
30
- enumerable: true,
31
- configurable: true,
32
- writable: true
33
- });
34
- } else {
35
- obj[key] = value;
36
- }
37
- return obj;
38
- }
39
26
  function _getPrototypeOf(o) {
40
27
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
41
28
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -107,9 +94,7 @@ var ListControl = /*#__PURE__*/ function(RuntimeControl) {
107
94
  _classCallCheck(this, ListControl);
108
95
  var _this;
109
96
  _this = _super.call(this, props);
110
- _defineProperty(_assertThisInitialized(_this), "controlType", "list");
111
- _defineProperty(_assertThisInitialized(_this), "children", void 0);
112
- _defineProperty(_assertThisInitialized(_this), "props", void 0);
97
+ _this.controlType = "list";
113
98
  _this.props = new ListControlProperty(_assertThisInitialized(_this), props === null || props === void 0 ? void 0 : props.props);
114
99
  defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
115
100
  return _this;
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
9
9
  throw new TypeError("Cannot call a class as a function");
10
10
  }
11
11
  }
12
- function _defineProperty(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
12
  function _getPrototypeOf(o) {
26
13
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
27
14
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -92,8 +79,7 @@ var SearchControl = /*#__PURE__*/ function(DesignerLayoutControl) {
92
79
  _classCallCheck(this, SearchControl);
93
80
  var _this;
94
81
  _this = _super.call(this, props);
95
- _defineProperty(_assertThisInitialized(_this), "controlType", "search");
96
- _defineProperty(_assertThisInitialized(_this), "props", void 0);
82
+ _this.controlType = "search";
97
83
  _this.props = new SearchControlProperty(props === null || props === void 0 ? void 0 : props.props);
98
84
  return _this;
99
85
  }
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
9
9
  throw new TypeError("Cannot call a class as a function");
10
10
  }
11
11
  }
12
- function _defineProperty(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
12
  function _getPrototypeOf(o) {
26
13
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
27
14
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -92,7 +79,6 @@ var SearchControlProperty = /*#__PURE__*/ function(LayoutControlProperty) {
92
79
  _classCallCheck(this, SearchControlProperty);
93
80
  var _this;
94
81
  _this = _super.call(this, props);
95
- _defineProperty(_assertThisInitialized(_this), "dataBind", void 0);
96
82
  _this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
97
83
  return _this;
98
84
  }
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
9
9
  throw new TypeError("Cannot call a class as a function");
10
10
  }
11
11
  }
12
- function _defineProperty(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
12
  function _getPrototypeOf(o) {
26
13
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
27
14
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -92,8 +79,7 @@ var SearchControl = /*#__PURE__*/ function(RuntimeLayoutControl) {
92
79
  _classCallCheck(this, SearchControl);
93
80
  var _this;
94
81
  _this = _super.call(this, props);
95
- _defineProperty(_assertThisInitialized(_this), "controlType", "search");
96
- _defineProperty(_assertThisInitialized(_this), "props", void 0);
82
+ _this.controlType = "search";
97
83
  _this.props = new SearchControlProperty(props === null || props === void 0 ? void 0 : props.props);
98
84
  return _this;
99
85
  }
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
9
9
  throw new TypeError("Cannot call a class as a function");
10
10
  }
11
11
  }
12
- function _defineProperty(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
12
  function _getPrototypeOf(o) {
26
13
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
27
14
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -92,8 +79,7 @@ var WrapControl = /*#__PURE__*/ function(DesignerLayoutControl) {
92
79
  _classCallCheck(this, WrapControl);
93
80
  var _this;
94
81
  _this = _super.call(this, props);
95
- _defineProperty(_assertThisInitialized(_this), "controlType", "wrap");
96
- _defineProperty(_assertThisInitialized(_this), "props", void 0);
82
+ _this.controlType = "wrap";
97
83
  _this.props = new WrapControlProperty(props === null || props === void 0 ? void 0 : props.props);
98
84
  return _this;
99
85
  }
@@ -9,19 +9,6 @@ function _classCallCheck(instance, Constructor) {
9
9
  throw new TypeError("Cannot call a class as a function");
10
10
  }
11
11
  }
12
- function _defineProperty(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
12
  function _getPrototypeOf(o) {
26
13
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
27
14
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -92,8 +79,7 @@ var WrapControl = /*#__PURE__*/ function(RuntimeLayoutControl) {
92
79
  _classCallCheck(this, WrapControl);
93
80
  var _this;
94
81
  _this = _super.call(this, props);
95
- _defineProperty(_assertThisInitialized(_this), "controlType", "wrap");
96
- _defineProperty(_assertThisInitialized(_this), "props", void 0);
82
+ _this.controlType = "wrap";
97
83
  _this.props = new WrapControlProperty(props === null || props === void 0 ? void 0 : props.props);
98
84
  return _this;
99
85
  }