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

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 (61) hide show
  1. package/dist/esm/common/BaseControl/designer.js +228 -189
  2. package/dist/esm/common/BaseControl/property.js +21 -4
  3. package/dist/esm/common/BaseControl/runtime.js +26 -5
  4. package/dist/esm/common/ColumnControl/designer.js +15 -1
  5. package/dist/esm/common/ColumnControl/property.js +34 -11
  6. package/dist/esm/common/ColumnControl/runtime.js +15 -1
  7. package/dist/esm/common/FormControl/designer.js +18 -3
  8. package/dist/esm/common/FormControl/property.js +45 -21
  9. package/dist/esm/common/FormControl/runtime.js +16 -1
  10. package/dist/esm/common/LayoutControl/designer.js +104 -70
  11. package/dist/esm/common/LayoutControl/runtime.js +16 -1
  12. package/dist/esm/common/ListControl/designer.js +86 -61
  13. package/dist/esm/common/ListControl/property.js +14 -0
  14. package/dist/esm/common/ListControl/runtime.js +16 -1
  15. package/dist/esm/common/SearchViewControl/designer.js +15 -1
  16. package/dist/esm/common/SearchViewControl/property.js +14 -0
  17. package/dist/esm/common/SearchViewControl/runtime.js +15 -1
  18. package/dist/esm/common/WrapControl/designer.js +15 -1
  19. package/dist/esm/common/WrapControl/runtime.js +15 -1
  20. package/dist/esm/framework/RegisterControls.js +197 -128
  21. package/dist/esm/framework/index.js +175 -3
  22. package/dist/index.umd.js +1 -1
  23. package/dist/types/common/BaseControl/designer.d.ts +62 -62
  24. package/dist/types/common/BaseControl/index.d.ts +13 -13
  25. package/dist/types/common/BaseControl/property.d.ts +22 -22
  26. package/dist/types/common/BaseControl/runtime.d.ts +22 -22
  27. package/dist/types/common/BaseControl/types.d.ts +35 -35
  28. package/dist/types/common/ColumnControl/designer.d.ts +10 -10
  29. package/dist/types/common/ColumnControl/index.d.ts +12 -12
  30. package/dist/types/common/ColumnControl/property.d.ts +34 -34
  31. package/dist/types/common/ColumnControl/runtime.d.ts +10 -10
  32. package/dist/types/common/ControlArray.d.ts +8 -8
  33. package/dist/types/common/FormControl/designer.d.ts +13 -13
  34. package/dist/types/common/FormControl/index.d.ts +12 -12
  35. package/dist/types/common/FormControl/property.d.ts +44 -44
  36. package/dist/types/common/FormControl/runtime.d.ts +11 -11
  37. package/dist/types/common/LayoutControl/designer.d.ts +21 -21
  38. package/dist/types/common/LayoutControl/index.d.ts +12 -12
  39. package/dist/types/common/LayoutControl/property.d.ts +6 -6
  40. package/dist/types/common/LayoutControl/runtime.d.ts +11 -11
  41. package/dist/types/common/ListControl/designer.d.ts +16 -16
  42. package/dist/types/common/ListControl/index.d.ts +12 -12
  43. package/dist/types/common/ListControl/property.d.ts +12 -12
  44. package/dist/types/common/ListControl/runtime.d.ts +12 -12
  45. package/dist/types/common/SearchViewControl/designer.d.ts +11 -11
  46. package/dist/types/common/SearchViewControl/index.d.ts +12 -12
  47. package/dist/types/common/SearchViewControl/property.d.ts +8 -8
  48. package/dist/types/common/SearchViewControl/runtime.d.ts +11 -11
  49. package/dist/types/common/Validator.d.ts +15 -15
  50. package/dist/types/common/WrapControl/designer.d.ts +11 -11
  51. package/dist/types/common/WrapControl/index.d.ts +12 -12
  52. package/dist/types/common/WrapControl/property.d.ts +6 -6
  53. package/dist/types/common/WrapControl/runtime.d.ts +11 -11
  54. package/dist/types/common/controlHooksEmitter.d.ts +4 -4
  55. package/dist/types/common/index.d.ts +11 -11
  56. package/dist/types/common/initOptionAndDataSourceRules.d.ts +10 -10
  57. package/dist/types/framework/RegisterControls.d.ts +33 -33
  58. package/dist/types/framework/index.d.ts +358 -358
  59. package/dist/types/index.d.ts +3 -3
  60. package/dist/types/type.d.ts +91 -91
  61. package/package.json +3 -3
