@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.
- package/dist/esm/api-doc-index.js +4 -0
- package/dist/esm/common/BaseControl/designer.js +189 -228
- package/dist/esm/common/BaseControl/property.js +4 -21
- package/dist/esm/common/BaseControl/runtime.js +5 -26
- package/dist/esm/common/ColumnControl/designer.js +1 -15
- package/dist/esm/common/ColumnControl/property.js +15 -35
- package/dist/esm/common/ColumnControl/runtime.js +1 -15
- package/dist/esm/common/FormControl/designer.js +3 -18
- package/dist/esm/common/FormControl/property.js +21 -45
- package/dist/esm/common/FormControl/runtime.js +1 -16
- package/dist/esm/common/LayoutControl/designer.js +70 -104
- package/dist/esm/common/LayoutControl/runtime.js +1 -16
- package/dist/esm/common/ListControl/designer.js +61 -86
- package/dist/esm/common/ListControl/property.js +0 -14
- package/dist/esm/common/ListControl/runtime.js +1 -16
- package/dist/esm/common/SearchViewControl/designer.js +1 -15
- package/dist/esm/common/SearchViewControl/property.js +0 -14
- package/dist/esm/common/SearchViewControl/runtime.js +1 -15
- package/dist/esm/common/WrapControl/designer.js +1 -15
- package/dist/esm/common/WrapControl/runtime.js +1 -15
- package/dist/esm/framework/RegisterControls.js +128 -197
- package/dist/esm/framework/index.js +66 -186
- package/dist/index.umd.js +1 -1
- package/dist/types/api-doc-index.d.ts +4 -0
- package/dist/types/common/ColumnControl/property.d.ts +39 -0
- package/dist/types/common/FormControl/property.d.ts +52 -0
- package/dist/types/framework/index.d.ts +187 -1
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|