@byteluck-fe/model-driven-upgrade 2.9.0-alpha.21 → 2.9.0-alpha.22

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,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 };