xmirror-components 1.0.30-alpha.8 → 1.0.30
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/README.md +1129 -11
- package/build/dist/index.cjs +36 -36
- package/build/dist/index.mjs +1914 -1884
- package/build/es/components/ConfigProvider/index.js +11 -14
- package/build/es/components/ConfigProvider/types.d.ts +2 -0
- package/build/es/components/IntlProvider/FormattedMessage/index.d.ts +7 -0
- package/build/es/components/IntlProvider/FormattedMessage/index.js +8 -0
- package/build/es/components/IntlProvider/index.d.ts +12 -0
- package/build/es/components/IntlProvider/index.js +17 -0
- package/build/es/components/IntlProvider/types.d.ts +7 -0
- package/build/es/components/IntlProvider/types.js +1 -0
- package/build/es/components/IntlProvider/useIntl/index.d.ts +14 -0
- package/build/es/components/IntlProvider/useIntl/index.js +26 -0
- package/build/es/components/SearchArea/ToggleButton/index.js +2 -1
- package/build/es/components/SearchArea/index.js +6 -3
- package/build/es/components/Table/Footer/index.d.ts +1 -1
- package/build/es/components/Table/Footer/index.js +1 -1
- package/build/es/components/Table/PopoverSetColumns/index.js +1 -1
- package/build/es/hooks/useTable/index.js +1 -1
- package/build/es/locale/en-us.d.ts +25 -0
- package/build/es/locale/en-us.js +27 -0
- package/build/es/locale/index.d.ts +3 -0
- package/build/es/locale/index.js +7 -0
- package/build/es/locale/types.d.ts +9 -0
- package/build/es/locale/types.js +1 -0
- package/build/es/locale/zh-cn.d.ts +25 -0
- package/build/es/locale/zh-cn.js +28 -0
- package/build/lib/components/ConfigProvider/index.js +11 -14
- package/build/lib/components/IntlProvider/FormattedMessage/index.js +11 -0
- package/build/lib/components/IntlProvider/index.js +25 -0
- package/build/lib/components/IntlProvider/types.js +2 -0
- package/build/lib/components/IntlProvider/useIntl/index.js +31 -0
- package/build/lib/components/SearchArea/ToggleButton/index.js +2 -1
- package/build/lib/components/SearchArea/index.js +6 -3
- package/build/lib/components/Table/Footer/index.js +2 -2
- package/build/lib/components/Table/PopoverSetColumns/index.js +2 -2
- package/build/lib/hooks/useTable/index.js +2 -2
- package/build/lib/index.d.ts +3 -0
- package/build/lib/locale/en-us.d.ts +25 -0
- package/build/lib/locale/en-us.js +29 -0
- package/build/lib/locale/index.d.ts +3 -0
- package/build/lib/locale/index.js +13 -0
- package/build/lib/locale/types.d.ts +9 -0
- package/build/lib/locale/types.js +2 -0
- package/build/lib/locale/zh-cn.d.ts +25 -0
- package/build/lib/locale/zh-cn.js +30 -0
- package/build/package.json +1 -1
- package/build/types/components/ConfigProvider/types.d.ts +2 -0
- package/build/types/components/IntlProvider/FormattedMessage/index.d.ts +7 -0
- package/build/types/components/IntlProvider/index.d.ts +12 -0
- package/build/types/components/IntlProvider/types.d.ts +7 -0
- package/build/types/components/IntlProvider/useIntl/index.d.ts +14 -0
- package/build/types/components/Table/Footer/index.d.ts +1 -1
- package/build/types/locale/en-us.d.ts +25 -0
- package/build/types/locale/index.d.ts +3 -0
- package/build/types/locale/types.d.ts +9 -0
- package/build/types/locale/zh-cn.d.ts +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
'operation.add': string;
|
|
3
|
+
'operation.delete': string;
|
|
4
|
+
'operation.batchDelete': string;
|
|
5
|
+
'operation.edit': string;
|
|
6
|
+
'operation.download': string;
|
|
7
|
+
'operation.logout': string;
|
|
8
|
+
'operation.export': string;
|
|
9
|
+
'operation.close': string;
|
|
10
|
+
'operation.details': string;
|
|
11
|
+
'operation.confirm': string;
|
|
12
|
+
'operation.save': string;
|
|
13
|
+
'operation.cancel': string;
|
|
14
|
+
'component.table.selected': string;
|
|
15
|
+
'component.table.total': string;
|
|
16
|
+
'component.table.visibleError': string;
|
|
17
|
+
'component.searcharea.toggle': string;
|
|
18
|
+
'component.searcharea.submit': string;
|
|
19
|
+
'component.searcharea.reset': string;
|
|
20
|
+
'component.searcharea.close': string;
|
|
21
|
+
'message.delete': string;
|
|
22
|
+
'message.success': string;
|
|
23
|
+
'table.pagination.total': string;
|
|
24
|
+
};
|
|
25
|
+
export default messages;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var messages = {
|
|
4
|
+
'operation.add': 'Add',
|
|
5
|
+
'operation.delete': 'Delete',
|
|
6
|
+
'operation.batchDelete': 'Batch Delete',
|
|
7
|
+
'operation.edit': 'Edit',
|
|
8
|
+
'operation.download': 'Download',
|
|
9
|
+
'operation.logout': 'Logout',
|
|
10
|
+
'operation.export': 'Export',
|
|
11
|
+
'operation.close': 'Close',
|
|
12
|
+
'operation.details': 'Details',
|
|
13
|
+
'operation.confirm': 'Confirm',
|
|
14
|
+
'operation.save': 'Save',
|
|
15
|
+
'operation.cancel': 'Cancel',
|
|
16
|
+
// Components
|
|
17
|
+
'component.table.selected': '{length} selected',
|
|
18
|
+
'component.table.total': 'Total {total} items',
|
|
19
|
+
'component.table.visibleError': 'At least one field must be visible',
|
|
20
|
+
'component.searcharea.toggle': 'Advanced Search',
|
|
21
|
+
'component.searcharea.submit': 'Submit',
|
|
22
|
+
'component.searcharea.reset': 'Reset',
|
|
23
|
+
'component.searcharea.close': 'Close',
|
|
24
|
+
// Messages
|
|
25
|
+
'message.delete': 'This action cannot be undone, confirm delete?',
|
|
26
|
+
'message.success': 'Operation successful',
|
|
27
|
+
'table.pagination.total': 'Total {total} items',
|
|
28
|
+
};
|
|
29
|
+
exports.default = messages;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.messages = void 0;
|
|
7
|
+
var zh_cn_1 = __importDefault(require("./zh-cn"));
|
|
8
|
+
var en_us_1 = __importDefault(require("./en-us"));
|
|
9
|
+
var messages = {
|
|
10
|
+
zh: zh_cn_1.default,
|
|
11
|
+
en: en_us_1.default
|
|
12
|
+
};
|
|
13
|
+
exports.messages = messages;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
'operation.add': string;
|
|
3
|
+
'operation.delete': string;
|
|
4
|
+
'operation.batchDelete': string;
|
|
5
|
+
'operation.edit': string;
|
|
6
|
+
'operation.download': string;
|
|
7
|
+
'operation.logout': string;
|
|
8
|
+
'operation.export': string;
|
|
9
|
+
'operation.close': string;
|
|
10
|
+
'operation.details': string;
|
|
11
|
+
'operation.confirm': string;
|
|
12
|
+
'operation.save': string;
|
|
13
|
+
'operation.cancel': string;
|
|
14
|
+
'component.table.selected': string;
|
|
15
|
+
'component.table.total': string;
|
|
16
|
+
'component.table.visibleError': string;
|
|
17
|
+
'component.searcharea.toggle': string;
|
|
18
|
+
'component.searcharea.submit': string;
|
|
19
|
+
'component.searcharea.reset': string;
|
|
20
|
+
'component.searcharea.close': string;
|
|
21
|
+
'message.delete': string;
|
|
22
|
+
'message.success': string;
|
|
23
|
+
'table.pagination.total': string;
|
|
24
|
+
};
|
|
25
|
+
export default messages;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var messages = {
|
|
4
|
+
// 操作类
|
|
5
|
+
'operation.add': '添加',
|
|
6
|
+
'operation.delete': '删除',
|
|
7
|
+
'operation.batchDelete': '批量删除',
|
|
8
|
+
'operation.edit': '编辑',
|
|
9
|
+
'operation.download': '下载',
|
|
10
|
+
'operation.logout': '退出登录',
|
|
11
|
+
'operation.export': '导出',
|
|
12
|
+
'operation.close': '关闭',
|
|
13
|
+
'operation.details': '详情',
|
|
14
|
+
'operation.confirm': '确认',
|
|
15
|
+
'operation.save': '保存',
|
|
16
|
+
'operation.cancel': '取消',
|
|
17
|
+
// 组件
|
|
18
|
+
'component.table.selected': '已选{length}条',
|
|
19
|
+
'component.table.total': '共{total}条',
|
|
20
|
+
'component.table.visibleError': '列表最少保留一个字段',
|
|
21
|
+
'component.searcharea.toggle': '高级搜索',
|
|
22
|
+
'component.searcharea.submit': '筛选',
|
|
23
|
+
'component.searcharea.reset': '重置',
|
|
24
|
+
'component.searcharea.close': '收起',
|
|
25
|
+
// 提示类
|
|
26
|
+
'message.delete': '删除操作无法恢复,确认删除?',
|
|
27
|
+
'message.success': '操作成功',
|
|
28
|
+
'table.pagination.total': '共{total}条',
|
|
29
|
+
};
|
|
30
|
+
exports.default = messages;
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IconButtonProps } from "../IconButton";
|
|
3
3
|
import { IconFontProps } from "../IconFont";
|
|
4
|
+
import { type MessagesKeys } from "../../locale";
|
|
4
5
|
type IconButtonConfig = Pick<IconButtonProps, 'size' | 'className' | 'style'> & {
|
|
5
6
|
render: (props: IconButtonProps & {
|
|
6
7
|
children: React.ReactNode;
|
|
@@ -10,6 +11,7 @@ type IconFontConfig = Pick<IconFontProps, 'className' | 'style'>;
|
|
|
10
11
|
export interface ConfigContextProps {
|
|
11
12
|
iconButton: IconButtonConfig;
|
|
12
13
|
iconFont: IconFontConfig;
|
|
14
|
+
locale: MessagesKeys;
|
|
13
15
|
}
|
|
14
16
|
export type ConfigProviderConfigProps = Partial<ConfigContextProps>;
|
|
15
17
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IntlContextProps, IntlProviderConfigProps } from './types';
|
|
3
|
+
export type { IntlProviderConfigProps, IntlContextProps } from './types';
|
|
4
|
+
import FormattedMessage from './FormattedMessage';
|
|
5
|
+
import useIntl from './useIntl';
|
|
6
|
+
export declare const IntlContext: React.Context<IntlContextProps>;
|
|
7
|
+
interface IntlProviderProps {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
config: IntlProviderConfigProps;
|
|
10
|
+
}
|
|
11
|
+
export default function IntlProvider({ children, config }: IntlProviderProps): React.JSX.Element;
|
|
12
|
+
export { FormattedMessage, useIntl };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface FormattedMessageProps {
|
|
2
|
+
id: string;
|
|
3
|
+
defaultMessage?: string;
|
|
4
|
+
values?: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
export declare const formatMessageFn: ({ messages, locale }: {
|
|
7
|
+
messages: any;
|
|
8
|
+
locale: string;
|
|
9
|
+
}) => ({ id, defaultMessage, values }: FormattedMessageProps) => any;
|
|
10
|
+
export default function useIntl(): {
|
|
11
|
+
$t: ({ id, defaultMessage }: FormattedMessageProps, values?: Record<string, any>) => any;
|
|
12
|
+
formatMessage: ({ id, defaultMessage, values }: FormattedMessageProps) => any;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
'operation.add': string;
|
|
3
|
+
'operation.delete': string;
|
|
4
|
+
'operation.batchDelete': string;
|
|
5
|
+
'operation.edit': string;
|
|
6
|
+
'operation.download': string;
|
|
7
|
+
'operation.logout': string;
|
|
8
|
+
'operation.export': string;
|
|
9
|
+
'operation.close': string;
|
|
10
|
+
'operation.details': string;
|
|
11
|
+
'operation.confirm': string;
|
|
12
|
+
'operation.save': string;
|
|
13
|
+
'operation.cancel': string;
|
|
14
|
+
'component.table.selected': string;
|
|
15
|
+
'component.table.total': string;
|
|
16
|
+
'component.table.visibleError': string;
|
|
17
|
+
'component.searcharea.toggle': string;
|
|
18
|
+
'component.searcharea.submit': string;
|
|
19
|
+
'component.searcharea.reset': string;
|
|
20
|
+
'component.searcharea.close': string;
|
|
21
|
+
'message.delete': string;
|
|
22
|
+
'message.success': string;
|
|
23
|
+
'table.pagination.total': string;
|
|
24
|
+
};
|
|
25
|
+
export default messages;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
'operation.add': string;
|
|
3
|
+
'operation.delete': string;
|
|
4
|
+
'operation.batchDelete': string;
|
|
5
|
+
'operation.edit': string;
|
|
6
|
+
'operation.download': string;
|
|
7
|
+
'operation.logout': string;
|
|
8
|
+
'operation.export': string;
|
|
9
|
+
'operation.close': string;
|
|
10
|
+
'operation.details': string;
|
|
11
|
+
'operation.confirm': string;
|
|
12
|
+
'operation.save': string;
|
|
13
|
+
'operation.cancel': string;
|
|
14
|
+
'component.table.selected': string;
|
|
15
|
+
'component.table.total': string;
|
|
16
|
+
'component.table.visibleError': string;
|
|
17
|
+
'component.searcharea.toggle': string;
|
|
18
|
+
'component.searcharea.submit': string;
|
|
19
|
+
'component.searcharea.reset': string;
|
|
20
|
+
'component.searcharea.close': string;
|
|
21
|
+
'message.delete': string;
|
|
22
|
+
'message.success': string;
|
|
23
|
+
'table.pagination.total': string;
|
|
24
|
+
};
|
|
25
|
+
export default messages;
|