@pisell/materials 1.0.198 → 1.0.200
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/lowcode/item/meta.ts
CHANGED
package/lowcode/table/meta.ts
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import snippets from "./snippets";
|
|
2
2
|
import button from "../button/meta";
|
|
3
3
|
|
|
4
|
+
const getI18n = (item: {
|
|
5
|
+
"type": string,
|
|
6
|
+
"key": string,
|
|
7
|
+
"en": string,
|
|
8
|
+
"zh-CN": string,
|
|
9
|
+
"zh-HK": string
|
|
10
|
+
} | string) => {
|
|
11
|
+
if (typeof item === "string") {
|
|
12
|
+
return item
|
|
13
|
+
}
|
|
14
|
+
if (item.type === 'i18n') {
|
|
15
|
+
return item["zh-CN"] || item['zh-HK'] || item['en']
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
4
19
|
export default {
|
|
5
20
|
snippets,
|
|
6
21
|
componentName: "Table",
|
|
@@ -1058,10 +1073,7 @@ export default {
|
|
|
1058
1073
|
options: target.parent.parent.parent
|
|
1059
1074
|
.getPropValue("columns")
|
|
1060
1075
|
.map((item) => ({
|
|
1061
|
-
title:
|
|
1062
|
-
typeof item.title === "string"
|
|
1063
|
-
? item.title
|
|
1064
|
-
: item.key,
|
|
1076
|
+
title: getI18n(item.title) || item.key,
|
|
1065
1077
|
value: item.key,
|
|
1066
1078
|
disabled: fieldsKey.includes(item.key),
|
|
1067
1079
|
})),
|
|
@@ -1218,10 +1230,7 @@ export default {
|
|
|
1218
1230
|
options: target.parent.parent.parent
|
|
1219
1231
|
.getPropValue("columns")
|
|
1220
1232
|
.map((item) => ({
|
|
1221
|
-
title:
|
|
1222
|
-
typeof item.title === "string"
|
|
1223
|
-
? item.title
|
|
1224
|
-
: item.key,
|
|
1233
|
+
title: getI18n(item.title) || item.key,
|
|
1225
1234
|
value: item.key,
|
|
1226
1235
|
disabled: fieldsKey.includes(item.key),
|
|
1227
1236
|
})),
|
|
@@ -1444,10 +1453,7 @@ export default {
|
|
|
1444
1453
|
options: target.parent.parent.parent
|
|
1445
1454
|
.getPropValue("columns")
|
|
1446
1455
|
.map((item) => ({
|
|
1447
|
-
title:
|
|
1448
|
-
typeof item.title === "string"
|
|
1449
|
-
? item.title
|
|
1450
|
-
: item.key,
|
|
1456
|
+
title: getI18n(item.title) || item.key,
|
|
1451
1457
|
value: item.key,
|
|
1452
1458
|
disabled: fieldsKey.includes(item.key),
|
|
1453
1459
|
})),
|