ronds-metadata 1.0.86 → 1.0.89

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.
@@ -72,7 +72,7 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
72
72
 
73
73
  if (_refId === 'com.ronds.schema.default.Rule.Form') {
74
74
  _properties = _properties.filter(function (it) {
75
- return it.id === 'common' || it.id === type;
75
+ return it.id === 'common' || it.id === 'common-en-US' || it.id === type;
76
76
  });
77
77
  }
78
78
 
@@ -8,7 +8,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
8
  /*
9
9
  * @Author: wangxian
10
10
  * @Date: 2021-09-18 14:15:04
11
- * @LastEditTime: 2022-05-07 10:48:55
11
+ * @LastEditTime: 2022-05-11 11:13:58
12
12
  */
13
13
  import React from 'react';
14
14
  import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
@@ -16,6 +16,7 @@ import { MetadataFormContext } from '../interface';
16
16
  import { useGetExtraInfo } from '../hooks';
17
17
  import { getDataCell } from '../utils';
18
18
  import { deepClone } from '../../../utils';
19
+ import { tr } from '../../../framework/locale';
19
20
 
20
21
  function Index(props) {
21
22
  var _fieldRule$, _fieldRule$$value;
@@ -116,7 +117,7 @@ function Index(props) {
116
117
  return add();
117
118
  },
118
119
  icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
119
- }, "\u6DFB\u52A0")));
120
+ }, tr('添加'))));
120
121
  })));
121
122
  }
122
123
 
@@ -48,10 +48,7 @@ function Index(props) {
48
48
  var _React$useState7 = React.useState(''),
49
49
  _React$useState8 = _slicedToArray(_React$useState7, 2),
50
50
  help = _React$useState8[0],
51
- setHelp = _React$useState8[1]; // if (id === 'enum') {
52
- // debugger;
53
- // }
54
-
51
+ setHelp = _React$useState8[1];
55
52
 
56
53
  var onSearch = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
57
54
  var param, server, res, _options, i, obj;
@@ -5,13 +5,19 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  /*
6
6
  * @Author: your name
7
7
  * @Date: 2021-09-18 14:15:04
8
- * @LastEditTime: 2022-05-05 09:37:02
8
+ * @LastEditTime: 2022-05-11 10:36:05
9
9
  * @LastEditors: Please set LastEditors
10
10
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
11
11
  * @FilePath: \ronds.metadata\src\comps\MetadataForm\hooks\index.tsx
12
12
  */
13
+ import { getLocale } from '../../../framework/locale';
13
14
  import moment from 'moment';
14
- import React from 'react';
15
+ import React from 'react'; // 主题样式名映射
16
+
17
+ var languageMap = {
18
+ 'zh-CN': 'common',
19
+ 'en-US': 'common-en-US'
20
+ };
15
21
  export var useGetExtraInfo = function useGetExtraInfo(fields, id, form, type) {
16
22
  var _React$useState = React.useState({}),
17
23
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -28,11 +34,12 @@ export var useGetExtraInfo = function useGetExtraInfo(fields, id, form, type) {
28
34
 
29
35
  for (var k in extraInfo) {
30
36
  _extraInfo[k] = extraInfo[k];
31
- } // 兼容 common公共的属性
32
-
37
+ }
33
38
 
34
- _extraInfo = _objectSpread(_objectSpread(_objectSpread({}, _extraInfo), _extraInfo['common']), _extraInfo[type]);
39
+ // 兼容 common公共的属性
40
+ _extraInfo = _objectSpread(_objectSpread(_objectSpread({}, _extraInfo), _extraInfo[languageMap[getLocale()]]), _extraInfo[type]);
35
41
  delete _extraInfo.common;
42
+ delete _extraInfo['common-en-US'];
36
43
  delete _extraInfo[type];
37
44
 
38
45
  // 时间格式转化
@@ -1,7 +1,6 @@
1
1
  import { FormInstance } from 'antd/lib/form/hooks/useForm';
2
2
  import './index.less';
3
3
  import { IMetaData } from '../../framework/metadata/types';
4
- import '../../theme.less';
5
4
  interface IMetadataFormProps {
6
5
  /**
7
6
  * 通过元数据JsonShema渲染表单
@@ -11,7 +11,6 @@ import { JsonMetadataProvider } from '../../framework/metadata';
11
11
  import { MetadataService } from '../../framework/metadata/MetadataService';
12
12
  import useMemoSubject from '../../framework/rxjs-hooks/useMemoSubject';
13
13
  import useObservable from '../../framework/rxjs-hooks/useObservable';
14
- import "../../theme.css";
15
14
 
16
15
  var MetadataForm = function MetadataForm(props) {
17
16
  var _Form$useForm = _Form.useForm(),
@@ -1,6 +1,7 @@
1
1
  declare const _default: {
2
2
  操作: string;
3
3
  添加一行: string;
4
+ 添加: string;
4
5
  编辑: string;
5
6
  删除: string;
6
7
  确定: string;
@@ -1,6 +1,7 @@
1
1
  export default {
2
2
  操作: 'Operation',
3
3
  添加一行: 'Add New Line',
4
+ 添加: 'Add',
4
5
  编辑: 'Edit',
5
6
  删除: 'Delete',
6
7
  确定: 'Confirm',
@@ -1,6 +1,7 @@
1
1
  declare const _default: {
2
2
  操作: string;
3
3
  添加一行: string;
4
+ 添加: string;
4
5
  编辑: string;
5
6
  删除: string;
6
7
  确定: string;
@@ -1,6 +1,7 @@
1
1
  export default {
2
2
  操作: '操作',
3
3
  添加一行: '添加一行',
4
+ 添加: '添加',
4
5
  编辑: '编辑',
5
6
  删除: '删除',
6
7
  确定: '确定',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.0.86",
4
+ "version": "1.0.89",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",