@@ -9,6 +9,19 @@ 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
+ }
12
25
  function _getPrototypeOf(o) {
13
26
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
14
27
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -79,7 +92,8 @@ var ColumnControl = /*#__PURE__*/ function(RuntimeControl) {
79
92
  _classCallCheck(this, ColumnControl);
80
93
  var _this;
81
94
  _this = _super.call(this, props);
82
- _this.controlType = "column";
95
+ _defineProperty(_assertThisInitialized(_this), "controlType", "column");
96
+ _defineProperty(_assertThisInitialized(_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
  }
@@ -9,6 +9,19 @@ 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
+ }
12
25
  function _getPrototypeOf(o) {
13
26
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
14
27
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -79,16 +92,18 @@ var FormControl = /*#__PURE__*/ function(DesignerControl) {
79
92
  _classCallCheck(this, FormControl);
80
93
  var _this;
81
94
  _this = _super.call(this, props);
82
- _this.controlType = "form";
95
+ _defineProperty(_assertThisInitialized(_this), "controlType", "form");
96
+ _defineProperty(_assertThisInitialized(_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 = [
102
+ _defineProperty(FormControl, "controlEventKeys", [
89
103
  "on_change",
90
104
  "on_focus",
91
105
  "on_blur"
92
- ];
106
+ ]);
107
+ _defineProperty(FormControl, "controlCustomAttributes", void 0);
93
108
  export default FormControl;
94
109
  export { FormControl as DesignerFormControl };
@@ -9,6 +9,19 @@ 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
+ }
12
25
  function _getPrototypeOf(o) {
13
26
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
14
27
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -88,43 +101,43 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
88
101
  _classCallCheck(this, BaseControlPropertyRules);
89
102
  var _this;
90
103
  _this = _super.call(this, props);
91
- _this.dataBind = {};
92
- _this.caption = {
104
+ _defineProperty(_assertThisInitialized(_this), "dataBind", {});
105
+ _defineProperty(_assertThisInitialized(_this), "caption", {
93
106
  type: "string",
94
107
  required: true,
95
108
  message: RulesMessage.getMessage("pleaseEnterCaption")
96
- };
97
- _this.isHideCaption = {
109
+ });
110
+ _defineProperty(_assertThisInitialized(_this), "isHideCaption", {
98
111
  type: "boolean"
99
- };
100
- _this.labelPosition = {
112
+ });
113
+ _defineProperty(_assertThisInitialized(_this), "labelPosition", {
101
114
  type: "enum",
102
115
  enum: [
103
116
  "top",
104
117
  "left"
105
118
  ]
106
- };
119
+ });
107
120
  // 去掉placeholder必填校验
108
121
  // public placeholder: RuleItem = {
109
122
  // required: true,
110
123
  // type: 'string',
111
124
  // message: RulesMessage.getMessage('pleaseEnterPlaceholder'),
112
125
  // }
113
- _this.defaultState = {
126
+ _defineProperty(_assertThisInitialized(_this), "defaultState", {
114
127
  type: "enum",
115
128
  enum: [
116
129
  "default",
117
130
  "readonly"
118
131
  ]
119
- };
120
- _this.required = {
132
+ });
133
+ _defineProperty(_assertThisInitialized(_this), "required", {
121
134
  type: "boolean"
122
- };
123
- _this.captionTip = {
135
+ });
136
+ _defineProperty(_assertThisInitialized(_this), "captionTip", {
124
137
  type: "string",
125
138
  required: false,
126
139
  message: RulesMessage.getMessage("pleaseEnterCaptionTip")
127
- };
140
+ });
128
141
  // 初始化dataBind的校验规则
129
142
  var validateFields = {
130
143
  fieldCode: {
@@ -197,6 +210,17 @@ var BaseControlProperty = /*#__PURE__*/ function(Property) {
197
210
  _classCallCheck(this, BaseControlProperty);
198
211
  var _this;
199
212
  _this = _super.call(this, props);
213
+ _defineProperty(_assertThisInitialized(_this), "caption", void 0);
214
+ _defineProperty(_assertThisInitialized(_this), "isHideCaption", void 0);
215
+ _defineProperty(_assertThisInitialized(_this), "isShowCaptionTip", void 0);
216
+ _defineProperty(_assertThisInitialized(_this), "captionTip", void 0);
217
+ _defineProperty(_assertThisInitialized(_this), "labelPosition", void 0);
218
+ _defineProperty(_assertThisInitialized(_this), "dataBind", void 0);
219
+ _defineProperty(_assertThisInitialized(_this), "defaultValue", void 0);
220
+ _defineProperty(_assertThisInitialized(_this), "placeholder", void 0);
221
+ _defineProperty(_assertThisInitialized(_this), "defaultState", void 0);
222
+ _defineProperty(_assertThisInitialized(_this), "required", void 0);
223
+ _defineProperty(_assertThisInitialized(_this), "requiredMessage", void 0);
200
224
  var _props_caption;
201
225
  _this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
202
226
  var _props_isHideCaption;
@@ -223,8 +247,8 @@ var BaseControlProperty = /*#__PURE__*/ function(Property) {
223
247
  }
224
248
  return BaseControlProperty;
225
249
  }(Property);
226
- BaseControlProperty.Rules = BaseControlPropertyRules;
227
- BaseControlProperty.RuntimeRules = BaseControlPropertyRuntimeRules;
250
+ _defineProperty(BaseControlProperty, "Rules", BaseControlPropertyRules);
251
+ _defineProperty(BaseControlProperty, "RuntimeRules", BaseControlPropertyRuntimeRules);
228
252
  var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
229
253
  "use strict";
230
254
  _inherits(OptionAndDataSourcePropertyRules, BaseControlPropertyRules);
@@ -233,26 +257,26 @@ var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropert
233
257
  _classCallCheck(this, OptionAndDataSourcePropertyRules);
234
258
  var _this;
235
259
  _this = _super.call(this, props);
236
- _this.optionConfig = {
260
+ _defineProperty(_assertThisInitialized(_this), "optionConfig", {
237
261
  type: "enum",
238
262
  enum: [
239
263
  "custom",
240
264
  "datasource"
241
265
  ],
242
266
  message: RulesMessage.getMessage("PleaseSelectTheCorrectOptionSettings")
243
- };
244
- _this.options = [
267
+ });
268
+ _defineProperty(_assertThisInitialized(_this), "options", [
245
269
  {
246
270
  type: "array",
247
271
  message: RulesMessage.getMessage("isNotArray")
248
272
  }
249
- ];
250
- _this.datasourceBind = [
273
+ ]);
274
+ _defineProperty(_assertThisInitialized(_this), "datasourceBind", [
251
275
  {
252
276
  type: "object",
253
277
  message: RulesMessage.getMessage("isNotObject")
254
278
  }
255
- ];
279
+ ]);
256
280
  initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
257
281
  return _this;
258
282
  }
@@ -9,6 +9,19 @@ 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
+ }
12
25
  function _getPrototypeOf(o) {
13
26
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
14
27
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -79,7 +92,9 @@ var FormControl = /*#__PURE__*/ function(RuntimeControl) {
79
92
  _classCallCheck(this, FormControl);
80
93
  var _this;
81
94
  _this = _super.call(this, props);
82
- _this.controlType = "form";
95
+ _defineProperty(_assertThisInitialized(_this), "controlType", "form");
96
+ _defineProperty(_assertThisInitialized(_this), "props", void 0);
97
+ _defineProperty(_assertThisInitialized(_this), "value", void 0);
83
98
  _this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
84
99
  return _this;
85
100
  }
@@ -46,6 +46,20 @@ 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
+ }
49
63
  function _defineProperty(obj, key, value) {
50
64
  if (key in obj) {
51
65
  Object.defineProperty(obj, key, {
@@ -314,7 +328,11 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
314
328
  _classCallCheck(this, LayoutControl);
315
329
  var _this;
316
330
  _this = _super.call(this, props);
317
- _this.controlType = "layout";
331
+ _defineProperty(_assertThisInitialized(_this), "controlType", "layout");
332
+ _defineProperty(_assertThisInitialized(_this), "children", void 0);
333
+ _defineProperty(_assertThisInitialized(_this), "excludes", void 0);
334
+ _defineProperty(_assertThisInitialized(_this), "childrenMaxLength", void 0);
335
+ _defineProperty(_assertThisInitialized(_this), "props", void 0);
318
336
  var _ref = _instanceof(this, LayoutControl) ? this.constructor : void 0, excludes = _ref.excludes, childrenMaxLength = _ref.childrenMaxLength;
319
337
  _this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
320
338
  defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
@@ -322,79 +340,95 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
322
340
  _this.childrenMaxLength = childrenMaxLength;
323
341
  return _this;
324
342
  }
325
- var _proto = LayoutControl.prototype;
326
- _proto.judgeExcludesChildren = function judgeExcludesChildren(type) {
327
- return this.excludes === false || Array.isArray(this.excludes) && !this.excludes.includes(type);
328
- };
329
- _proto.judgeJoinChildren = function judgeJoinChildren(type) {
330
- var canJoin = this.judgeExcludesChildren(type);
331
- if (canJoin) {
332
- return this.childrenMaxLength > this.children.length;
333
- }
334
- return canJoin;
335
- };
336
- _proto.validate = function validate(messages, ignore) {
337
- var _this = this;
338
- var _this1 = this, _superprop_get_validate = function() {
339
- return _get(_getPrototypeOf(LayoutControl.prototype), "validate", _this);
340
- };
341
- return _asyncToGenerator(function() {
342
- return __generator(this, function(_state) {
343
- switch(_state.label){
344
- case 0:
345
- return [
346
- 4,
347
- _superprop_get_validate().call(_this1, messages, ignore)
348
- ];
349
- case 1:
350
- _state.sent();
351
- return [
352
- 4,
353
- Promise.all(_this1.children.map(function(child) {
354
- return child.validate(messages, ignore);
355
- }))
356
- ];
357
- case 2:
358
- _state.sent();
359
- return [
360
- 2,
361
- true
362
- ];
343
+ _createClass(LayoutControl, [
344
+ {
345
+ key: "judgeExcludesChildren",
346
+ value: function judgeExcludesChildren(type) {
347
+ return this.excludes === false || Array.isArray(this.excludes) && !this.excludes.includes(type);
348
+ }
349
+ },
350
+ {
351
+ key: "judgeJoinChildren",
352
+ value: function judgeJoinChildren(type) {
353
+ var canJoin = this.judgeExcludesChildren(type);
354
+ if (canJoin) {
355
+ return this.childrenMaxLength > this.children.length;
363
356
  }
364
- });
365
- })();
366
- };
367
- _proto.toDataBindModel = function toDataBindModel() {
368
- var parentId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
369
- var dataBindModel = _get(_getPrototypeOf(LayoutControl.prototype), "toDataBindModel", this).call(this);
370
- var result = dataBindModel ? [
371
- dataBindModel
372
- ] : [];
373
- return this.children.reduce(function(arr, current) {
374
- var model = current.toDataBindModel(parentId);
375
- if (Array.isArray(model)) {
376
- var filteredModel = model.filter(function(item) {
377
- return !!item;
357
+ return canJoin;
358
+ }
359
+ },
360
+ {
361
+ key: "validate",
362
+ value: function validate(messages, ignore) {
363
+ var _this = this;
364
+ var _this1 = this, _superprop_get_validate = function() {
365
+ return _get(_getPrototypeOf(LayoutControl.prototype), "validate", _this);
366
+ };
367
+ return _asyncToGenerator(function() {
368
+ return __generator(this, function(_state) {
369
+ switch(_state.label){
370
+ case 0:
371
+ return [
372
+ 4,
373
+ _superprop_get_validate().call(_this1, messages, ignore)
374
+ ];
375
+ case 1:
376
+ _state.sent();
377
+ return [
378
+ 4,
379
+ Promise.all(_this1.children.map(function(child) {
380
+ return child.validate(messages, ignore);
381
+ }))
382
+ ];
383
+ case 2:
384
+ _state.sent();
385
+ return [
386
+ 2,
387
+ true
388
+ ];
389
+ }
390
+ });
391
+ })();
392
+ }
393
+ },
394
+ {
395
+ key: "toDataBindModel",
396
+ value: function toDataBindModel() {
397
+ var parentId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
398
+ var dataBindModel = _get(_getPrototypeOf(LayoutControl.prototype), "toDataBindModel", this).call(this);
399
+ var result = dataBindModel ? [
400
+ dataBindModel
401
+ ] : [];
402
+ return this.children.reduce(function(arr, current) {
403
+ var model = current.toDataBindModel(parentId);
404
+ if (Array.isArray(model)) {
405
+ var filteredModel = model.filter(function(item) {
406
+ return !!item;
407
+ });
408
+ return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
409
+ }
410
+ model && arr.push(model);
411
+ return arr;
412
+ }, result);
413
+ }
414
+ },
415
+ {
416
+ key: "toSchema",
417
+ value: function toSchema() {
418
+ var superSchema = _get(_getPrototypeOf(LayoutControl.prototype), "toSchema", this).call(this);
419
+ var children = this.children.map(function(item) {
420
+ var schema = item.toSchema();
421
+ return schema;
422
+ });
423
+ return _objectSpreadProps(_objectSpread({}, superSchema), {
424
+ children: children
378
425
  });
379
- return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
380
426
  }
381
- model && arr.push(model);
382
- return arr;
383
- }, result);
384
- };
385
- _proto.toSchema = function toSchema() {
386
- var superSchema = _get(_getPrototypeOf(LayoutControl.prototype), "toSchema", this).call(this);
387
- var children = this.children.map(function(item) {
388
- var schema = item.toSchema();
389
- return schema;
390
- });
391
- return _objectSpreadProps(_objectSpread({}, superSchema), {
392
- children: children
393
- });
394
- };
427
+ }
428
+ ]);
395
429
  return LayoutControl;
396
430
  }(DesignerControl);
397
- LayoutControl.excludes = false;
398
- LayoutControl.childrenMaxLength = CHILDREN_MAX_LENGTH;
431
+ _defineProperty(LayoutControl, "excludes", false);
432
+ _defineProperty(LayoutControl, "childrenMaxLength", CHILDREN_MAX_LENGTH);
399
433
  export default LayoutControl;
400
434
  export { LayoutControl as DesignerLayoutControl };
@@ -9,6 +9,19 @@ 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
+ }
12
25
  function _getPrototypeOf(o) {
13
26
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
14
27
  return o.__proto__ || Object.getPrototypeOf(o);
@@ -80,7 +93,9 @@ var LayoutControl = /*#__PURE__*/ function(RuntimeControl) {
80
93
  _classCallCheck(this, LayoutControl);
81
94
  var _this;
82
95
  _this = _super.call(this, props);
83
- _this.controlType = "layout";
96
+ _defineProperty(_assertThisInitialized(_this), "controlType", "layout");
97
+ _defineProperty(_assertThisInitialized(_this), "children", void 0);
98
+ _defineProperty(_assertThisInitialized(_this), "props", void 0);
84
99
  _this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
85
100
  defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
86
101
  return _this;
@@ -46,6 +46,20 @@ 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
+ }
49
63
  function _defineProperty(obj, key, value) {
50
64
  if (key in obj) {
51
65
  Object.defineProperty(obj, key, {
@@ -304,73 +318,84 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
304
318
  _classCallCheck(this, ListControl);
305
319
  var _this;
306
320
  _this = _super.call(this, props);
307
- _this.controlType = "list";
321
+ _defineProperty(_assertThisInitialized(_this), "controlType", "list");
322
+ _defineProperty(_assertThisInitialized(_this), "props", void 0);
308
323
  _this.props = new ListControlProperty(_assertThisInitialized(_this), props === null || props === void 0 ? void 0 : props.props);
309
324
  return _this;
310
325
  }
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;
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
+ })
354
393
  });
355
- return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
356
394
  }
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
- };
395
+ }
396
+ ]);
372
397
  return ListControl;
373
398
  }(DesignerControl);
374
- ListControl.controlFieldType = FieldTypes.LIST;
399
+ _defineProperty(ListControl, "controlFieldType", FieldTypes.LIST);
375
400
  export default ListControl;
376
401
  export { ListControl as DesignerListControl };