@cloudtower/eagle 0.31.20 → 0.31.21
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/dist/cjs/UIKitProvider/index.js +2 -16
- package/dist/cjs/core/ConfigProvider/index.js +37 -1
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +3678 -3679
- package/dist/esm/UIKitProvider/index.js +2 -12
- package/dist/esm/core/ConfigProvider/index.js +32 -2
- package/dist/esm/stats1.html +1 -1
- package/dist/src/UIKitProvider/UIKitProvider.stories.d.ts +1 -2
- package/dist/src/antd.d.ts +1 -0
- package/dist/src/core/ConfigProvider/index.d.ts +2 -0
- package/dist/stories/docs/coreX/Calendar.stories.d.ts +11 -0
- package/dist/style.css +3745 -3745
- package/package.json +6 -4
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { parrotI18n } from '@cloudtower/parrot';
|
|
2
2
|
import _message from '../core/message/index.js';
|
|
3
3
|
import { antdKit } from '../legacy-antd.js';
|
|
4
|
-
import enUS from 'antd/lib/locale/en_US';
|
|
5
|
-
import zhCN from 'antd/lib/locale/zh_CN';
|
|
6
|
-
import antd5enUS from 'antd5/lib/locale/en_US';
|
|
7
|
-
import antd5zhCN from 'antd5/lib/locale/zh_CN';
|
|
8
4
|
import React__default, { createContext, useMemo, useEffect, useContext } from 'react';
|
|
9
5
|
import { ConfigProvider } from '../core/ConfigProvider/index.js';
|
|
10
6
|
import { createBatchMessageMethods } from '../core/message-group/index.js';
|
|
@@ -55,14 +51,8 @@ const UIKitProvider = (props) => {
|
|
|
55
51
|
return /* @__PURE__ */ React__default.createElement(kitContext.Provider, { value: _kit }, /* @__PURE__ */ React__default.createElement(MessageContext.Provider, { value: batchMessage != null ? batchMessage : _message }, /* @__PURE__ */ React__default.createElement(
|
|
56
52
|
ConfigProvider,
|
|
57
53
|
{
|
|
58
|
-
antd4Configs: __spreadValues({
|
|
59
|
-
|
|
60
|
-
locale: lng === "zh-CN" ? zhCN : enUS
|
|
61
|
-
}, config == null ? void 0 : config.antd4Configs),
|
|
62
|
-
antd5Configs: __spreadValues({
|
|
63
|
-
autoInsertSpaceInButton: false,
|
|
64
|
-
locale: lng === "zh-CN" ? antd5zhCN : antd5enUS
|
|
65
|
-
}, config == null ? void 0 : config.antd5Configs)
|
|
54
|
+
antd4Configs: __spreadValues({}, config == null ? void 0 : config.antd4Configs),
|
|
55
|
+
antd5Configs: __spreadValues({}, config == null ? void 0 : config.antd5Configs)
|
|
66
56
|
},
|
|
67
57
|
children
|
|
68
58
|
)));
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import useParrotTranslation from '../../hooks/useParrotTranslation.js';
|
|
1
2
|
import { ConfigProvider as ConfigProvider$2 } from 'antd';
|
|
2
3
|
import { ConfigProvider as ConfigProvider$1 } from 'antd5';
|
|
3
|
-
import React__default from 'react';
|
|
4
|
+
import React__default, { useEffect } from 'react';
|
|
5
|
+
import enUS from 'antd/lib/locale/en_US';
|
|
6
|
+
import zhCN from 'antd/lib/locale/zh_CN';
|
|
7
|
+
import antd5enUS from 'antd5/lib/locale/en_US';
|
|
8
|
+
import antd5zhCN from 'antd5/lib/locale/zh_CN';
|
|
9
|
+
import moment from 'moment';
|
|
10
|
+
import dayjs from 'dayjs';
|
|
4
11
|
|
|
5
12
|
var __defProp = Object.defineProperty;
|
|
6
13
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -23,7 +30,30 @@ const ConfigProvider = ({
|
|
|
23
30
|
antd4Configs,
|
|
24
31
|
children
|
|
25
32
|
}) => {
|
|
26
|
-
|
|
33
|
+
const { i18n } = useParrotTranslation();
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const adjustDateLocale = (lng) => {
|
|
36
|
+
moment.locale(lng === "zh-CN" ? "zh-cn" : "en");
|
|
37
|
+
dayjs.locale(lng === "zh-CN" ? "zh-cn" : "en");
|
|
38
|
+
};
|
|
39
|
+
i18n.on("languageChanged", adjustDateLocale);
|
|
40
|
+
adjustDateLocale(i18n.language);
|
|
41
|
+
}, []);
|
|
42
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
43
|
+
ConfigProvider$1,
|
|
44
|
+
__spreadValues({
|
|
45
|
+
autoInsertSpaceInButton: false,
|
|
46
|
+
locale: i18n.language === "zh-CN" ? antd5zhCN : antd5enUS
|
|
47
|
+
}, antd5Configs),
|
|
48
|
+
/* @__PURE__ */ React__default.createElement(
|
|
49
|
+
ConfigProvider$2,
|
|
50
|
+
__spreadValues({
|
|
51
|
+
autoInsertSpaceInButton: false,
|
|
52
|
+
locale: i18n.language === "zh-CN" ? zhCN : enUS
|
|
53
|
+
}, antd4Configs),
|
|
54
|
+
children
|
|
55
|
+
)
|
|
56
|
+
);
|
|
27
57
|
};
|
|
28
58
|
|
|
29
59
|
export { ConfigProvider };
|