@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
@@ -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);
@@ -94,22 +81,25 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
94
81
  _classCallCheck(this, ColumnControlPropertyRules);
95
82
  var _this;
96
83
  _this = _super.call(this, props);
97
- _defineProperty(_assertThisInitialized(_this), "caption", {
84
+ _this.caption = {
98
85
  type: "string",
99
86
  required: true,
100
87
  message: RulesMessage.getMessage("pleaseEnterCaption")
101
- });
102
- _defineProperty(_assertThisInitialized(_this), "width", {
88
+ };
89
+ _this.width = {
103
90
  type: "number",
104
91
  required: false,
105
92
  message: RulesMessage.getMessage("pleaseEnterColumnWidth")
106
- });
93
+ };
107
94
  _this.width.required = props.widthType === "px";
108
95
  return _this;
109
96
  }
110
97
  return ColumnControlPropertyRules;
111
98
  }(PropertyRules);
112
- var ColumnControlProperty = /*#__PURE__*/ function(Property) {
99
+ /**
100
+ * 列基本属性
101
+ * @public
102
+ */ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
113
103
  "use strict";
114
104
  _inherits(ColumnControlProperty, Property);
115
105
  var _super = _createSuper(ColumnControlProperty);
@@ -117,16 +107,6 @@ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
117
107
  _classCallCheck(this, ColumnControlProperty);
118
108
  var _this;
119
109
  _this = _super.call(this, props);
120
- _defineProperty(_assertThisInitialized(_this), "widthType", void 0);
121
- _defineProperty(_assertThisInitialized(_this), "width", void 0);
122
- _defineProperty(_assertThisInitialized(_this), "caption", void 0);
123
- _defineProperty(_assertThisInitialized(_this), "dataBind", void 0);
124
- _defineProperty(_assertThisInitialized(_this), "autoWidth", void 0);
125
- _defineProperty(_assertThisInitialized(_this), "fixed", void 0);
126
- _defineProperty(_assertThisInitialized(_this), "sort", void 0);
127
- _defineProperty(_assertThisInitialized(_this), "align", void 0);
128
- _defineProperty(_assertThisInitialized(_this), "colSpan", void 0);
129
- _defineProperty(_assertThisInitialized(_this), "autoHeight", void 0);
130
110
  var _props_width;
131
111
  _this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
132
112
  _this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || "auto";
@@ -146,7 +126,7 @@ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
146
126
  }
147
127
  return ColumnControlProperty;
148
128
  }(Property);
149
- _defineProperty(ColumnControlProperty, "Rules", ColumnControlPropertyRules);
129
+ ColumnControlProperty.Rules = ColumnControlPropertyRules;
150
130
  var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnControlPropertyRules) {
151
131
  "use strict";
152
132
  _inherits(ColumnOptionAndDataSourcePropertyRules, ColumnControlPropertyRules);
@@ -155,7 +135,7 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
155
135
  _classCallCheck(this, ColumnOptionAndDataSourcePropertyRules);
156
136
  var _this;
157
137
  _this = _super.call(this, props);
158
- _defineProperty(_assertThisInitialized(_this), "optionConfig", {
138
+ _this.optionConfig = {
159
139
  type: "enum",
160
140
  enum: [
161
141
  "custom",
@@ -163,19 +143,19 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
163
143
  "none"
164
144
  ],
165
145
  message: RulesMessage.getMessage("PleaseSelectTheCorrectOptionSettings")
166
- });
167
- _defineProperty(_assertThisInitialized(_this), "options", [
146
+ };
147
+ _this.options = [
168
148
  {
169
149
  type: "array",
170
150
  message: RulesMessage.getMessage("isNotArray")
171
151
  }
172
- ]);
173
- _defineProperty(_assertThisInitialized(_this), "datasourceBind", [
152
+ ];
153
+ _this.datasourceBind = [
174
154
  {
175
155
  type: "object",
176
156
  message: RulesMessage.getMessage("isNotObject")
177
157
  }
178
- ]);
158
+ ];
179
159
  initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
180
160
  return _this;
181
161
  }
