ronds-metadata 1.3.36 → 1.3.38

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/es/comps/DynamicPorts/comps/NodeElementForm.js +5 -4
  2. package/es/comps/DynamicPorts/comps/NodeElementNormal.js +5 -4
  3. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Checkbox.js +3 -2
  4. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Color.js +2 -1
  5. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Date.js +3 -2
  6. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Input.js +3 -2
  7. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/MutiSelect.js +4 -3
  8. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Number.js +3 -2
  9. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/NumberRange.js +1 -1
  10. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Password.js +3 -2
  11. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Radio.js +3 -2
  12. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Select.js +4 -3
  13. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/TextArea.js +4 -3
  14. package/es/comps/FormGenerator/comps/Canvas/core/index.js +3 -2
  15. package/es/comps/FormGenerator/comps/Canvas/index.js +7 -6
  16. package/es/comps/FormGenerator/comps/Settings/index.js +3 -2
  17. package/es/comps/FormGenerator/comps/Sidebar/Elements.js +3 -2
  18. package/es/comps/FormGenerator/comps/Sidebar/index.js +3 -2
  19. package/es/comps/FormGenerator/settings/ruleConfig.js +47 -46
  20. package/es/comps/MetadataForm/DataCell/Array.js +3 -3
  21. package/es/comps/MetadataForm/DataCell/Input.js +18 -18
  22. package/es/comps/MetadataForm/DataCell/Number.js +16 -16
  23. package/es/comps/MetadataForm/DataCell/Ref.js +12 -12
  24. package/es/comps/MetadataForm/DataCell/Select.js +19 -19
  25. package/es/comps/MetadataForm/DataCell/Switch.js +12 -12
  26. package/es/comps/MetadataForm/DataCell/layout/TableArray.js +3 -2
  27. package/es/comps/locales/en-US.d.ts +1 -0
  28. package/es/comps/locales/en-US.js +3 -2
  29. package/es/comps/locales/zh-CN.d.ts +1 -0
  30. package/es/comps/locales/zh-CN.js +3 -2
  31. package/es/config.d.ts +4 -0
  32. package/es/config.js +17 -2
  33. package/package.json +3 -1
@@ -37,7 +37,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
37
37
  /*
38
38
  * @Author:wangxian
39
39
  * @Date: 2021-09-18 14:15:04
40
- * @LastEditTime: 2024-02-26 10:27:57
40
+ * @LastEditTime: 2024-04-17 09:50:12
41
41
  */
42
42
  import React from 'react';
43
43
  import { MetadataFormContext, MetadataRefContext } from '../interface';
@@ -444,10 +444,10 @@ function Index(props) {
444
444
  labelInValue: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelInValue,
445
445
  allowClear: true,
446
446
  disabled: (_extraInfo$disabled2 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled2 !== void 0 ? _extraInfo$disabled2 : disabled,
447
- placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder,
447
+ placeholder: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder),
448
448
  maxTagCount: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxTagCount,
449
449
  maxTagTextLength: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxTagTextLength,
450
- maxTagPlaceholder: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxTagPlaceholder) || maxTagPlaceholder
450
+ maxTagPlaceholder: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxTagPlaceholder) || maxTagPlaceholder
451
451
  });
452
452
  } else if (isPagination) {
453
453
  var _extraInfo$disabled3;
@@ -455,7 +455,7 @@ function Index(props) {
455
455
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.isMutiple) ? 'multiple' : extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.mode,
456
456
  onSelect: onSelect,
457
457
  disabled: (_extraInfo$disabled3 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled3 !== void 0 ? _extraInfo$disabled3 : disabled,
458
- placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder,
458
+ placeholder: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder),
459
459
  options: httpOptions && httpOptions.length > 0 ? httpOptions : options,
460
460
  dropdownRender: function dropdownRender(menu) {
461
461
  return /*#__PURE__*/React.createElement(React.Fragment, null, menu, /*#__PURE__*/React.createElement(_Divider, {
@@ -496,7 +496,7 @@ function Index(props) {
496
496
  span: extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$checkbox = extraInfo.checkbox) === null || _extraInfo$checkbox === void 0 ? void 0 : _extraInfo$checkbox.colSpan
497
497
  }, /*#__PURE__*/React.createElement(_Checkbox, {
498
498
  value: it.value
499
- }, it.label));
499
+ }, tr(it.label)));
500
500
  }))) : /*#__PURE__*/React.createElement(_Radio.Group, {
501
501
  style: {
502
502
  width: '100%'
@@ -508,7 +508,7 @@ function Index(props) {
508
508
  span: extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$checkbox2 = extraInfo.checkbox) === null || _extraInfo$checkbox2 === void 0 ? void 0 : _extraInfo$checkbox2.colSpan
509
509
  }, /*#__PURE__*/React.createElement(_Radio, {
510
510
  value: it.value
511
- }, it.label));
511
+ }, tr(it.label)));
512
512
  })));
