@byteluck-fe/model-driven-core 2.7.0-alpha.2 → 2.7.0-alpha.20
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.
- package/dist/esm/common/BaseControl/designer.js +229 -191
- package/dist/esm/common/BaseControl/property.js +29 -4
- package/dist/esm/common/BaseControl/runtime.js +26 -5
- package/dist/esm/common/ColumnControl/designer.js +15 -1
- package/dist/esm/common/ColumnControl/property.js +59 -11
- package/dist/esm/common/ColumnControl/runtime.js +15 -1
- package/dist/esm/common/FormControl/designer.js +18 -3
- package/dist/esm/common/FormControl/property.js +89 -29
- package/dist/esm/common/FormControl/runtime.js +16 -1
- package/dist/esm/common/LayoutControl/designer.js +104 -70
- package/dist/esm/common/LayoutControl/runtime.js +16 -1
- package/dist/esm/common/ListControl/designer.js +95 -61
- package/dist/esm/common/ListControl/property.js +16 -0
- package/dist/esm/common/ListControl/runtime.js +16 -1
- package/dist/esm/common/SearchViewControl/designer.js +15 -1
- package/dist/esm/common/SearchViewControl/property.js +14 -0
- package/dist/esm/common/SearchViewControl/runtime.js +15 -1
- package/dist/esm/common/WrapControl/designer.js +15 -1
- package/dist/esm/common/WrapControl/runtime.js +15 -1
- package/dist/esm/framework/RegisterControls.js +213 -128
- package/dist/esm/framework/index.js +444 -18
- package/dist/esm/framework/isDataBind.js +7 -0
- package/dist/esm/index.js +1 -0
- package/dist/index.umd.js +1 -1
- package/dist/types/common/ListControl/property.d.ts +2 -0
- package/dist/types/framework/index.d.ts +3 -2
- package/dist/types/framework/isDataBind.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -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,93 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
304
318
|
_classCallCheck(this, ListControl);
|
|
305
319
|
var _this;
|
|
306
320
|
_this = _super.call(this, props);
|
|
307
|
-
_this
|
|
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
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
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 _this_props, _this_props_footers;
|
|
386
|
+
var superSchema = _get(_getPrototypeOf(ListControl.prototype), "toSchema", this).call(this);
|
|
387
|
+
var headers = this.props.headers.map(function(item) {
|
|
388
|
+
return item.toSchema();
|
|
389
|
+
});
|
|
390
|
+
var footers = (_this_props = this.props) === null || _this_props === void 0 ? void 0 : (_this_props_footers = _this_props.footers) === null || _this_props_footers === void 0 ? void 0 : _this_props_footers.map(function(item) {
|
|
391
|
+
if (item) {
|
|
392
|
+
return item.toSchema();
|
|
393
|
+
} else {
|
|
394
|
+
return undefined;
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
return _objectSpreadProps(_objectSpread({}, superSchema), {
|
|
398
|
+
props: _objectSpreadProps(_objectSpread({}, this.props), {
|
|
399
|
+
headers: headers,
|
|
400
|
+
footers: footers
|
|
401
|
+
})
|
|
354
402
|
});
|
|
355
|
-
return _toConsumableArray(arr).concat(_toConsumableArray(filteredModel));
|
|
356
403
|
}
|
|
357
|
-
|
|
358
|
-
|
|
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
|
-
};
|
|
404
|
+
}
|
|
405
|
+
]);
|
|
372
406
|
return ListControl;
|
|
373
407
|
}(DesignerControl);
|
|
374
|
-
ListControl
|
|
408
|
+
_defineProperty(ListControl, "controlFieldType", FieldTypes.LIST);
|
|
375
409
|
export default ListControl;
|
|
376
410
|
export { ListControl as DesignerListControl };
|
|
@@ -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,10 @@ var ListControlProperty = /*#__PURE__*/ function(Property) {
|
|
|
79
92
|
_classCallCheck(this, ListControlProperty);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "headers", void 0);
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "footers", void 0);
|
|
82
97
|
defineControlArrayToProperty(_assertThisInitialized(_this), "headers", props === null || props === void 0 ? void 0 : props.headers, parent);
|
|
98
|
+
defineControlArrayToProperty(_assertThisInitialized(_this), "footers", props === null || props === void 0 ? void 0 : props.footers, parent);
|
|
83
99
|
return _this;
|
|
84
100
|
}
|
|
85
101
|
return ListControlProperty;
|
|
@@ -23,6 +23,19 @@ 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
|
+
}
|
|
26
39
|
function _getPrototypeOf(o) {
|
|
27
40
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
28
41
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -94,7 +107,9 @@ var ListControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
|
94
107
|
_classCallCheck(this, ListControl);
|
|
95
108
|
var _this;
|
|
96
109
|
_this = _super.call(this, props);
|
|
97
|
-
_this
|
|
110
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "list");
|
|
111
|
+
_defineProperty(_assertThisInitialized(_this), "children", void 0);
|
|
112
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
98
113
|
_this.props = new ListControlProperty(_assertThisInitialized(_this), props === null || props === void 0 ? void 0 : props.props);
|
|
99
114
|
defineControlArrayToProperty(_assertThisInitialized(_this), "children", props === null || props === void 0 ? void 0 : props.children);
|
|
100
115
|
return _this;
|
|
@@ -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 SearchControl = /*#__PURE__*/ function(DesignerLayoutControl) {
|
|
|
79
92
|
_classCallCheck(this, SearchControl);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
82
|
-
_this
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "search");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
97
|
_this.props = new SearchControlProperty(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,6 +92,7 @@ var SearchControlProperty = /*#__PURE__*/ function(LayoutControlProperty) {
|
|
|
79
92
|
_classCallCheck(this, SearchControlProperty);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "dataBind", void 0);
|
|
82
96
|
_this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
|
|
83
97
|
return _this;
|
|
84
98
|
}
|
|
@@ -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 SearchControl = /*#__PURE__*/ function(RuntimeLayoutControl) {
|
|
|
79
92
|
_classCallCheck(this, SearchControl);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
82
|
-
_this
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "search");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
97
|
_this.props = new SearchControlProperty(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,7 +92,8 @@ var WrapControl = /*#__PURE__*/ function(DesignerLayoutControl) {
|
|
|
79
92
|
_classCallCheck(this, WrapControl);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
82
|
-
_this
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "wrap");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
97
|
_this.props = new WrapControlProperty(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,7 +92,8 @@ var WrapControl = /*#__PURE__*/ function(RuntimeLayoutControl) {
|
|
|
79
92
|
_classCallCheck(this, WrapControl);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
82
|
-
_this
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "wrap");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
97
|
_this.props = new WrapControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
84
98
|
return _this;
|
|
85
99
|
}
|