@@ -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 ColumnControl = /*#__PURE__*/ function(RuntimeControl) {
92
79
  _classCallCheck(this, ColumnControl);
93
80
  var _this;
94
81
  _this = _super.call(this, props);
95
- _defineProperty(_assertThisInitialized(_this), "controlType", "column");
96
- _defineProperty(_assertThisInitialized(_this), "props", void 0);
82
+ _this.controlType = "column";
97
83
  _this.props = new ColumnControlProperty(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,18 +79,16 @@ var FormControl = /*#__PURE__*/ function(DesignerControl) {
92
79
  _classCallCheck(this, FormControl);
93
80
  var _this;
94
81
  _this = _super.call(this, props);
95
- _defineProperty(_assertThisInitialized(_this), "controlType", "form");
96
- _defineProperty(_assertThisInitialized(_this), "props", void 0);
82
+ _this.controlType = "form";
97
83
  _this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
98
84
  return _this;
99
85
  }
100
86
  return FormControl;
101
87
  }(DesignerControl);
102
- _defineProperty(FormControl, "controlEventKeys", [
88
+ FormControl.controlEventKeys = [
103
89
  "on_change",
104
90
  "on_focus",
105
91
  "on_blur"
106
- ]);
107
- _defineProperty(FormControl, "controlCustomAttributes", void 0);
92
+ ];
108
93
  export default FormControl;
109
94
  export { FormControl as DesignerFormControl };
@@ -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);
@@ -101,43 +88,43 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
101
88
  _classCallCheck(this, BaseControlPropertyRules);
102
89
  var _this;
103
90
  _this = _super.call(this, props);
104
- _defineProperty(_assertThisInitialized(_this), "dataBind", {});
105
- _defineProperty(_assertThisInitialized(_this), "caption", {
91
+ _this.dataBind = {};
92
+ _this.caption = {
106
93
  type: "string",
107
94
  required: true,
108
95
  message: RulesMessage.getMessage("pleaseEnterCaption")
109
- });
110
- _defineProperty(_assertThisInitialized(_this), "isHideCaption", {
96
+ };
97
+ _this.isHideCaption = {
111
98
  type: "boolean"
112
- });
113
- _defineProperty(_assertThisInitialized(_this), "labelPosition", {
99
+ };
100
+ _this.labelPosition = {
114
101
  type: "enum",
115
102
  enum: [
116
103
  "top",
117
104
  "left"
118
105
  ]
119
- });
106
+ };
120
107
  // 去掉placeholder必填校验
121
108
  // public placeholder: RuleItem = {
122
109
  // required: true,
123
110
  // type: 'string',
124
111
  // message: RulesMessage.getMessage('pleaseEnterPlaceholder'),
125
112
  // }
126
- _defineProperty(_assertThisInitialized(_this), "defaultState", {
113
+ _this.defaultState = {
127
114
  type: "enum",
128
115
  enum: [
129
116
  "default",
130
117
  "readonly"
131
118
  ]
132
- });
133
- _defineProperty(_assertThisInitialized(_this), "required", {
119
+ };
120
+ _this.required = {
134
121
  type: "boolean"
135
- });
136
- _defineProperty(_assertThisInitialized(_this), "captionTip", {
122
+ };
123
+ _this.captionTip = {
137
124
  type: "string",
138
125
  required: false,
139
126
  message: RulesMessage.getMessage("pleaseEnterCaptionTip")
140
- });
127
+ };
141
128
  // 初始化dataBind的校验规则
