@cloudbase/weda-ui 3.24.1 → 3.25.1
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/configs/components/dataView.js +1 -0
- package/dist/configs/components/listView.js +1 -0
- package/dist/configs/components/wd-form-arr.js +4 -1
- package/dist/configs/components/wd-image.js +1 -1
- package/dist/configs/components/wd-select-multiple.js +1 -0
- package/dist/configs/components/wd-select.js +1 -0
- package/dist/configs/components/wd-table.d.ts +5 -0
- package/dist/configs/components/wd-table.js +12 -0
- package/dist/configs/components/wd-text.js +2 -2
- package/dist/configs/components/wxOpenApi/userInfo.d.ts +2 -2
- package/dist/configs/index.d.ts +12 -2
- package/dist/configs/type-utils/type-form.js +6 -4
- package/dist/configs/utils/field.d.ts +1 -0
- package/dist/configs/utils/field.js +151 -0
- package/dist/style/index.css +7 -2
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +4 -4
- package/dist/web/components/form/uploader/upload/index.js +3 -1
- package/dist/web/components/form/uploader/uploader.pc.js +3 -1
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +25 -17
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +26 -17
- package/dist/web/components/form/userOrgSelect/component/depart-breadcrumb.js +3 -1
- package/dist/web/components/form/userOrgSelect/component/depart-select/depart-select-pc.d.ts +2 -2
- package/dist/web/components/form/userOrgSelect/component/depart-select/depart-select-pc.js +8 -4
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +10 -3
- package/dist/web/components/form/userOrgSelect/component/depart-select/org-modal-pc.js +6 -6
- package/dist/web/components/form/userOrgSelect/component/error-tips.d.ts +1 -1
- package/dist/web/components/form/userOrgSelect/component/error-tips.js +7 -4
- package/dist/web/components/form/userOrgSelect/component/modal-search-h5.js +3 -1
- package/dist/web/components/form/userOrgSelect/component/modal-search.js +4 -1
- package/dist/web/components/form/userOrgSelect/component/modal-select-h5.js +8 -11
- package/dist/web/components/form/userOrgSelect/component/org-tree.js +3 -1
- package/dist/web/components/form/userOrgSelect/component/selected-list-h5.js +8 -8
- package/dist/web/components/form/userOrgSelect/component/selected-list.js +5 -10
- package/dist/web/components/form/userOrgSelect/component/user-org-list.js +12 -21
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/user-list-h5.js +6 -10
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/user-select-h5.d.ts +1 -1
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/user-select-h5.js +5 -1
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/model-user-list.d.ts +1 -1
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/model-user-list.js +4 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +4 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.d.ts +2 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +6 -2
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +2 -2
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +12 -11
- package/dist/web/components/form/userOrgSelect/hooks/use-depart-data.js +9 -9
- package/dist/web/components/form-input-hooks/index.js +12 -4
- package/dist/web/components/form-input-hooks/validator.js +1 -1
- package/dist/web/components/formdetail/index.js +1 -0
- package/dist/web/components/index.d.ts +1 -0
- package/dist/web/components/index.js +1 -0
- package/dist/web/components/richText/const.d.ts +57 -0
- package/dist/web/components/richText/const.js +57 -0
- package/dist/web/components/richText/index.css +3 -1
- package/dist/web/components/richText/index.d.ts +1 -2
- package/dist/web/components/richText/index.js +26 -20
- package/dist/web/components/table/ImportFileModal/index.css +21 -69
- package/dist/web/components/uploaderFileView/index.js +2 -0
- package/dist/web/components/uploaderView/index.js +6 -3
- package/dist/web/components/wd-button/wd-button.js +5 -5
- package/dist/web/components/wd-config-provider/wd-config-context.d.ts +9 -0
- package/dist/web/components/wd-config-provider/wd-config-context.js +2 -0
- package/dist/web/components/wd-config-provider/wd-config-provider.js +8 -9
- package/dist/web/components/wd-form/hoc/form-container-decorator.js +2 -2
- package/dist/web/components/wd-form/hooks/use-remote-value.js +1 -1
- package/dist/web/components/wd-form-item/wd-form-item.js +9 -11
- package/dist/web/components/wd-image/ImagePreview.js +5 -1
- package/dist/web/components/wd-rich-text/wd-rich-text.js +1 -1
- package/dist/web/components/wd-table/table-with-form.js +28 -14
- package/dist/web/components/wd-table/wd-table.js +14 -4
- package/dist/web/components/wd-tree/utils.d.ts +1 -1
- package/dist/web/components/wd-upload-file/wd-upload-file.js +5 -1
- package/dist/web/utils/config-context/use-config.d.ts +1 -0
- package/dist/web/utils/config-context/use-config.js +2 -1
- package/dist/web/utils/hooks/useCanPreview.js +1 -1
- package/dist/web/utils/i18n/index.d.ts +1 -0
- package/dist/web/utils/i18n/index.js +1 -0
- package/dist/web/utils/i18n/locale/en_US.d.ts +119 -0
- package/dist/web/utils/i18n/locale/en_US.js +187 -0
- package/dist/web/utils/i18n/locale/zh_CN.d.ts +120 -0
- package/dist/web/utils/i18n/locale/zh_CN.js +188 -0
- package/dist/web/utils/i18n/translation.d.ts +9 -0
- package/dist/web/utils/i18n/translation.js +28 -0
- package/dist/web/utils/i18n/translationMap.d.ts +15 -0
- package/dist/web/utils/i18n/translationMap.js +10 -0
- package/package.json +4 -3
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
locale: string;
|
|
3
|
+
okText: string;
|
|
4
|
+
cancelText: string;
|
|
5
|
+
loadingText: string;
|
|
6
|
+
loadErrorText: string;
|
|
7
|
+
loadRetryText: string;
|
|
8
|
+
closeText: string;
|
|
9
|
+
searchText: string;
|
|
10
|
+
helpText: string;
|
|
11
|
+
cleanText: string;
|
|
12
|
+
resetText: string;
|
|
13
|
+
emptyText: string;
|
|
14
|
+
selectAllText: string;
|
|
15
|
+
paginationRecordCount: (count: number) => JSX.Element;
|
|
16
|
+
paginationPrevPage: string;
|
|
17
|
+
paginationNextPage: string;
|
|
18
|
+
paginationToFirstPage: string;
|
|
19
|
+
paginationToLastPage: string;
|
|
20
|
+
paginationAtFirst: string;
|
|
21
|
+
paginationAtLast: string;
|
|
22
|
+
paginationRecordPerPage: string;
|
|
23
|
+
paginationPageCount: (count: number) => string;
|
|
24
|
+
pleaseSelect: string;
|
|
25
|
+
foundText: string;
|
|
26
|
+
foundManyText: (count: number) => string;
|
|
27
|
+
foundManyTextWithKeyword: (keyword: string, count: number) => string;
|
|
28
|
+
foundNothingWithKeyword: (keyword: string) => string;
|
|
29
|
+
clearResultText: string;
|
|
30
|
+
tagSearchBoxTips: string;
|
|
31
|
+
tagSearchBoxEditingTips: string;
|
|
32
|
+
tagSearchBoxSelectTitle: string;
|
|
33
|
+
today: string;
|
|
34
|
+
curMonth: string;
|
|
35
|
+
prevMonth: string;
|
|
36
|
+
nextMonth: string;
|
|
37
|
+
curYear: string;
|
|
38
|
+
prevYear: string;
|
|
39
|
+
nextYear: string;
|
|
40
|
+
curTwentyYears: string;
|
|
41
|
+
prevTwentyYears: string;
|
|
42
|
+
nextTwentyYears: string;
|
|
43
|
+
monthBeforeYear: boolean;
|
|
44
|
+
yearFormat: string;
|
|
45
|
+
selectTime: string;
|
|
46
|
+
startTime: string;
|
|
47
|
+
endTime: string;
|
|
48
|
+
selectDate: string;
|
|
49
|
+
guideCancel: string;
|
|
50
|
+
guideBack: string;
|
|
51
|
+
guideNext: string;
|
|
52
|
+
guideFinish: string;
|
|
53
|
+
copy: string;
|
|
54
|
+
copied: string;
|
|
55
|
+
clickToEnlarge: string;
|
|
56
|
+
expand: string;
|
|
57
|
+
collapse: string;
|
|
58
|
+
recentlyVisited: string;
|
|
59
|
+
member: string;
|
|
60
|
+
department: string;
|
|
61
|
+
directMember: string;
|
|
62
|
+
memberPlaceholder: string;
|
|
63
|
+
memberLabel: string;
|
|
64
|
+
memberSelect: string;
|
|
65
|
+
organization: string;
|
|
66
|
+
selected: string;
|
|
67
|
+
multiple: string;
|
|
68
|
+
departmentLabel: string;
|
|
69
|
+
departmentPlaceholder: string;
|
|
70
|
+
selectDepartment: string;
|
|
71
|
+
noDepartmentData: string;
|
|
72
|
+
pleaseSelectDepartment: string;
|
|
73
|
+
loadingFailed: string;
|
|
74
|
+
noImage: string;
|
|
75
|
+
uploadFile: string;
|
|
76
|
+
clickToUpload: string;
|
|
77
|
+
supportBatchUpload: string;
|
|
78
|
+
fileName: string;
|
|
79
|
+
fileSize: string;
|
|
80
|
+
fileStatus: string;
|
|
81
|
+
fileOperation: string;
|
|
82
|
+
pendingUpload: string;
|
|
83
|
+
uploading: string;
|
|
84
|
+
uploadSuccess: string;
|
|
85
|
+
uploadFailed: string;
|
|
86
|
+
delete: string;
|
|
87
|
+
reupload: string;
|
|
88
|
+
download: string;
|
|
89
|
+
waitingUpload: string;
|
|
90
|
+
fileTotalExceed: string;
|
|
91
|
+
fileTypeError: string;
|
|
92
|
+
fileSizeExceed: string;
|
|
93
|
+
clickTopBtn: string;
|
|
94
|
+
richTextTitle: string;
|
|
95
|
+
richTextPlaceholder: string;
|
|
96
|
+
fileSizeExceedsLimit: string;
|
|
97
|
+
uploadImageFailed: string;
|
|
98
|
+
copySuccess: string;
|
|
99
|
+
fileFormatNotSupported: string;
|
|
100
|
+
headingH1: string;
|
|
101
|
+
headingH2: string;
|
|
102
|
+
headingH3: string;
|
|
103
|
+
headingH4: string;
|
|
104
|
+
headingH5: string;
|
|
105
|
+
headingH6: string;
|
|
106
|
+
normal: string;
|
|
107
|
+
sourceHanSans: string;
|
|
108
|
+
richTextErrorMessage: string;
|
|
109
|
+
batchSelect: string;
|
|
110
|
+
unrelatedUser: string;
|
|
111
|
+
unselected: string;
|
|
112
|
+
unselectedMembers: string;
|
|
113
|
+
unselectedDepartments: string;
|
|
114
|
+
noMoreData: string;
|
|
115
|
+
noSelectableMembers: string;
|
|
116
|
+
noRelated: string;
|
|
117
|
+
noSelectable: string;
|
|
118
|
+
uploadImage: string;
|
|
119
|
+
};
|
|
120
|
+
export default _default;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
// prettier-ignore
|
|
4
|
+
// eslint-disable-next-line
|
|
5
|
+
export default {
|
|
6
|
+
locale: 'zh_CN',
|
|
7
|
+
// 操作:确定按钮
|
|
8
|
+
okText: ('确定'),
|
|
9
|
+
// 操作:取消按钮
|
|
10
|
+
cancelText: ('取消'),
|
|
11
|
+
// 文案:数据加载中
|
|
12
|
+
loadingText: ('加载中...'),
|
|
13
|
+
// 文案:数据加载失败
|
|
14
|
+
loadErrorText: ('加载失败'),
|
|
15
|
+
// 操作:重试数据加载
|
|
16
|
+
loadRetryText: ('重试'),
|
|
17
|
+
// 操作:关闭
|
|
18
|
+
closeText: ('关闭'),
|
|
19
|
+
// 操作:搜索
|
|
20
|
+
searchText: ('搜索'),
|
|
21
|
+
// 文案:帮助
|
|
22
|
+
helpText: ('帮助'),
|
|
23
|
+
// 操作:清空
|
|
24
|
+
cleanText: ('清空'),
|
|
25
|
+
// 操作:重置
|
|
26
|
+
resetText: ('重置'),
|
|
27
|
+
// 文案:数据为空
|
|
28
|
+
emptyText: ('暂无数据'),
|
|
29
|
+
// 操作:全选
|
|
30
|
+
selectAllText: ('全选'),
|
|
31
|
+
// 文案:分页组件显示总记录数
|
|
32
|
+
paginationRecordCount: (count) => (_jsxs(Fragment, { children: ["\u5171 ", _jsx("strong", { children: count }), " \u6761"] })),
|
|
33
|
+
// 操作:跳到上一页
|
|
34
|
+
paginationPrevPage: ('上一页'),
|
|
35
|
+
// 操作:跳到下一页
|
|
36
|
+
paginationNextPage: ('下一页'),
|
|
37
|
+
// 操作:跳到第一页
|
|
38
|
+
paginationToFirstPage: ('第一页'),
|
|
39
|
+
// 操作:跳到最后一页
|
|
40
|
+
paginationToLastPage: ('最后一页'),
|
|
41
|
+
// 文案:提醒用户当前已经在第一页,无法再跳到上一页
|
|
42
|
+
paginationAtFirst: ('当前已在第一页'),
|
|
43
|
+
// 文案:提醒用户当前已经在最后一页,无法再跳到上一页
|
|
44
|
+
paginationAtLast: ('当前已在最后一页'),
|
|
45
|
+
// 文案:表示分页组件每页显示多少行记录,后接行数选项
|
|
46
|
+
paginationRecordPerPage: ('条 / 页'),
|
|
47
|
+
// 文案:表示分页组件总共有多少页,前面是当前的页码
|
|
48
|
+
paginationPageCount: (count) => (` / ${count} 页`),
|
|
49
|
+
// 文案:下拉选择组件默认的提示文案
|
|
50
|
+
pleaseSelect: ('请选择'),
|
|
51
|
+
// 文案:查询到结果
|
|
52
|
+
foundText: ("找到下列结果"),
|
|
53
|
+
// 文案:表格中,用于显示找到多少条结果,后面会拼接「返回原列表」
|
|
54
|
+
foundManyText: (count) => (`找到 ${count} 条结果`),
|
|
55
|
+
// 文案:同 resultText,不过是在有关键字的情况下显示
|
|
56
|
+
foundManyTextWithKeyword: (keyword, count) => (`搜索 “${keyword}”,找到 ${count} 条结果`),
|
|
57
|
+
// 文案:搜索某个关键字的情况下,没有找到结果
|
|
58
|
+
foundNothingWithKeyword: (keyword) => (`搜索 “${keyword}” 无结果`),
|
|
59
|
+
// 操作:表格中清空当前筛选结果,返回源列表
|
|
60
|
+
clearResultText: ('返回原列表'),
|
|
61
|
+
// 文案:tagSearchBox 使用提示
|
|
62
|
+
tagSearchBoxTips: ('多个关键字用竖线 “|” 分隔,多个过滤标签用回车键分隔'),
|
|
63
|
+
// 文案:tagSearchBox 使用提示
|
|
64
|
+
tagSearchBoxEditingTips: ('点击进行修改,按回车键完成修改'),
|
|
65
|
+
// 文案:tagSearchBox 选择框标题
|
|
66
|
+
tagSearchBoxSelectTitle: ('选择资源属性进行过滤'),
|
|
67
|
+
// 文案:今天
|
|
68
|
+
today: ('今天'),
|
|
69
|
+
// 文案:本月
|
|
70
|
+
curMonth: ('本月'),
|
|
71
|
+
// 文案:下个月
|
|
72
|
+
prevMonth: ('上个月'),
|
|
73
|
+
// 文案:下个月
|
|
74
|
+
nextMonth: ('下个月'),
|
|
75
|
+
// 文案:今年
|
|
76
|
+
curYear: ('今年'),
|
|
77
|
+
// 文案:下一年
|
|
78
|
+
prevYear: ('上一年'),
|
|
79
|
+
// 文案:下一年
|
|
80
|
+
nextYear: ('下一年'),
|
|
81
|
+
// 文案:当前二十年
|
|
82
|
+
curTwentyYears: ('当前二十年'),
|
|
83
|
+
// 文案:上二十年
|
|
84
|
+
prevTwentyYears: ('上二十年'),
|
|
85
|
+
// 文案:下二十年
|
|
86
|
+
nextTwentyYears: ('下二十年'),
|
|
87
|
+
// 变量:该语言日期表达中 [月] 是否在 [年] 之前,是的话为 - true,否则 - false
|
|
88
|
+
monthBeforeYear: (false),
|
|
89
|
+
// 变量:该语言日期表达中 [年] 的表达方式,其中 YYYY 为年份数字
|
|
90
|
+
yearFormat: ('YYYY年 '),
|
|
91
|
+
// 文案:选择时间
|
|
92
|
+
selectTime: ('选择时间'),
|
|
93
|
+
// 文案:开始时间
|
|
94
|
+
startTime: ('开始时间'),
|
|
95
|
+
// 文案:结束时间
|
|
96
|
+
endTime: ('结束时间'),
|
|
97
|
+
// 文案:选择日期
|
|
98
|
+
selectDate: ('选择日期'),
|
|
99
|
+
// 文案:跳过
|
|
100
|
+
guideCancel: ("跳过"),
|
|
101
|
+
// 文案:上一步
|
|
102
|
+
guideBack: ("上一步"),
|
|
103
|
+
// 文案:下一步
|
|
104
|
+
guideNext: ("下一步"),
|
|
105
|
+
// 文案:完成
|
|
106
|
+
guideFinish: ("完成"),
|
|
107
|
+
// 文案:复制
|
|
108
|
+
copy: ("复制"),
|
|
109
|
+
// 文案:复制成功
|
|
110
|
+
copied: ("复制成功"),
|
|
111
|
+
// 文案:点击查看大图
|
|
112
|
+
clickToEnlarge: ('点击查看大图'),
|
|
113
|
+
// 文案:展开
|
|
114
|
+
expand: ('展开'),
|
|
115
|
+
// 文案:收起
|
|
116
|
+
collapse: ('收起'),
|
|
117
|
+
// 文案:最近访问
|
|
118
|
+
recentlyVisited: ('最近访问'),
|
|
119
|
+
member: ('成员'),
|
|
120
|
+
department: ('部门'),
|
|
121
|
+
directMember: ('直属成员'),
|
|
122
|
+
// 成员选择placeholder
|
|
123
|
+
memberPlaceholder: ('请选择成员'),
|
|
124
|
+
memberLabel: ('成员选择'),
|
|
125
|
+
memberSelect: ('选择成员'),
|
|
126
|
+
// 组织架构
|
|
127
|
+
organization: ('组织架构'),
|
|
128
|
+
selected: ('已选择'),
|
|
129
|
+
// 是否多选
|
|
130
|
+
multiple: ('多选'),
|
|
131
|
+
// 部门选择
|
|
132
|
+
departmentLabel: ('部门选择'),
|
|
133
|
+
departmentPlaceholder: ('请选择部门'),
|
|
134
|
+
selectDepartment: ('选择部门'),
|
|
135
|
+
noDepartmentData: ('暂无部门数据'),
|
|
136
|
+
pleaseSelectDepartment: ('请选择部门'),
|
|
137
|
+
// UploaderView组件
|
|
138
|
+
loadingFailed: ('[加载失败]'),
|
|
139
|
+
noImage: ('暂无图片'),
|
|
140
|
+
// UploaderFileView组件
|
|
141
|
+
uploadFile: ('上传文件'),
|
|
142
|
+
clickToUpload: ('点击上传'),
|
|
143
|
+
supportBatchUpload: ('支持批量上传'),
|
|
144
|
+
fileName: ('文件名'),
|
|
145
|
+
fileSize: ('大小'),
|
|
146
|
+
fileStatus: ('状态'),
|
|
147
|
+
fileOperation: ('操作'),
|
|
148
|
+
pendingUpload: ('待上传'),
|
|
149
|
+
uploading: ('上传中'),
|
|
150
|
+
uploadSuccess: ('上传成功'),
|
|
151
|
+
uploadFailed: ('上传失败'),
|
|
152
|
+
delete: ('删除'),
|
|
153
|
+
reupload: ('重新上传'),
|
|
154
|
+
download: ('下载'),
|
|
155
|
+
waitingUpload: ('等待上传'),
|
|
156
|
+
fileTotalExceed: ('上传文件总数不能超过{count}个'),
|
|
157
|
+
fileTypeError: ('上传文件类型错误'),
|
|
158
|
+
fileSizeExceed: ('上传文件大小不能超过{size}M'),
|
|
159
|
+
// 点击上方
|
|
160
|
+
clickTopBtn: ('点击上方“{btn}”按钮'),
|
|
161
|
+
// RichText组件
|
|
162
|
+
richTextTitle: '标题',
|
|
163
|
+
richTextPlaceholder: '请输入',
|
|
164
|
+
fileSizeExceedsLimit: '文件大小超过上限',
|
|
165
|
+
uploadImageFailed: '上传图片失败',
|
|
166
|
+
copySuccess: '复制成功',
|
|
167
|
+
fileFormatNotSupported: '文件格式不支持',
|
|
168
|
+
headingH1: '标题H1',
|
|
169
|
+
headingH2: '标题H2',
|
|
170
|
+
headingH3: '标题H3',
|
|
171
|
+
headingH4: '标题H4',
|
|
172
|
+
headingH5: '标题H5',
|
|
173
|
+
headingH6: '标题H6',
|
|
174
|
+
normal: '常规',
|
|
175
|
+
sourceHanSans: '思源黑体',
|
|
176
|
+
richTextErrorMessage: ('富文本长度过长,可能导致保存失败,当前长度为'),
|
|
177
|
+
batchSelect: ('批量选择'),
|
|
178
|
+
unrelatedUser: ('未关联部门用户'),
|
|
179
|
+
unselected: ('未选中'),
|
|
180
|
+
unselectedMembers: ('未选中成员'),
|
|
181
|
+
unselectedDepartments: ('未选中部门'),
|
|
182
|
+
noMoreData: ('已经到底了'),
|
|
183
|
+
noSelectableMembers: ('无可选成员'),
|
|
184
|
+
noRelated: ('无相关'),
|
|
185
|
+
noSelectable: ('无可选'),
|
|
186
|
+
// UploaderPC组件
|
|
187
|
+
uploadImage: ('上传图片'),
|
|
188
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import zh_CN from './locale/zh_CN';
|
|
3
|
+
import { useConfig } from '../config-context';
|
|
4
|
+
import { translationMap } from './translationMap';
|
|
5
|
+
// 约定中语言名不规范
|
|
6
|
+
const lngs = {
|
|
7
|
+
zh: 'zh_CN',
|
|
8
|
+
en: 'en_US',
|
|
9
|
+
};
|
|
10
|
+
export function setLocale() {
|
|
11
|
+
console.error('`setLocale()` 方法已废弃');
|
|
12
|
+
}
|
|
13
|
+
export function useTranslation(moment) {
|
|
14
|
+
const { locale: configLocale } = useConfig();
|
|
15
|
+
const t = typeof configLocale === 'string' ? translationMap[configLocale] || zh_CN : zh_CN;
|
|
16
|
+
const locale = lngs[t.locale] || t.locale;
|
|
17
|
+
useState(() => {
|
|
18
|
+
if (moment) {
|
|
19
|
+
moment.locale(locale);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (moment) {
|
|
24
|
+
moment.locale(locale);
|
|
25
|
+
}
|
|
26
|
+
}, [locale]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
27
|
+
return t;
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import zh_CN from './locale/zh_CN';
|
|
2
|
+
type DefaultLocale = Partial<typeof zh_CN>;
|
|
3
|
+
export interface Locale extends DefaultLocale {
|
|
4
|
+
/**
|
|
5
|
+
* 当前语言标识
|
|
6
|
+
*/
|
|
7
|
+
locale: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const translationMap: {
|
|
10
|
+
zh_CN: Locale;
|
|
11
|
+
zh: Locale;
|
|
12
|
+
en_US: Locale;
|
|
13
|
+
en: Locale;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -73,7 +73,8 @@
|
|
|
73
73
|
"test:icon": "node tools/publish-icon/test.mjs",
|
|
74
74
|
"sync-icon": "node tools/publish-icon/sync-icon.mjs",
|
|
75
75
|
"deploy": "node scripts/deploy.mjs && npm run release",
|
|
76
|
-
"release": "node scripts/release.mjs"
|
|
76
|
+
"release": "node scripts/release.mjs",
|
|
77
|
+
"use-node18": "node scripts/use-node18.mjs && hash -r && node -v"
|
|
77
78
|
},
|
|
78
79
|
"keywords": [
|
|
79
80
|
"weda",
|
|
@@ -147,7 +148,7 @@
|
|
|
147
148
|
"@babel/preset-env": "^7.22.15",
|
|
148
149
|
"@babel/preset-react": "^7.22.15",
|
|
149
150
|
"@babel/preset-typescript": "^7.22.15",
|
|
150
|
-
"@cloudbase/cals": "^1.2.
|
|
151
|
+
"@cloudbase/cals": "^1.2.18",
|
|
151
152
|
"@cloudbase/lowcode-cli": "^0.22.4",
|
|
152
153
|
"@cloudbase/weda-cloud-sdk": "^1.0.107",
|
|
153
154
|
"@commitlint/cli": "^16.0.2",
|