@byteluck-fe/model-driven-upgrade 2.9.0-alpha.9 → 2.10.0-alpha.2
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/upgrade/index.js +5 -1
- package/dist/esm/upgrade/v3_1.js +4 -1
- package/dist/esm/upgrade/v3_3.js +63 -0
- package/dist/esm/upgrade/v3_4.js +35 -0
- package/dist/index.umd.js +1 -1
- package/dist/types/upgrade/index.d.ts +3 -1
- package/dist/types/upgrade/v3_3.d.ts +3 -0
- package/dist/types/upgrade/v3_4.d.ts +3 -0
- package/package.json +5 -5
|
@@ -13,6 +13,8 @@ import { dataCleaner as dataCleanerV2_10toV3_0 } from "./v2_10";
|
|
|
13
13
|
import { dataCleaner as dataCleanerV3_0toV3_1 } from "./v3_0";
|
|
14
14
|
import { dataCleaner as dataCleanerV3_1toV3_2 } from "./v3_1";
|
|
15
15
|
import { dataCleaner as dataCleanerV3_1toV3_3 } from "./v3_2";
|
|
16
|
+
import { dataCleaner as dataCleanerV3_1toV3_4 } from "./v3_3";
|
|
17
|
+
import { dataCleaner as dataCleanerV3_1toV3_5 } from "./v3_4";
|
|
16
18
|
// TODO 切记复制粘贴的时候改一下from后边的路径,不然会出事儿
|
|
17
19
|
// TODO 注意从2.5版本开始,没有进行驼峰转下划线了,写的时候要注意
|
|
18
20
|
export default {
|
|
@@ -32,5 +34,7 @@ export default {
|
|
|
32
34
|
"v3.1": dataCleanerV3_1toV3_2,
|
|
33
35
|
"v3.2": dataCleanerV3_1toV3_3,
|
|
34
36
|
// 每次都需要预留一个下一版本的转换函数,会使用到对应的key作为当前最新的schema version
|
|
35
|
-
"v3.3":
|
|
37
|
+
"v3.3": dataCleanerV3_1toV3_4,
|
|
38
|
+
"v3.4": dataCleanerV3_1toV3_5,
|
|
39
|
+
"v3.5": function() {}
|
|
36
40
|
};
|
package/dist/esm/upgrade/v3_1.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @Autor: SuperLucky-Q
|
|
4
4
|
* @Date: 2023-02-16 14:45:22
|
|
5
5
|
* @LastEditors: SuperLuckyqi
|
|
6
|
-
* @LastEditTime:
|
|
6
|
+
* @LastEditTime: 2024-01-05 15:23:17
|
|
7
7
|
*/ function _define_property(obj, key, value) {
|
|
8
8
|
if (key in obj) {
|
|
9
9
|
Object.defineProperty(obj, key, {
|
|
@@ -160,6 +160,9 @@ function conversion(schema, payload) {
|
|
|
160
160
|
item.props.show_type = "icon";
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
+
if (item.props.flex === undefined) {
|
|
164
|
+
item.props.flex = 1;
|
|
165
|
+
}
|
|
163
166
|
});
|
|
164
167
|
}
|
|
165
168
|
//2023-12-24 qiyu 保证低版本升级上来时,默认是开启的
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Description: subtable-column 数据转换
|
|
3
|
+
* @Autor: SuperLucky-Q
|
|
4
|
+
* @Date: 2023-02-16 14:45:22
|
|
5
|
+
* @LastEditors: SuperLuckyqi
|
|
6
|
+
* @LastEditTime: 2024-01-09 18:06:49
|
|
7
|
+
*/ function _define_property(obj, key, value) {
|
|
8
|
+
if (key in obj) {
|
|
9
|
+
Object.defineProperty(obj, key, {
|
|
10
|
+
value: value,
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true
|
|
14
|
+
});
|
|
15
|
+
} else {
|
|
16
|
+
obj[key] = value;
|
|
17
|
+
}
|
|
18
|
+
return obj;
|
|
19
|
+
}
|
|
20
|
+
import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
|
|
21
|
+
var dataCleaner = function(schemaItems, payload) {
|
|
22
|
+
var isArray = Array.isArray(schemaItems);
|
|
23
|
+
var schemaArray = isArray ? schemaItems : [
|
|
24
|
+
schemaItems
|
|
25
|
+
];
|
|
26
|
+
var new_schema = loop(schemaArray, function(item) {
|
|
27
|
+
return conversion(item, payload);
|
|
28
|
+
});
|
|
29
|
+
return isArray ? new_schema : new_schema[0];
|
|
30
|
+
};
|
|
31
|
+
function conversion(schema, payload) {
|
|
32
|
+
//默认值 赋值
|
|
33
|
+
var addKeysDefaultValueMapping = _define_property({}, CONTROL_TYPE.SUBTABLE, [
|
|
34
|
+
{
|
|
35
|
+
key: "import_config",
|
|
36
|
+
value: {
|
|
37
|
+
template_type: "system",
|
|
38
|
+
template_list: []
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "export_config",
|
|
43
|
+
value: {
|
|
44
|
+
template_type: "system",
|
|
45
|
+
template_list: []
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]);
|
|
49
|
+
if (schema.type in addKeysDefaultValueMapping) {
|
|
50
|
+
addKeysDefaultValueMapping[schema.type].forEach(function(item) {
|
|
51
|
+
if (schema.props[item.key] === undefined) {
|
|
52
|
+
schema.props[item.key] = item.value;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (schema.type === "card-group") {
|
|
57
|
+
if (schema.props.isHideCaption === undefined) {
|
|
58
|
+
schema.props.isHideCaption = false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return schema;
|
|
62
|
+
}
|
|
63
|
+
export { dataCleaner };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Description: subtable-column 数据转换
|
|
3
|
+
* @Autor: SuperLucky-Q
|
|
4
|
+
* @Date: 2024-01-22 14:16:13
|
|
5
|
+
* @LastEditors: SuperLuckyqi
|
|
6
|
+
* @LastEditTime: 2024-01-22 14:19:43
|
|
7
|
+
*/ import { loop, CONTROL_TYPE, decamelizeKeys } from "@byteluck-fe/model-driven-shared";
|
|
8
|
+
import { MetaRowHeight } from "@byteluck-fe/model-driven-core";
|
|
9
|
+
var dataCleaner = function(schemaItems, payload) {
|
|
10
|
+
var isArray = Array.isArray(schemaItems);
|
|
11
|
+
var schemaArray = isArray ? schemaItems : [
|
|
12
|
+
schemaItems
|
|
13
|
+
];
|
|
14
|
+
var new_schema = loop(schemaArray, function(item) {
|
|
15
|
+
return conversion(item, payload);
|
|
16
|
+
});
|
|
17
|
+
return isArray ? new_schema : new_schema[0];
|
|
18
|
+
};
|
|
19
|
+
function conversion(schema, payload) {
|
|
20
|
+
if (schema.type === CONTROL_TYPE.TEXTAREA) {
|
|
21
|
+
var _schema_props_line_ellipsis, _schema_props_max_rows, _schema_props_line_ellipsis1;
|
|
22
|
+
var setting = {
|
|
23
|
+
rowHeightType: schema.props.auto_size === true ? "auto" : "fixed",
|
|
24
|
+
minRows: (_schema_props_line_ellipsis = schema.props.line_ellipsis) !== null && _schema_props_line_ellipsis !== void 0 ? _schema_props_line_ellipsis : 4,
|
|
25
|
+
maxRows: (_schema_props_max_rows = schema.props.max_rows) !== null && _schema_props_max_rows !== void 0 ? _schema_props_max_rows : 20,
|
|
26
|
+
fiexdRow: (_schema_props_line_ellipsis1 = schema.props.line_ellipsis) !== null && _schema_props_line_ellipsis1 !== void 0 ? _schema_props_line_ellipsis1 : 4
|
|
27
|
+
};
|
|
28
|
+
schema.props.row_height_setting = decamelizeKeys(new MetaRowHeight({
|
|
29
|
+
pc: setting,
|
|
30
|
+
mobile: setting
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
return schema;
|
|
34
|
+
}
|
|
35
|
+
export { dataCleaner };
|