142
129
  var validateFields = {
143
130
  fieldCode: {
@@ -210,17 +197,6 @@ var BaseControlProperty = /*#__PURE__*/ function(Property) {
210
197
  _classCallCheck(this, BaseControlProperty);
211
198
  var _this;
212
199
  _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);
224
200
  var _props_caption;
225
201
  _this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
226
202
  var _props_isHideCaption;
@@ -247,8 +223,8 @@ var BaseControlProperty = /*#__PURE__*/ function(Property) {
247
223
  }
248
224
  return BaseControlProperty;
249
225
  }(Property);
250
- _defineProperty(BaseControlProperty, "Rules", BaseControlPropertyRules);
251
- _defineProperty(BaseControlProperty, "RuntimeRules", BaseControlPropertyRuntimeRules);
226
+ BaseControlProperty.Rules = BaseControlPropertyRules;
227
+ BaseControlProperty.RuntimeRules = BaseControlPropertyRuntimeRules;
252
228
  var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
253
229
  "use strict";
254
230
  _inherits(OptionAndDataSourcePropertyRules, BaseControlPropertyRules);
@@ -257,26 +233,26 @@ var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropert
257
233
  _classCallCheck(this, OptionAndDataSourcePropertyRules);
258
234
  var _this;
259
235
  _this = _super.call(this, props);
260
- _defineProperty(_assertThisInitialized(_this), "optionConfig", {
236
+ _this.optionConfig = {
261
237
  type: "enum",
262
238
  enum: [
263
239
  "custom",
264
240
  "datasource"
265
241
  ],
266
242
  message: RulesMessage.getMessage("PleaseSelectTheCorrectOptionSettings")
267
- });
268
- _defineProperty(_assertThisInitialized(_this), "options", [
243
+ };
244
+ _this.options = [
269
245
  {
270
246
  type: "array",
271
247
  message: RulesMessage.getMessage("isNotArray")
272
248
  }
273
- ]);
274
- _defineProperty(_assertThisInitialized(_this), "datasourceBind", [
249
+ ];
250
+ _this.datasourceBind = [
275
251
  {
276
252
  type: "object",
277
253
  message: RulesMessage.getMessage("isNotObject")
278
254
  }
279
- ]);
255
+ ];
280
256
  initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
281
257
  return _this;
282
258
  }
@@ -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,9 +79,7 @@ var FormControl = /*#__PURE__*/ function(RuntimeControl) {
92
79
  _classCallCheck(this, FormControl);
93
80
  var _this;
94
81
  _this = _super.call(this, props);
95
- _defineProperty(_assertThisInitialized(_this), "controlType", "form");
96
- _defineProperty(_assertThisInitialized(_this), "props", void 0);
97
- _defineProperty(_assertThisInitialized(_this), "value", void 0);
82
+ _this.controlType = "form";
98
83
  _this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
99
84
  return _this;
100
85
  }
@@ -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, {
@@ -328,11 +314,7 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
328
314
  _classCallCheck(this, LayoutControl);
329
315
  var _this;
330
316
  _this = _super.call(this, props);
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);
317
+ _this.controlType = "layout";
336
318
  var _ref = _instanceof(this, LayoutControl) ? this.constructor : void 0, excludes = _ref.excludes, childrenMaxLength = _ref.childrenMaxLength;
337
319
  _this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
338
320
  defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
@@ -340,95 +322,79 @@ var LayoutControl = /*#__PURE__*/ function _target(DesignerControl) {
340
322
  _this.childrenMaxLength = childrenMaxLength;
341
323
  return _this;
342
324
  }
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;
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
+ ];
356
363
  }
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
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;
425
378
  });
379
+ return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
426
380
  }
427
- }
428
- ]);
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
+ };
429
395
  return LayoutControl;
430
396
  }(DesignerControl);
431
- _defineProperty(LayoutControl, "excludes", false);
432
- _defineProperty(LayoutControl, "childrenMaxLength", CHILDREN_MAX_LENGTH);
397
+ LayoutControl.excludes = false;
398
+ LayoutControl.childrenMaxLength = CHILDREN_MAX_LENGTH;
433
399
  export default LayoutControl;
434
400
  export { LayoutControl as DesignerLayoutControl };
@@ -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);
@@ -93,9 +80,7 @@ var LayoutControl = /*#__PURE__*/ function(RuntimeControl) {
93
80
  _classCallCheck(this, LayoutControl);
94
81
  var _this;
95
82
  _this = _super.call(this, props);
96
- _defineProperty(_assertThisInitialized(_this), "controlType", "layout");
97
- _defineProperty(_assertThisInitialized(_this), "children", void 0);
98
- _defineProperty(_assertThisInitialized(_this), "props", void 0);
83
+ _this.controlType = "layout";
99
84
  _this.props = new LayoutControlProperty(props === null || props === void 0 ? void 0 : props.props);
100
85
  defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
101
86
  return _this;