ronds-metadata 1.0.81 → 1.0.84
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/es/comps/Editable/comps/EditableAction.js +1 -1
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +15 -10
- package/es/comps/locales/index.d.ts +0 -1
- package/es/comps/locales/index.js +4 -6
- package/es/config.js +8 -7
- package/es/framework/locale/index.d.ts +1 -0
- package/es/framework/locale/index.js +3 -1
- package/package.json +1 -1
@@ -5,7 +5,7 @@ import _Button from "antd/es/button";
|
|
5
5
|
import React from 'react';
|
6
6
|
import { EditableContext } from '../interface';
|
7
7
|
import { isFreeEditRow } from '../utils';
|
8
|
-
import { tr } from '
|
8
|
+
import { tr } from '../../../framework/locale';
|
9
9
|
|
10
10
|
var EditableAction = function EditableAction(props) {
|
11
11
|
var _editConfig$editCellK;
|
@@ -189,6 +189,11 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
189
189
|
while (1) {
|
190
190
|
switch (_context4.prev = _context4.next) {
|
191
191
|
case 0:
|
192
|
+
if (!defaultValues) {
|
193
|
+
_context4.next = 17;
|
194
|
+
break;
|
195
|
+
}
|
196
|
+
|
192
197
|
_ruleTypes = ruleTypes;
|
193
198
|
_refIds = refIds;
|
194
199
|
form.setFieldsValue({
|
@@ -196,40 +201,40 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
196
201
|
});
|
197
202
|
i = 0;
|
198
203
|
|
199
|
-
case
|
204
|
+
case 5:
|
200
205
|
if (!(i < defaultValues.length)) {
|
201
|
-
_context4.next =
|
206
|
+
_context4.next = 15;
|
202
207
|
break;
|
203
208
|
}
|
204
209
|
|
205
210
|
_ruleTypes[i] = defaultValues[i].type;
|
206
211
|
|
207
212
|
if (!(defaultValues[i].type === 'ref')) {
|
208
|
-
_context4.next =
|
213
|
+
_context4.next = 12;
|
209
214
|
break;
|
210
215
|
}
|
211
216
|
|
212
217
|
if (!(defaultValues[i].refId.indexOf('Rule.Form') > -1)) {
|
213
|
-
_context4.next =
|
218
|
+
_context4.next = 11;
|
214
219
|
break;
|
215
220
|
}
|
216
221
|
|
217
|
-
_context4.next =
|
222
|
+
_context4.next = 11;
|
218
223
|
return processSpecialRuleData(defaultValues[i].refId, i);
|
219
224
|
|
220
|
-
case
|
225
|
+
case 11:
|
221
226
|
_refIds[i] = defaultValues[i].refId;
|
222
227
|
|
223
|
-
case
|
228
|
+
case 12:
|
224
229
|
i++;
|
225
|
-
_context4.next =
|
230
|
+
_context4.next = 5;
|
226
231
|
break;
|
227
232
|
|
228
|
-
case
|
233
|
+
case 15:
|
229
234
|
setRefIds(_objectSpread({}, _refIds));
|
230
235
|
setRuleTypes(_objectSpread({}, _ruleTypes));
|
231
236
|
|
232
|
-
case
|
237
|
+
case 17:
|
233
238
|
case "end":
|
234
239
|
return _context4.stop();
|
235
240
|
}
|
@@ -1,10 +1,8 @@
|
|
1
1
|
import zhCN from './zh-CN';
|
2
2
|
import enUS from './en-US';
|
3
3
|
import { initLocale } from '../../framework/locale';
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
});
|
9
|
-
};
|
4
|
+
initLocale({
|
5
|
+
'zh-CN': zhCN,
|
6
|
+
'en-US': enUS
|
7
|
+
});
|
10
8
|
export { setLocale, getLocale } from '../../framework/locale';
|
package/es/config.js
CHANGED
@@ -3,17 +3,17 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
/*
|
4
4
|
* @Author: wangxian
|
5
5
|
* @Date: 2021-09-18 14:15:04
|
6
|
-
* @LastEditTime: 2022-05-
|
6
|
+
* @LastEditTime: 2022-05-10 08:41:39
|
7
7
|
*/
|
8
8
|
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
9
9
|
import { distinctUntilChanged } from 'rxjs/internal/operators/distinctUntilChanged';
|
10
10
|
import { map } from 'rxjs/internal/operators/map';
|
11
|
-
import {
|
11
|
+
import { setLocale } from './comps/locales/index';
|
12
12
|
import * as jq from './framework/libs/jquery.min.js';
|
13
|
-
import {
|
13
|
+
import { localeKey } from './framework/locale';
|
14
14
|
window.jQuery = window.jQuery || jq;
|
15
15
|
var defaultConfig = {
|
16
|
-
locale: '
|
16
|
+
locale: window.localStorage.getItem(localeKey) || 'zh-CN',
|
17
17
|
theme: 'normal',
|
18
18
|
msgpack: false,
|
19
19
|
openLoading: true,
|
@@ -21,9 +21,10 @@ var defaultConfig = {
|
|
21
21
|
};
|
22
22
|
export var cssPrefix = 'ronds-metadata';
|
23
23
|
export var globalSettingStream = new BehaviorSubject(defaultConfig);
|
24
|
-
globalSettingStream.
|
25
|
-
|
26
|
-
|
24
|
+
globalSettingStream.pipe(map(function (p) {
|
25
|
+
return p.locale;
|
26
|
+
}), distinctUntilChanged()).subscribe(function (p) {
|
27
|
+
setLocale(p);
|
27
28
|
});
|
28
29
|
globalSettingStream.pipe(map(function (p) {
|
29
30
|
return p.theme;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import DI18n from './dil8/index';
|
2
|
+
export declare const localeKey = "epm_locale";
|
2
3
|
declare let di18n: DI18n;
|
3
4
|
export declare function initLocale(messages: Record<'zh-CN' | 'en-US', Record<string, string>>): void;
|
4
5
|
export declare function setLocale(l: 'zh-CN' | 'en-US'): void;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import DI18n from './dil8/index';
|
2
|
+
export var localeKey = 'epm_locale';
|
2
3
|
var di18n = new DI18n({
|
3
|
-
locale: 'zh-CN',
|
4
|
+
locale: window.localStorage.getItem(localeKey) || 'zh-CN',
|
4
5
|
isReplace: false,
|
5
6
|
messages: {}
|
6
7
|
});
|
@@ -8,6 +9,7 @@ export function initLocale(messages) {
|
|
8
9
|
di18n.setMessages(messages);
|
9
10
|
}
|
10
11
|
export function setLocale(l) {
|
12
|
+
window.localStorage.setItem(localeKey, l || '');
|
11
13
|
di18n.setLocale(l);
|
12
14
|
}
|
13
15
|
export function getLocale() {
|