513
513
  } else {
514
514
  var _extraInfo$disabled4;
@@ -516,7 +516,7 @@ function Index(props) {
516
516
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.isMutiple) ? 'multiple' : extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.mode,
517
517
  onSelect: onSelect,
518
518
  disabled: (_extraInfo$disabled4 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled4 !== void 0 ? _extraInfo$disabled4 : disabled,
519
- placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder,
519
+ placeholder: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder),
520
520
  options: myOptions,
521
521
  showSearch: true,
522
522
  filterOption: function filterOption(input, option) {
@@ -531,7 +531,7 @@ function Index(props) {
531
531
  labelInValue: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelInValue,
532
532
  maxTagCount: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxTagCount,
533
533
  maxTagTextLength: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxTagTextLength,
534
- maxTagPlaceholder: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxTagPlaceholder) || maxTagPlaceholder
534
+ maxTagPlaceholder: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxTagPlaceholder) || maxTagPlaceholder
535
535
  });
536
536
  }
537
537
  };
@@ -546,7 +546,7 @@ function Index(props) {
546
546
  style: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color) ? {
547
547
  color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
548
548
  } : {}
549
- }, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
549
+ }, tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
550
550
  labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
551
551
  flex: "0 0 ".concat(labelSpan * 100 / 24, "%"),
552
552
  offset: 0
@@ -561,10 +561,10 @@ function Index(props) {
561
561
  name: [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name)),
562
562
  rules: [{
563
563
  required: notRequire ? !notRequire : extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require,
564
- message: "".concat(tr('请输入')).concat((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
564
+ message: "".concat(tr('请输入'), " ").concat(tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
565
565
  }],
566
- help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
567
- tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
566
+ help: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help),
567
+ tooltip: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip)
568
568
  }), processSelectType((_extraInfo$http8 = extraInfo.http) === null || _extraInfo$http8 === void 0 ? void 0 : _extraInfo$http8.isCascader, (_extraInfo$http9 = extraInfo.http) === null || _extraInfo$http9 === void 0 ? void 0 : _extraInfo$http9.isTreeSelect, (_extraInfo$http10 = extraInfo.http) === null || _extraInfo$http10 === void 0 ? void 0 : _extraInfo$http10.isPagination));
569
569
  }
570
570
  return !field ? /*#__PURE__*/React.createElement(_Form.Item, {
@@ -577,7 +577,7 @@ function Index(props) {
577
577
  style: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color) ? {
578
578
  color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
579
579
  } : {}
580
- }, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
580
+ }, tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
581
581
  labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
582
582
  flex: "0 0 ".concat(labelSpan * 100 / 24, "%"),
583
583
  offset: 0
@@ -592,10 +592,10 @@ function Index(props) {
592
592
  name: name,
593
593
  rules: [{
594
594
  required: notRequire ? !notRequire : extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require,
595
- message: "".concat(tr('请输入')).concat((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
595
+ message: "".concat(tr('请输入'), " ").concat(tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
596
596
  }],
597
- help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
598
- tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
597
+ help: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help),
598
+ tooltip: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip)
599
599
  }, processSelectType((_extraInfo$http11 = extraInfo.http) === null || _extraInfo$http11 === void 0 ? void 0 : _extraInfo$http11.isCascader, (_extraInfo$http12 = extraInfo.http) === null || _extraInfo$http12 === void 0 ? void 0 : _extraInfo$http12.isTreeSelect, (_extraInfo$http13 = extraInfo.http) === null || _extraInfo$http13 === void 0 ? void 0 : _extraInfo$http13.isPagination)) : /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
600
600
  style: {
601
601
  flex: 1,
@@ -604,10 +604,10 @@ function Index(props) {
604
604
  name: [field === null || field === void 0 ? void 0 : field.name],
605
605
  rules: [{
606
606
  required: notRequire ? !notRequire : extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require,
607
- message: "".concat(tr('请输入')).concat((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
607
+ message: "".concat(tr('请输入'), " ").concat(tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
608
608
  }],
609
- help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
610
- tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
609
+ help: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help),
610
+ tooltip: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip)
611
611
  }), processSelectType((_extraInfo$http14 = extraInfo.http) === null || _extraInfo$http14 === void 0 ? void 0 : _extraInfo$http14.isCascader, (_extraInfo$http15 = extraInfo.http) === null || _extraInfo$http15 === void 0 ? void 0 : _extraInfo$http15.isTreeSelect, (_extraInfo$http16 = extraInfo.http) === null || _extraInfo$http16 === void 0 ? void 0 : _extraInfo$http16.isPagination));
612
612
  }
613
613
  export default /*#__PURE__*/React.memo(Index);
