@chaoswise/ui 2.3.18 → 2.4.0
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/lib/BasicLayout/index.js +8 -3
- package/lib/BasicLayout/locale/index.js +9 -4
- package/lib/BasicLayout/locale/zh_TW.js +4 -0
- package/lib/CWMessage/MessageContent/TabList/index.js +6 -15
- package/lib/CWMessage/MessageContent/index.js +13 -9
- package/lib/CWMessage/locale/en_US.js +4 -1
- package/lib/CWMessage/locale/index.js +10 -11
- package/lib/CWMessage/locale/zh_CN.js +4 -1
- package/lib/CWMessage/locale/zh_TW.js +6 -0
- package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +7 -8
- package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +6 -15
- package/lib/CWRangePicker/DropdownMenu/index.js +10 -9
- package/lib/CWRangePicker/Refresh/index.js +7 -8
- package/lib/CWRangePicker/TimeSpan/index.js +10 -17
- package/lib/CWRangePicker/index.js +26 -16
- package/lib/CWRangePicker/locale/en_US.js +2 -9
- package/lib/CWRangePicker/locale/index.js +10 -11
- package/lib/CWRangePicker/locale/zh_CN.js +2 -9
- package/lib/CWRangePicker/locale/zh_TW.js +29 -0
- package/lib/CWRangePicker/utils/index.js +7 -4
- package/lib/CWSelect/index.js +7 -9
- package/lib/CWSelect/locale/index.js +10 -11
- package/lib/CWSelect/locale/zh_TW.js +4 -0
- package/lib/CWTable/EditLine.js +8 -9
- package/lib/CWTable/Filter.js +6 -7
- package/lib/CWTable/locale/index.js +10 -11
- package/lib/CWTable/locale/zh_TW.js +6 -0
- package/lib/CWTree/index.js +6 -7
- package/lib/CWTree/locale/index.js +10 -11
- package/lib/CWTree/locale/zh_TW.js +3 -0
- package/lib/CWUpload/locale/en_US.js +0 -8
- package/lib/CWUpload/locale/index.js +10 -11
- package/lib/CWUpload/locale/zh_TW.js +6 -0
- package/lib/CWUpload/upload/Dragger.js +6 -7
- package/lib/CWUpload/upload/UploadList.js +11 -12
- package/lib/ColorPicker/index.js +7 -10
- package/lib/ColorPicker/locale/index.js +10 -11
- package/lib/ColorPicker/locale/zh_TW.js +4 -0
- package/lib/ConfigProvider/ConfigProvider.js +14 -7
- package/lib/ConfigProvider/Switch.js +29 -11
- package/lib/DateRangePicker/components/ExtraQuickFooter.js +24 -20
- package/lib/DateRangePicker/locale/index.js +10 -11
- package/lib/DateRangePicker/locale/zh_TW.js +5 -0
- package/lib/DropdownDatePicker/DropdownMenu/MoreTimeList/index.js +6 -7
- package/lib/DropdownDatePicker/DropdownMenu/index.js +7 -8
- package/lib/DropdownDatePicker/index.js +8 -7
- package/lib/DropdownDatePicker/locale/index.js +10 -11
- package/lib/DropdownDatePicker/locale/zh_TW.js +21 -0
- package/lib/DropdownDatePicker/utils/index.js +4 -2
- package/lib/Empty/index.js +6 -7
- package/lib/Empty/locale/index.js +10 -11
- package/lib/Empty/locale/zh_TW.js +3 -0
- package/lib/Exception/index.js +12 -13
- package/lib/Exception/locale/en_US.js +3 -1
- package/lib/Exception/locale/index.js +10 -11
- package/lib/Exception/locale/zh_CN.js +3 -1
- package/lib/Exception/locale/zh_TW.js +9 -0
- package/lib/FilterDropDown/index.js +6 -7
- package/lib/FilterDropDown/locale/index.js +10 -11
- package/lib/FilterDropDown/locale/zh_TW.js +3 -0
- package/lib/Header/UserSetting/index.js +14 -2
- package/lib/IconSelect/components/CustomImg/index.js +11 -12
- package/lib/IconSelect/components/SearchIcon/index.js +10 -8
- package/lib/IconSelect/index.js +7 -8
- package/lib/IconSelect/locale/index.js +10 -11
- package/lib/IconSelect/locale/zh_TW.js +11 -0
- package/lib/Joyride/List.js +8 -9
- package/lib/Joyride/index.js +21 -22
- package/lib/Joyride/locale/index.js +10 -11
- package/lib/Joyride/locale/zh_TW.js +25 -0
- package/lib/Pagination/index.js +21 -18
- package/lib/Pagination/locale/en_US.js +4 -10
- package/lib/Pagination/locale/index.js +10 -11
- package/lib/Pagination/locale/zh_CN.js +6 -13
- package/lib/Pagination/locale/zh_TW.js +8 -0
- package/lib/Progress/index.js +6 -15
- package/lib/Progress/locale/en_US.js +1 -1
- package/lib/Progress/locale/index.js +10 -11
- package/lib/Progress/locale/zh_CN.js +1 -1
- package/lib/Progress/locale/zh_TW.js +3 -0
- package/lib/QuickTransfer/DragList.js +6 -7
- package/lib/QuickTransfer/index.js +9 -10
- package/lib/QuickTransfer/locale/index.js +10 -11
- package/lib/QuickTransfer/locale/zh_TW.js +8 -0
- package/lib/RangePicker/components/ExtraTimeFooter.js +6 -13
- package/lib/RangePicker/locale/index.js +10 -11
- package/lib/RangePicker/locale/zh_TW.js +5 -0
- package/lib/SearchBar/index.js +9 -10
- package/lib/SearchBar/locale/index.js +10 -11
- package/lib/SearchBar/locale/zh_CN.js +0 -8
- package/lib/SearchBar/locale/zh_TW.js +6 -0
- package/lib/TreeSelect111/index.js +6 -15
- package/lib/TreeSelect111/locale/index.js +10 -11
- package/lib/TreeSelect111/locale/zh_TW.js +3 -0
- package/lib/WangEditor/index.js +13 -7
- package/lib/WangEditor/locale/index.js +60 -29
- package/lib/utils/index.js +11 -0
- package/package.json +2 -2
package/lib/Pagination/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import "@chaoswise/ui/lib/SimplePagination/index.less";
|
|
|
7
7
|
import _SimplePagination from "@chaoswise/ui/lib/SimplePagination";
|
|
8
8
|
import "@chaoswise/ui/lib/Input/index.less";
|
|
9
9
|
import _Input from "@chaoswise/ui/lib/Input";
|
|
10
|
-
import
|
|
10
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
11
11
|
import "@chaoswise/ui/lib/CWSelect/index.less";
|
|
12
12
|
import _CWSelect from "@chaoswise/ui/lib/CWSelect";
|
|
13
13
|
var _excluded = ["form", "total", "simple", "current", "size", "onShowSizeChange", "defaultCurrent", "pageSize", "defaultPageSize", "showTotal", "pageSizeOptions", "showQuickJumper", "showSizeChanger", "onChange", "disabled", "className", "itemRender", "hideOnSinglePage", "newLayout", "getPopupContainer"];
|
|
@@ -28,7 +28,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
28
28
|
import React, { useState, useEffect, useRef, useCallback, Fragment, useMemo } from "react";
|
|
29
29
|
import PropTypes from "prop-types";
|
|
30
30
|
import classnames from "classnames";
|
|
31
|
-
import
|
|
31
|
+
import langConfig from "./locale";
|
|
32
|
+
import { formatMessage } from "../utils";
|
|
32
33
|
import "./index.less";
|
|
33
34
|
var Option = _CWSelect.Option;
|
|
34
35
|
|
|
@@ -69,11 +70,11 @@ function CWPagination(props) {
|
|
|
69
70
|
newLayout = _props$newLayout === void 0 ? false : _props$newLayout,
|
|
70
71
|
getPopupContainer = props.getPopupContainer,
|
|
71
72
|
rest = _objectWithoutProperties(props, _excluded);
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
locale =
|
|
75
|
-
|
|
76
|
-
var _useState = useState(
|
|
73
|
+
var _useLocale = _useLocale2(langConfig),
|
|
74
|
+
localeObj = _useLocale.langObj,
|
|
75
|
+
_useLocale$locale = _useLocale.locale,
|
|
76
|
+
locale = _useLocale$locale === void 0 ? "zh_CN" : _useLocale$locale;
|
|
77
|
+
var _useState = useState(""),
|
|
77
78
|
_useState2 = _slicedToArray(_useState, 2),
|
|
78
79
|
value = _useState2[0],
|
|
79
80
|
setValue = _useState2[1];
|
|
@@ -120,7 +121,7 @@ function CWPagination(props) {
|
|
|
120
121
|
//改变页码
|
|
121
122
|
var onChange = function onChange(page, pageSize) {
|
|
122
123
|
checkJumperValue(page);
|
|
123
|
-
setValue(
|
|
124
|
+
setValue("");
|
|
124
125
|
//受控
|
|
125
126
|
// _onChange(page, pageSize)
|
|
126
127
|
};
|
|
@@ -136,7 +137,7 @@ function CWPagination(props) {
|
|
|
136
137
|
setPageInfo(_objectSpread(_objectSpread({}, pageInfo), {}, {
|
|
137
138
|
current: currents
|
|
138
139
|
}));
|
|
139
|
-
setValue(
|
|
140
|
+
setValue("");
|
|
140
141
|
_onChange(currents, _pageSize);
|
|
141
142
|
};
|
|
142
143
|
var inputChange = function inputChange(e) {
|
|
@@ -159,14 +160,14 @@ function CWPagination(props) {
|
|
|
159
160
|
}
|
|
160
161
|
handleChangePage(current);
|
|
161
162
|
} else {
|
|
162
|
-
setValue(
|
|
163
|
+
setValue("");
|
|
163
164
|
}
|
|
164
165
|
};
|
|
165
166
|
var itemRender_ = function itemRender_(page, type, originalElement) {
|
|
166
167
|
if (type == "jump-prev" || type == "jump-next") {
|
|
167
168
|
return /*#__PURE__*/React.createElement("span", {
|
|
168
169
|
className: classnames({
|
|
169
|
-
"cw-jump-wrapper": size !==
|
|
170
|
+
"cw-jump-wrapper": size !== "small"
|
|
170
171
|
})
|
|
171
172
|
}, originalElement);
|
|
172
173
|
}
|
|
@@ -236,19 +237,21 @@ function CWPagination(props) {
|
|
|
236
237
|
return /*#__PURE__*/React.createElement(Option, {
|
|
237
238
|
value: value,
|
|
238
239
|
key: value
|
|
239
|
-
}, /*#__PURE__*/React.createElement(Fragment, null,
|
|
240
|
+
}, /*#__PURE__*/React.createElement(Fragment, null, formatMessage(localeObj["perPageItems"], {
|
|
241
|
+
item: value
|
|
242
|
+
})));
|
|
240
243
|
})) : null;
|
|
241
244
|
var isShowTotal = !simple && showTotal && !disabled ? /*#__PURE__*/React.createElement("span", {
|
|
242
245
|
className: "cw-pagination-count"
|
|
243
|
-
}, typeof showTotal === "boolean" ? /*#__PURE__*/React.createElement(Fragment, null, locale === "zh" ? /*#__PURE__*/React.createElement(Fragment, null, localeObj
|
|
246
|
+
}, typeof showTotal === "boolean" ? /*#__PURE__*/React.createElement(Fragment, null, locale === "zh" || locale === "zh_CN" || locale === "zh_TW" ? /*#__PURE__*/React.createElement(Fragment, null, formatMessage(localeObj["total"]), /*#__PURE__*/React.createElement("span", {
|
|
244
247
|
style: {
|
|
245
|
-
padding:
|
|
248
|
+
padding: "0 4px"
|
|
246
249
|
}
|
|
247
|
-
}, total), localeObj
|
|
250
|
+
}, total), formatMessage(localeObj["item"])) : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
248
251
|
style: {
|
|
249
252
|
padding: "0 4px"
|
|
250
253
|
}
|
|
251
|
-
}, total), localeObj
|
|
254
|
+
}, total), formatMessage(localeObj["total"]))) : /*#__PURE__*/React.createElement(Fragment, null, showTotal(total, [total === 0 ? 0 : (_current - 1) * _pageSize + 1, _current * _pageSize > total ? total : _current * _pageSize], pageCount))) : null;
|
|
252
255
|
var quickjumper = !simple && showQuickJumper && !disabled ? /*#__PURE__*/React.createElement("div", {
|
|
253
256
|
className: "cw-pagination-input-main",
|
|
254
257
|
style: {
|
|
@@ -256,7 +259,7 @@ function CWPagination(props) {
|
|
|
256
259
|
marginLeft: 16
|
|
257
260
|
},
|
|
258
261
|
ref: inputRef
|
|
259
|
-
}, /*#__PURE__*/React.createElement("span", null, localeObj["goto"]), /*#__PURE__*/React.createElement(_Input, {
|
|
262
|
+
}, /*#__PURE__*/React.createElement("span", null, formatMessage(localeObj["goto"])), /*#__PURE__*/React.createElement(_Input, {
|
|
260
263
|
value: value,
|
|
261
264
|
size: size === "small" ? "small" : "default",
|
|
262
265
|
onPressEnter: inputEnterHandle,
|
|
@@ -264,7 +267,7 @@ function CWPagination(props) {
|
|
|
264
267
|
className: "cw-pagination-jump-input",
|
|
265
268
|
onChange: inputChange,
|
|
266
269
|
type: "text"
|
|
267
|
-
}), /*#__PURE__*/React.createElement("span", null, localeObj
|
|
270
|
+
}), /*#__PURE__*/React.createElement("span", null, formatMessage(localeObj["page"]))) : null;
|
|
268
271
|
var finalRenderPagination = /*#__PURE__*/React.createElement("div", {
|
|
269
272
|
className: "cw-pagination-wrapper",
|
|
270
273
|
style: {
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: your name
|
|
3
|
-
* @Date: 2022-01-25 10:45:57
|
|
4
|
-
* @LastEditTime: 2022-01-26 17:19:06
|
|
5
|
-
* @LastEditors: your name
|
|
6
|
-
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
7
|
-
* @FilePath: /change/aops_web_commons/packages/ui/components/Pagination/locale/en_US.js
|
|
8
|
-
*/
|
|
9
1
|
export default {
|
|
10
2
|
"goto": 'Go to',
|
|
11
3
|
page: 'Page',
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
total: "total",
|
|
5
|
+
perPage: "perPage",
|
|
6
|
+
item: "item",
|
|
7
|
+
perPageItems: "{item}/page"
|
|
14
8
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import zh_CN from './zh_CN.js';
|
|
2
|
+
import en_US from './en_US.js';
|
|
3
|
+
import zh_TW from './zh_TW.js';
|
|
4
|
+
export default {
|
|
5
|
+
zh_CN: zh_CN,
|
|
6
|
+
en_US: en_US,
|
|
7
|
+
zh_TW: zh_TW,
|
|
8
|
+
// 兼容
|
|
9
|
+
zh: zh_CN,
|
|
10
|
+
en: en_US
|
|
12
11
|
};
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: your name
|
|
3
|
-
* @Date: 2022-01-25 10:45:57
|
|
4
|
-
* @LastEditTime: 2022-01-26 17:22:22
|
|
5
|
-
* @LastEditors: your name
|
|
6
|
-
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
7
|
-
* @FilePath: /change/aops_web_commons/packages/ui/components/Pagination/locale/zh_CN.js
|
|
8
|
-
*/
|
|
9
1
|
export default {
|
|
10
|
-
"goto":
|
|
11
|
-
page:
|
|
12
|
-
total:
|
|
13
|
-
perPage:
|
|
14
|
-
item:
|
|
2
|
+
"goto": "跳到",
|
|
3
|
+
page: "页",
|
|
4
|
+
total: "共",
|
|
5
|
+
perPage: "每页",
|
|
6
|
+
item: "条",
|
|
7
|
+
perPageItems: "每页{item}条"
|
|
15
8
|
};
|
package/lib/Progress/index.js
CHANGED
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
2
2
|
import "antd/es/progress/style";
|
|
3
3
|
import _Progress from "antd/es/progress";
|
|
4
|
-
import
|
|
4
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
5
5
|
import _ThemeProvider from "@chaoswise/ui/lib/ThemeProvider";
|
|
6
6
|
var _excluded = ["size", "type", "strokeWidth", "width", "onClickReload"];
|
|
7
7
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
-
/*
|
|
11
|
-
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
12
|
-
* @Date: 2022-06-01 12:03:14
|
|
13
|
-
* @LastEditors: eleven.chen eleven.chen@cloudwise.com
|
|
14
|
-
* @LastEditTime: 2023-01-03 16:37:05
|
|
15
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/Progress/index.js
|
|
16
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
17
|
-
*/
|
|
18
10
|
import React, { forwardRef, useMemo, useEffect } from "react";
|
|
19
11
|
import PropTypes from "prop-types";
|
|
20
12
|
import classnames from "classnames";
|
|
21
|
-
import
|
|
13
|
+
import langConfig from './locale';
|
|
14
|
+
import { formatMessage } from "../utils";
|
|
22
15
|
import "./index.less";
|
|
23
16
|
var CWProgress = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
24
17
|
var _props$size = props.size,
|
|
@@ -33,10 +26,8 @@ var CWProgress = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
33
26
|
// 获取modifyVars注入的主题变量
|
|
34
27
|
var _ThemeProvider$useThe = _ThemeProvider.useThemeSwitcher(),
|
|
35
28
|
themeVars = _ThemeProvider$useThe.themeVars;
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
39
|
-
var localeObj = getLocale(locale);
|
|
29
|
+
var _useLocale = _useLocale2(langConfig),
|
|
30
|
+
localeObj = _useLocale.langObj;
|
|
40
31
|
var strokeWidth_ = useMemo(function () {
|
|
41
32
|
if (strokeWidth) return strokeWidth;
|
|
42
33
|
if (size == "large") {
|
|
@@ -56,7 +47,7 @@ var CWProgress = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
56
47
|
strokeWidth: strokeWidth_,
|
|
57
48
|
strokeColor: (_rest$strokeColor = rest.strokeColor) !== null && _rest$strokeColor !== void 0 ? _rest$strokeColor : "".concat(themeVars["primary-color"]),
|
|
58
49
|
format: rest.format ? rest.format : function () {
|
|
59
|
-
return
|
|
50
|
+
return formatMessage(localeObj["inProgress"]);
|
|
60
51
|
},
|
|
61
52
|
percent: 40,
|
|
62
53
|
showInfo: (_rest$showInfo = rest.showInfo) !== null && _rest$showInfo !== void 0 ? _rest$showInfo : true,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import zh_CN from './zh_CN.js';
|
|
2
|
+
import en_US from './en_US.js';
|
|
3
|
+
import zh_TW from './zh_TW.js';
|
|
4
|
+
export default {
|
|
5
|
+
zh_CN: zh_CN,
|
|
6
|
+
en_US: en_US,
|
|
7
|
+
zh_TW: zh_TW,
|
|
8
|
+
// 兼容
|
|
9
|
+
zh: zh_CN,
|
|
10
|
+
en: en_US
|
|
12
11
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
2
2
|
import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
3
3
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
4
|
-
import
|
|
4
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
5
5
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
7
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -12,9 +12,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
12
12
|
import React, { Fragment, useRef } from "react";
|
|
13
13
|
import { useDrag, useDrop } from "react-dnd";
|
|
14
14
|
import classnames from "classnames";
|
|
15
|
-
import { getLocale } from "./locale";
|
|
16
15
|
import LockSvg from "./assets/LockSvg";
|
|
17
16
|
import DragSvg from "./assets/DragSvg";
|
|
17
|
+
import langConfig from './locale';
|
|
18
|
+
import { formatMessage } from "../utils";
|
|
18
19
|
var DragList = function DragList(_ref) {
|
|
19
20
|
var index = _ref.index,
|
|
20
21
|
listItem = _ref.listItem,
|
|
@@ -28,10 +29,8 @@ var DragList = function DragList(_ref) {
|
|
|
28
29
|
var title = listItem.title,
|
|
29
30
|
disabled = listItem.disabled;
|
|
30
31
|
// 获取当前语言
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
34
|
-
var localeObj = getLocale(locale);
|
|
32
|
+
var _useLocale = _useLocale2(langConfig),
|
|
33
|
+
localeObj = _useLocale.langObj;
|
|
35
34
|
var dragRef = useRef(null);
|
|
36
35
|
var _useDrag = useDrag({
|
|
37
36
|
item: {
|
|
@@ -72,7 +71,7 @@ var DragList = function DragList(_ref) {
|
|
|
72
71
|
var renderPrefixIcon = /*#__PURE__*/React.createElement("div", {
|
|
73
72
|
className: "cw-transfer-right-content-item-prefix-icon-wrapper"
|
|
74
73
|
}, disabled ? /*#__PURE__*/React.createElement(LockSvg, null) : /*#__PURE__*/React.createElement(_Tooltip, {
|
|
75
|
-
title: localeObj["dragAndDrop"]
|
|
74
|
+
title: formatMessage(localeObj["dragAndDrop"])
|
|
76
75
|
}, /*#__PURE__*/React.createElement(DragSvg, null)));
|
|
77
76
|
var renderItemContent = /*#__PURE__*/React.createElement("div", {
|
|
78
77
|
className: "cw-transfer-right-content-item"
|
|
@@ -7,7 +7,7 @@ import "@chaoswise/ui/lib/CWTable/index.less";
|
|
|
7
7
|
import _CWTable from "@chaoswise/ui/lib/CWTable";
|
|
8
8
|
import "@chaoswise/ui/lib/Checkbox/index.less";
|
|
9
9
|
import _Checkbox from "@chaoswise/ui/lib/Checkbox";
|
|
10
|
-
import
|
|
10
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
11
11
|
import "@chaoswise/ui/lib/TooltipText/index.less";
|
|
12
12
|
import _TooltipText from "@chaoswise/ui/lib/TooltipText";
|
|
13
13
|
import "@chaoswise/ui/lib/Input/index.less";
|
|
@@ -41,11 +41,12 @@ import { filterTreeByName, filterTree, filterTreeByNameTable, filterObj, getNotS
|
|
|
41
41
|
import classnames from "classnames";
|
|
42
42
|
import Drag from "./Drag";
|
|
43
43
|
import PropTypes from "prop-types";
|
|
44
|
-
import { getLocale } from "./locale";
|
|
45
44
|
import "./index.less";
|
|
46
45
|
import { isEqual } from "@chaoswise/utils";
|
|
47
46
|
import NoDrag from "./NoDrag";
|
|
48
47
|
import { createTree } from "../CWTree/utils";
|
|
48
|
+
import langConfig from './locale';
|
|
49
|
+
import { formatMessage } from "../utils";
|
|
49
50
|
var Search = _Input.Search;
|
|
50
51
|
|
|
51
52
|
/**
|
|
@@ -191,10 +192,8 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
191
192
|
saveSearchValueRight = _useState16[0],
|
|
192
193
|
setSaveSearchValueRight = _useState16[1];
|
|
193
194
|
// 获取当前语言
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
197
|
-
var localeObj = getLocale(locale);
|
|
195
|
+
var _useLocale = _useLocale2(langConfig),
|
|
196
|
+
localeObj = _useLocale.langObj;
|
|
198
197
|
//表格情况下右侧列表渲染的列
|
|
199
198
|
var newRenderColumns = [];
|
|
200
199
|
var newSearchColumns = [];
|
|
@@ -643,7 +642,7 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
643
642
|
setCheckedKeys(newCheckedKeys);
|
|
644
643
|
setListCheckedStyle(listCheckedKeys_, data);
|
|
645
644
|
};
|
|
646
|
-
var allSelectedText = "".concat(localeObj
|
|
645
|
+
var allSelectedText = "".concat(formatMessage(localeObj["checkAll"]), "\uFF08").concat(listCheckedKeys.length, "\uFF09");
|
|
647
646
|
// 根据不同的type渲染不同的列表类型,目前支持list tree table
|
|
648
647
|
|
|
649
648
|
var getFinalTitle = function getFinalTitle(title) {
|
|
@@ -711,7 +710,7 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
711
710
|
};
|
|
712
711
|
// todo - react-dnd:DndProvider的问题拖拽和非拖拽需要分开写
|
|
713
712
|
var renderRightList = searchCheckedValue.length === 0 ? /*#__PURE__*/React.createElement(_Empty, {
|
|
714
|
-
description: localeObj["pleaseSelectFromLeft"]
|
|
713
|
+
description: formatMessage(localeObj["pleaseSelectFromLeft"])
|
|
715
714
|
}) : dragList ? /*#__PURE__*/React.createElement(Drag, {
|
|
716
715
|
checkValue: searchCheckedValue,
|
|
717
716
|
handleDelete: handleDelete,
|
|
@@ -773,14 +772,14 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
773
772
|
})
|
|
774
773
|
}, typeof rightHeader === "boolean" ? /*#__PURE__*/React.createElement("div", {
|
|
775
774
|
className: "cw-transfer-right-header-top"
|
|
776
|
-
}, /*#__PURE__*/React.createElement("span", null, localeObj
|
|
775
|
+
}, /*#__PURE__*/React.createElement("span", null, formatMessage(localeObj["addedList"]), /*#__PURE__*/React.createElement("span", {
|
|
777
776
|
style: {
|
|
778
777
|
marginLeft: "8px"
|
|
779
778
|
}
|
|
780
779
|
}, "(", searchCheckedValue.length, ")")), Boolean(searchCheckedValue.length) && /*#__PURE__*/React.createElement("span", {
|
|
781
780
|
onClick: clearAll,
|
|
782
781
|
className: "cw-transfer-right-header-clear"
|
|
783
|
-
}, localeObj
|
|
782
|
+
}, formatMessage(localeObj["clear"]))) : /*#__PURE__*/React.createElement(Fragment, null, rightHeader)), /*#__PURE__*/React.createElement("div", {
|
|
784
783
|
className: "cw-transfer-right-main-wrapper"
|
|
785
784
|
}, renderRightList)), rightFooter && /*#__PURE__*/React.createElement("div", {
|
|
786
785
|
className: "cw-transfer-footer"
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import zh_CN from './zh_CN.js';
|
|
2
|
+
import en_US from './en_US.js';
|
|
3
|
+
import zh_TW from './zh_TW.js';
|
|
4
|
+
export default {
|
|
5
|
+
zh_CN: zh_CN,
|
|
6
|
+
en_US: en_US,
|
|
7
|
+
zh_TW: zh_TW,
|
|
8
|
+
// 兼容
|
|
9
|
+
zh: zh_CN,
|
|
10
|
+
en: en_US
|
|
12
11
|
};
|
|
@@ -4,24 +4,17 @@ import _Button from "@chaoswise/ui/lib/Button";
|
|
|
4
4
|
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
5
5
|
import "antd/es/time-picker/style";
|
|
6
6
|
import _TimePicker from "antd/es/time-picker";
|
|
7
|
-
import
|
|
7
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
8
8
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
9
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
12
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
13
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
-
/*
|
|
15
|
-
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
16
|
-
* @Date: 2022-09-27 16:59:29
|
|
17
|
-
* @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
|
|
18
|
-
* @LastEditTime: 2022-09-28 10:45:09
|
|
19
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/RangePicker/components/ExtraTimeFooter.js
|
|
20
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
21
|
-
*/
|
|
22
14
|
import React from "react";
|
|
23
15
|
import classnames from "classnames";
|
|
24
|
-
import
|
|
16
|
+
import langConfig from "../locale";
|
|
17
|
+
import { formatMessage } from "../../utils";
|
|
25
18
|
export default function ExtraTimeFooter(_ref) {
|
|
26
19
|
var startTimeValue = _ref.startTimeValue,
|
|
27
20
|
endTimeValue = _ref.endTimeValue,
|
|
@@ -33,8 +26,8 @@ export default function ExtraTimeFooter(_ref) {
|
|
|
33
26
|
onOk = _ref.onOk,
|
|
34
27
|
getPopupContainer = _ref.getPopupContainer,
|
|
35
28
|
disabledConfirm = _ref.disabledConfirm;
|
|
36
|
-
var
|
|
37
|
-
|
|
29
|
+
var _useLocale = _useLocale2(langConfig),
|
|
30
|
+
localeObj = _useLocale.langObj;
|
|
38
31
|
var res = typeof showTime == "boolean" ? {} : _objectSpread({}, showTime);
|
|
39
32
|
return /*#__PURE__*/React.createElement("div", {
|
|
40
33
|
className: classnames("cw-rangePicker-time-wrapper", {
|
|
@@ -71,5 +64,5 @@ export default function ExtraTimeFooter(_ref) {
|
|
|
71
64
|
type: "primary",
|
|
72
65
|
disabled: disabledConfirm,
|
|
73
66
|
onClick: onOk
|
|
74
|
-
},
|
|
67
|
+
}, formatMessage(localeObj["confirm"])));
|
|
75
68
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import zh_CN from './zh_CN.js';
|
|
2
|
+
import en_US from './en_US.js';
|
|
3
|
+
import zh_TW from './zh_TW.js';
|
|
4
|
+
export default {
|
|
5
|
+
zh_CN: zh_CN,
|
|
6
|
+
en_US: en_US,
|
|
7
|
+
zh_TW: zh_TW,
|
|
8
|
+
// 兼容
|
|
9
|
+
zh: zh_CN,
|
|
10
|
+
en: en_US
|
|
12
11
|
};
|
package/lib/SearchBar/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
|
12
12
|
import "@chaoswise/ui/lib/Button/index.less";
|
|
13
13
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
14
14
|
import _Menu from "@chaoswise/ui/lib/Menu";
|
|
15
|
-
import
|
|
15
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
16
16
|
var _excluded = ["showTooltipIcon"];
|
|
17
17
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
18
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -36,8 +36,9 @@ import React, { useState, useEffect, Fragment, useMemo, useRef } from "react";
|
|
|
36
36
|
import classnames from "classnames";
|
|
37
37
|
import PropTypes from "prop-types";
|
|
38
38
|
import OutSearch from "./OutSearch";
|
|
39
|
+
import langConfig from './locale';
|
|
40
|
+
import { formatMessage } from "../utils";
|
|
39
41
|
import _ from "lodash-es";
|
|
40
|
-
import { getLocale } from "./locale";
|
|
41
42
|
import "./index.less";
|
|
42
43
|
|
|
43
44
|
/**
|
|
@@ -153,11 +154,9 @@ var SearchBar = function SearchBar(props) {
|
|
|
153
154
|
var getFieldDecorator = form.getFieldDecorator,
|
|
154
155
|
resetFields = form.resetFields,
|
|
155
156
|
getFieldsValue = form.getFieldsValue;
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
157
|
+
var _useLocale = _useLocale2(langConfig),
|
|
158
|
+
localeObj = _useLocale.langObj;
|
|
159
159
|
var domRef = useRef(null);
|
|
160
|
-
var localeObj = getLocale(locale);
|
|
161
160
|
|
|
162
161
|
//传入的搜索框
|
|
163
162
|
var _useState3 = useState([]),
|
|
@@ -354,11 +353,11 @@ var SearchBar = function SearchBar(props) {
|
|
|
354
353
|
type: "primary",
|
|
355
354
|
onClick: handleSearch,
|
|
356
355
|
className: "cw-search-expand-search-search"
|
|
357
|
-
}, searchButtonProps), searchTitle ? searchTitle : localeObj
|
|
356
|
+
}, searchButtonProps), searchTitle ? searchTitle : formatMessage(localeObj["search"])), /*#__PURE__*/React.createElement(_Button, _extends({
|
|
358
357
|
type: "default",
|
|
359
358
|
onClick: handleReset,
|
|
360
359
|
className: "cw-search-expand-search-reset"
|
|
361
|
-
}, resetButtonProps), resetTitle ? resetTitle : localeObj
|
|
360
|
+
}, resetButtonProps), resetTitle ? resetTitle : formatMessage(localeObj["reset"])), /*#__PURE__*/React.createElement("div", {
|
|
362
361
|
className: "cw-search-expand-icon-wrapper",
|
|
363
362
|
onClick: handleExpandSearch
|
|
364
363
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
@@ -420,7 +419,7 @@ var SearchBar = function SearchBar(props) {
|
|
|
420
419
|
}), showAdvancedSearch ? /*#__PURE__*/React.createElement("div", {
|
|
421
420
|
className: "cw-search-advanced",
|
|
422
421
|
onClick: handleExpandSearch
|
|
423
|
-
}, /*#__PURE__*/React.createElement("span", null, advancedSearchTitle ? advancedSearchTitle : localeObj
|
|
422
|
+
}, /*#__PURE__*/React.createElement("span", null, advancedSearchTitle ? advancedSearchTitle : formatMessage(localeObj["advancedFilter"])), /*#__PURE__*/React.createElement(_Icon, {
|
|
424
423
|
className: "cw-search-advanced-icon",
|
|
425
424
|
type: expandSearch ? "up" : "down"
|
|
426
425
|
})) : null), /*#__PURE__*/React.createElement(_Row, {
|
|
@@ -540,7 +539,7 @@ var SearchBar = function SearchBar(props) {
|
|
|
540
539
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
541
540
|
icon: "plus",
|
|
542
541
|
type: "link"
|
|
543
|
-
}, localeObj
|
|
542
|
+
}, formatMessage(localeObj["addCondition"])), /*#__PURE__*/React.createElement(_Tooltip, tipTooltipOptionRest, showTooltipIcon && /*#__PURE__*/React.createElement("div", {
|
|
544
543
|
className: "cw-search-bar-filter-title-icon-wrapper"
|
|
545
544
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
546
545
|
type: "question-circle",
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import zh_CN from './zh_CN.js';
|
|
2
|
+
import en_US from './en_US.js';
|
|
3
|
+
import zh_TW from './zh_TW.js';
|
|
4
|
+
export default {
|
|
5
|
+
zh_CN: zh_CN,
|
|
6
|
+
en_US: en_US,
|
|
7
|
+
zh_TW: zh_TW,
|
|
8
|
+
// 兼容
|
|
9
|
+
zh: zh_CN,
|
|
10
|
+
en: en_US
|
|
12
11
|
};
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
3
|
-
* @Date: 2022-05-19 18:52:13
|
|
4
|
-
* @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
|
|
5
|
-
* @LastEditTime: 2022-06-22 15:41:00
|
|
6
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/SearchBar/locale/zh_CN.js
|
|
7
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
-
*/
|
|
9
1
|
export default {
|
|
10
2
|
addCondition: '添加筛选条件',
|
|
11
3
|
advancedFilter: '高级筛选',
|