@byteluck-fe/model-driven-core-all 1.7.5 → 1.7.6-bete.3
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.
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { camelizeKeys, VersionBuilder } from "./index";
|
|
2
|
+
export function genSchemaFromModel(args) {
|
|
3
|
+
var model = JSON.parse(args.model || "[]");
|
|
4
|
+
debugger;
|
|
5
|
+
var versionBuilder = new VersionBuilder(args.schema_version);
|
|
6
|
+
debugger;
|
|
7
|
+
var events = args === null || args === void 0 ? void 0 : args.events;
|
|
8
|
+
var control_events = (args === null || args === void 0 ? void 0 : args.control_events) || {};
|
|
9
|
+
var _args_display_conf;
|
|
10
|
+
var displayBoList = JSON.parse((_args_display_conf = args === null || args === void 0 ? void 0 : args.display_conf) !== null && _args_display_conf !== void 0 ? _args_display_conf : "[]");
|
|
11
|
+
var _args_behaviors;
|
|
12
|
+
var behaviors = (_args_behaviors = args === null || args === void 0 ? void 0 : args.behaviors) !== null && _args_behaviors !== void 0 ? _args_behaviors : [];
|
|
13
|
+
var new_model = versionBuilder.dataCleaner(model, {
|
|
14
|
+
displayBoList: displayBoList,
|
|
15
|
+
dataCode: args.data_code,
|
|
16
|
+
behaviors: behaviors,
|
|
17
|
+
control_events: control_events,
|
|
18
|
+
events: events
|
|
19
|
+
});
|
|
20
|
+
new_model = camelizeKeys(new_model);
|
|
21
|
+
return new_model;
|
|
22
|
+
}
|
|
@@ -49,7 +49,7 @@ export function upgradeCustomControlSchema(schema, registered, componentList, pa
|
|
|
49
49
|
if (hasControl && hasControl.control.upgrade) {
|
|
50
50
|
var oldVersion = "";
|
|
51
51
|
componentList === null || componentList === void 0 ? void 0 : componentList.map(function(comIdWithVersion) {
|
|
52
|
-
var
|
|
52
|
+
var _comIdWithVersion_split = _slicedToArray(comIdWithVersion.split(":"), 2), comid = _comIdWithVersion_split[0], version = _comIdWithVersion_split[1];
|
|
53
53
|
if (hasControl.props.id === comid) {
|
|
54
54
|
oldVersion = version !== null && version !== void 0 ? version : "";
|
|
55
55
|
}
|