@@ -7,7 +7,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
7
7
  /*
8
8
  * @Author: wangxian
9
9
  * @Date: 2021-09-18 14:15:04
10
- * @LastEditTime: 2024-02-27 09:47:00
10
+ * @LastEditTime: 2024-04-17 09:52:06
11
11
  */
12
12
  import React from 'react';
13
13
  import { MetadataFormContext, MetadataRefContext } from '../interface';
@@ -37,7 +37,7 @@ function Index(props) {
37
37
  style: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color) ? {
38
38
  color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
39
39
  } : {}
40
- }, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
40
+ }, tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
41
41
  labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
42
42
  span: labelSpan,
43
43
  offset: 0
@@ -53,10 +53,10 @@ function Index(props) {
53
53
  valuePropName: "checked",
54
54
  rules: [{
55
55
  required: notRequire ? !notRequire : extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require,
56
- message: "".concat(tr('请输入')).concat((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
56
+ message: "".concat(tr('请输入'), " ").concat(tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
57
57
  }],
58
- help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
59
- tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
58
+ help: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help),
59
+ tooltip: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip)
60
60
  }), /*#__PURE__*/React.createElement(_Switch, {
61
61
  disabled: (_extraInfo$disabled = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled !== void 0 ? _extraInfo$disabled : disabled,
62
62
  checkedChildren: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.checkedChildren,
@@ -68,7 +68,7 @@ function Index(props) {
68
68
  style: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color) ? {
69
69
  color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
70
70
  } : {}
71
- }, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
71
+ }, tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
72
72
  labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
73
73
  flex: "0 0 ".concat(labelSpan * 100 / 24, "%"),
74
74
  offset: 0
@@ -89,10 +89,10 @@ function Index(props) {
89
89
  valuePropName: "checked",
90
90
  rules: [{
91
91
  required: notRequire ? !notRequire : extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require,
92
- message: "".concat(tr('请输入')).concat((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
92
+ message: "".concat(tr('请输入'), " ").concat(tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
93
93
  }],
94
- help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
95
- tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
94
+ help: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help),
95
+ tooltip: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip)
96
96
  }, /*#__PURE__*/React.createElement(_Switch, {
97
97
  disabled: (_extraInfo$disabled2 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled2 !== void 0 ? _extraInfo$disabled2 : disabled,
98
98
  checkedChildren: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.checkedChildren,
@@ -106,10 +106,10 @@ function Index(props) {
106
106
  valuePropName: "checked",
107
107
  rules: [{
108
108
  required: notRequire ? !notRequire : extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require,
109
- message: "".concat(tr('请输入')).concat((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
109
+ message: "".concat(tr('请输入'), " ").concat(tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id)
110
110
  }],
111
- help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
112
- tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
111
+ help: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help),
112
+ tooltip: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip)
113
113
  }), /*#__PURE__*/React.createElement(_Switch, {
114
114
  disabled: (_extraInfo$disabled3 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled3 !== void 0 ? _extraInfo$disabled3 : disabled,
115
115
  checkedChildren: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.checkedChildren,
@@ -17,6 +17,7 @@ import { MetadataFormContext } from '../../interface';
17
17
  import { assignReplace, getLabelByProps } from '../../utils';
18
18
  import { deepClone, getConstantValue } from '../../../../utils';
19
19
  import { STREAM_EVENT_TYPE } from '../../constants';
20
+ import { tr } from '../../../../framework/locale';
20
21
  var TableArray = function TableArray(props) {
21
22
  var initValue = props.initValue,
22
23
  readonly = props.readonly,
@@ -239,7 +240,7 @@ var TableArray = function TableArray(props) {
239
240
  }
240
241
  _enum.forEach(function (it) {
241
242
  var obj = {
242
- label: it.value,
243
+ label: tr(it.value),
243
244
  value: (it === null || it === void 0 ? void 0 : it.key) || (it === null || it === void 0 ? void 0 : it.value)
244
245
  };
245
246
  _options.push(obj);
@@ -262,7 +263,7 @@ var TableArray = function TableArray(props) {
262
263
  var it = _properties[i];
263
264
  var extraInfo = refFieldsRef.current.get(it.id);
264
265
  var obj = {
265
- title: getLabelByProps(it),
266
+ title: tr(getLabelByProps(it)),
266
267
  key: it.id,
267
268
  dataIndex: it.id,
268
269
  width: processColumnType(it, extraInfo) === 'buttonCell' ? 25 : 50,
@@ -16,5 +16,6 @@ declare const _default: {
16
16
  缩小: string;
17
17
  实际尺寸: string;
18
18
  适应画布: string;
19
+ 上传: string;
19
20
  };
20
21
  export default _default;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: wangxian
3
3
  * @Date: 2022-05-09 11:53:44
4
- * @LastEditTime: 2022-05-28 10:21:09
4
+ * @LastEditTime: 2024-04-16 16:09:52
5
5
  */
6
6
  export default {
7
7
  操作: 'Operation',
@@ -20,5 +20,6 @@ export default {
20
20
  放大: 'Enlarge',
21
21
  缩小: 'zoom out',
22
22
  实际尺寸: 'Actual size',
23
- 适应画布: 'Fit to canvas'
23
+ 适应画布: 'Fit to canvas',
24
+ 上传: 'Upload'
24
25
  };
@@ -16,5 +16,6 @@ declare const _default: {
16
16
  缩小: string;
17
17
  实际尺寸: string;
18
18
  适应画布: string;
19
+ 上传: string;
19
20
  };
20
21
  export default _default;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: wangxian
3
3
  * @Date: 2022-05-09 11:53:44
4
- * @LastEditTime: 2022-05-28 10:19:25
4
+ * @LastEditTime: 2024-04-16 16:10:08
5
5
  */
6
6
  export default {
7
7
  操作: '操作',
@@ -20,5 +20,6 @@ export default {
20
20
  放大: '放大',
21
21
  缩小: '缩小',
22
22
  实际尺寸: '实际尺寸',
23
- 适应画布: '适应画布'
23
+ 适应画布: '适应画布',
24
+ 上传: '上传'
24
25
  };
package/es/config.d.ts CHANGED
@@ -6,6 +6,10 @@ export interface IConfig {
6
6
  msgpack: boolean;
7
7
  openLoading: boolean;
8
8
  baseUrl: string;
9
+ translate: {
10
+ 'zh-CN': any;
11
+ 'en-US': any;
12
+ };
9
13
  }
10
14
  export declare const cssPrefix = "ronds-metadata";
11
15
  export declare const globalSettingStream: BehaviorSubject<IConfig>;
package/es/config.js CHANGED
@@ -2,19 +2,26 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  /*
3
3
  * @Author: wangxian
4
4
  * @Date: 2021-09-18 14:15:04
5
- * @LastEditTime: 2023-06-08 15:39:28
5
+ * @LastEditTime: 2024-04-16 16:51:55
6
6
  */
7
7
  import { BehaviorSubject, map, distinctUntilChanged } from 'rxjs';
8
8
  import { setLocale } from './comps/locales/index';
9
+ import { initLocale } from './framework/locale';
9
10
  import * as jq from './framework/libs/jquery.min.js';
10
11
  import { localeKey } from './framework/locale';
12
+ import zhCN from './comps/locales/zh-CN';
13
+ import enUS from './comps/locales/en-US';
11
14
  window.jQuery = window.jQuery || jq;
12
15
  var defaultConfig = {
13
16
  locale: window.localStorage.getItem(localeKey) || 'zh-CN',
14
17
  theme: 'normal',
15
18
  msgpack: false,
16
19
  openLoading: true,
17
- baseUrl: '/phm'
20
+ baseUrl: '/phm',
21
+ translate: {
22
+ 'zh-CN': zhCN,
23
+ 'en-US': enUS
24
+ }
18
25
  };
19
26
  export var cssPrefix = 'ronds-metadata';
20
27
  export var globalSettingStream = new BehaviorSubject(defaultConfig);
@@ -23,6 +30,14 @@ globalSettingStream.pipe(map(function (p) {
23
30
  }), distinctUntilChanged()).subscribe(function (p) {
24
31
  setLocale(p);
25
32
  });
33
+ globalSettingStream.pipe(map(function (p) {
34
+ return p.translate;
35
+ }), distinctUntilChanged()).subscribe(function (p) {
36
+ initLocale({
37
+ 'zh-CN': _objectSpread(_objectSpread({}, zhCN), p['zh-CN']),
38
+ 'en-US': _objectSpread(_objectSpread({}, enUS), p['en-US'])
39
+ });
40
+ });
26
41
  globalSettingStream.pipe(map(function (p) {
27
42
  return p.theme;
28
43
  }), distinctUntilChanged()).subscribe(function (p) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.3.36",
4
+ "version": "1.3.38",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",
@@ -81,6 +81,7 @@
81
81
  "remark-gfm": "^3.0.1",
82
82
  "ronds-react-markdown": "^1.0.12",
83
83
  "rxjs": "^7.5.4",
84
+ "walk": "^2.3.15",
84
85
  "xlsx": "^0.18.5"
85
86
  },
86
87
  "peerDependencies": {
@@ -107,6 +108,7 @@
107
108
  "gh-pages": "^3.0.0",
108
109
  "less-loader": "^7.0.0",
109
110
  "lint-staged": "^10.0.7",
111
+ "node-xlsx": "^0.24.0",
110
112
  "prettier": "^2.2.1",
111
113
  "style-loader": "^1.2.1",
112
114
  "webpack-cli": "^3.3.12",