@chaoswise/ui 2.3.17 → 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/CWCascader/Cascader/index.js +1 -2
- package/lib/CWCascader/rc-cascader/OptionList/Checkbox.js +1 -2
- package/lib/CWCascader/rc-cascader/OptionList/Column.js +1 -2
- package/lib/CWCascader/rc-cascader/OptionList/index.js +3 -3
- package/lib/CWCascader/rc-cascader/hooks/useSearchOptions.js +1 -2
- 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/antd-select.js +1 -2
- 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/index.less +5 -0
- 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/Upload.js +4 -6
- package/lib/CWUpload/upload/UploadList.js +15 -18
- package/lib/Checkbox/Checkbox.js +1 -2
- 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/DragList.js +33 -37
- package/lib/FilterDropDown/assets/DragSvg.js +33 -0
- package/lib/FilterDropDown/index.js +21 -15
- package/lib/FilterDropDown/index.less +8 -0
- 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/Input/InputComponent.js +1 -2
- 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/Radio/Group.js +1 -2
- package/lib/Radio/Radio.js +1 -2
- 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/SingleSpa/singleSpa/single-spa.dev.js +1 -2
- package/lib/TreeList/index.js +1 -2
- 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/Watermark/index.js +0 -2
- package/lib/message/index.js +2 -3
- package/lib/utils/index.js +11 -0
- package/package.json +2 -2
- package/lib/FilterDropDown/drag.svg +0 -17
- package/lib/QuickTransfer/CheckList.js +0 -54
- package/lib/QuickTransfer/TopicList.js +0 -153
|
@@ -9,7 +9,7 @@ import _message from "@chaoswise/ui/lib/message";
|
|
|
9
9
|
import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
10
10
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
11
11
|
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
12
|
-
import
|
|
12
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
13
13
|
var _excluded = ["showTipIcon"],
|
|
14
14
|
_excluded2 = ["timeDomain", "number", "unit", "isRecently", "value"],
|
|
15
15
|
_excluded3 = ["value", "timeDomain", "number", "unit", "isRecently"];
|
|
@@ -34,7 +34,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
34
34
|
import React, { forwardRef, useState, useEffect, useMemo, useRef, useImperativeHandle } from "react";
|
|
35
35
|
import PropTypes from "prop-types";
|
|
36
36
|
import classnames from "classnames";
|
|
37
|
-
import { getLocale } from "./locale";
|
|
38
37
|
import DropDownMenu from "./DropdownMenu";
|
|
39
38
|
import TimeSpan from "./TimeSpan";
|
|
40
39
|
import Refresh from "./Refresh";
|
|
@@ -44,6 +43,8 @@ import RecoverSvg from "./assets/Recover";
|
|
|
44
43
|
import { regroupDataSourceFn, echoInputValue, getUnit, judgeType, getChangeUnitDate, isInvalidDate, range, funcValueChangeArrayValue, getCorrectValue, getHistoryInfo, getFinalDateOption, getTruthDateCount, isAfterDate, isSameDate, isExceedMaxTimeSpan, getYears, computedRecentlyValue } from "./utils";
|
|
45
44
|
import _ from "lodash";
|
|
46
45
|
import moment from "moment";
|
|
46
|
+
import langConfig from "./locale";
|
|
47
|
+
import { formatMessage } from '../utils';
|
|
47
48
|
import "./index.less";
|
|
48
49
|
var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
49
50
|
var defaultValue = props.defaultValue,
|
|
@@ -72,10 +73,10 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
72
73
|
open = props.open,
|
|
73
74
|
_props$rangePickerFor = props.rangePickerFormat,
|
|
74
75
|
rangePickerFormat = _props$rangePickerFor === void 0 ? "YYYY/MM/DD" : _props$rangePickerFor;
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
locale =
|
|
78
|
-
|
|
76
|
+
var _useLocale = _useLocale2(langConfig),
|
|
77
|
+
localeObj = _useLocale.langObj,
|
|
78
|
+
_useLocale$locale = _useLocale.locale,
|
|
79
|
+
locale = _useLocale$locale === void 0 ? "zh_CN" : _useLocale$locale;
|
|
79
80
|
var _refreshOption$onAuto = refreshOption.onAutoRefresh,
|
|
80
81
|
onAutoRefresh = _refreshOption$onAuto === void 0 ? function () {} : _refreshOption$onAuto,
|
|
81
82
|
_refreshOption$onAuto2 = refreshOption.onAutoRefreshChange,
|
|
@@ -395,7 +396,7 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
395
396
|
type: "question-circle",
|
|
396
397
|
className: classnames("cw-range-picker-suffix-tips")
|
|
397
398
|
})) : !isFocus && !_.isEqual(dateValueRest, rest) ? /*#__PURE__*/React.createElement(_Tooltip, {
|
|
398
|
-
title: localeObj
|
|
399
|
+
title: formatMessage(localeObj["recover"])
|
|
399
400
|
}, /*#__PURE__*/React.createElement(RecoverSvg, {
|
|
400
401
|
onClick: onRecover,
|
|
401
402
|
className: classnames("cw-range-picker-suffix-recover")
|
|
@@ -440,12 +441,15 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
440
441
|
// message.success(localeObj["fit-the-input-format"]);
|
|
441
442
|
var passValue = returnValue.value;
|
|
442
443
|
if (isExceedMaxTimeSpan(passValue, timeSpanBoundary)) {
|
|
443
|
-
_message.error(localeObj["the-maximum-time-span-is-exceeded"]);
|
|
444
|
+
_message.error(formatMessage(localeObj["the-maximum-time-span-is-exceeded"]));
|
|
444
445
|
return;
|
|
445
446
|
}
|
|
446
447
|
_onChange(returnValue);
|
|
447
448
|
setIsFocus(false);
|
|
448
|
-
var _getHistoryInfo = getHistoryInfo(returnValue, historyList,
|
|
449
|
+
var _getHistoryInfo = getHistoryInfo(returnValue, historyList, {
|
|
450
|
+
localeObj: localeObj,
|
|
451
|
+
locale: locale
|
|
452
|
+
}, format, timeSpanBoundary),
|
|
449
453
|
_getHistoryInfo2 = _slicedToArray(_getHistoryInfo, 2),
|
|
450
454
|
isRepeat = _getHistoryInfo2[0],
|
|
451
455
|
historyValue = _getHistoryInfo2[1];
|
|
@@ -458,7 +462,7 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
458
462
|
setRecordDateValue(returnValue);
|
|
459
463
|
}
|
|
460
464
|
} else {
|
|
461
|
-
_message.error(localeObj["does-not-match-the-input-format"]);
|
|
465
|
+
_message.error(formatMessage(localeObj["does-not-match-the-input-format"]));
|
|
462
466
|
}
|
|
463
467
|
} else {
|
|
464
468
|
var finalDateOption = getFinalDateOption(inputValue);
|
|
@@ -470,12 +474,15 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
470
474
|
});
|
|
471
475
|
var _passValue = _returnValue.value;
|
|
472
476
|
if (isExceedMaxTimeSpan(_passValue, timeSpanBoundary)) {
|
|
473
|
-
_message.error(localeObj["the-maximum-time-span-is-exceeded"]);
|
|
477
|
+
_message.error(formatMessage(localeObj["the-maximum-time-span-is-exceeded"]));
|
|
474
478
|
return;
|
|
475
479
|
}
|
|
476
480
|
_onChange(_returnValue);
|
|
477
481
|
setIsFocus(false);
|
|
478
|
-
var _getHistoryInfo3 = getHistoryInfo(_returnValue, historyList,
|
|
482
|
+
var _getHistoryInfo3 = getHistoryInfo(_returnValue, historyList, {
|
|
483
|
+
localeObj: localeObj,
|
|
484
|
+
locale: locale
|
|
485
|
+
}, format, timeSpanBoundary),
|
|
479
486
|
_getHistoryInfo4 = _slicedToArray(_getHistoryInfo3, 2),
|
|
480
487
|
_isRepeat = _getHistoryInfo4[0],
|
|
481
488
|
_historyValue = _getHistoryInfo4[1];
|
|
@@ -488,7 +495,7 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
488
495
|
setRecordDateValue(_returnValue);
|
|
489
496
|
}
|
|
490
497
|
} else {
|
|
491
|
-
_message.error(localeObj["does-not-match-the-input-format"]);
|
|
498
|
+
_message.error(formatMessage(localeObj["does-not-match-the-input-format"]));
|
|
492
499
|
}
|
|
493
500
|
}
|
|
494
501
|
isInputRef.current = false;
|
|
@@ -555,15 +562,18 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
555
562
|
var _values3 = _values2,
|
|
556
563
|
resValue = _values3.value;
|
|
557
564
|
if (isSameDate(resValue[0], resValue[1], "second") || isAfterDate(resValue[0], resValue[1])) {
|
|
558
|
-
_message.error(localeObj["the-selected-time-does-not-meet-the-rule-limit"]);
|
|
565
|
+
_message.error(formatMessage(localeObj["the-selected-time-does-not-meet-the-rule-limit"]));
|
|
559
566
|
return;
|
|
560
567
|
}
|
|
561
568
|
if (isExceedMaxTimeSpan(resValue, timeSpanBoundary)) {
|
|
562
|
-
_message.error(localeObj["the-maximum-time-span-is-exceeded"]);
|
|
569
|
+
_message.error(formatMessage(localeObj["the-maximum-time-span-is-exceeded"]));
|
|
563
570
|
return;
|
|
564
571
|
}
|
|
565
572
|
_onChange(_values2);
|
|
566
|
-
var _getHistoryInfo5 = getHistoryInfo(_values2, historyList,
|
|
573
|
+
var _getHistoryInfo5 = getHistoryInfo(_values2, historyList, {
|
|
574
|
+
localeObj: localeObj,
|
|
575
|
+
locale: locale
|
|
576
|
+
}, format, timeSpanBoundary),
|
|
567
577
|
_getHistoryInfo6 = _slicedToArray(_getHistoryInfo5, 2),
|
|
568
578
|
isRepeat = _getHistoryInfo6[0],
|
|
569
579
|
historyValue = _getHistoryInfo6[1];
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
3
|
-
* @Date: 2022-09-13 17:59:38
|
|
4
|
-
* @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
|
|
5
|
-
* @LastEditTime: 2022-09-20 17:12:13
|
|
6
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/CWRangePicker/locale/en_US.js
|
|
7
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
-
*/
|
|
9
1
|
export default {
|
|
10
2
|
recover: "Restore default",
|
|
11
3
|
forwardSmooth: "Forward smooth",
|
|
@@ -32,5 +24,6 @@ export default {
|
|
|
32
24
|
"fit-the-input-format": "Fit the input format",
|
|
33
25
|
"does-not-match-the-input-format": "Does not match the input format",
|
|
34
26
|
"the-selected-time-does-not-meet-the-rule-limit": "If the selected time is the same or exceeds the current time, select another time",
|
|
35
|
-
"the-maximum-time-span-is-exceeded": "The maximum time span is exceeded, please re-enter"
|
|
27
|
+
"the-maximum-time-span-is-exceeded": "The maximum time span is exceeded, please re-enter",
|
|
28
|
+
"unconverted-title": "Unconverted title"
|
|
36
29
|
};
|
|
@@ -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-09-13 17:59:38
|
|
4
|
-
* @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
|
|
5
|
-
* @LastEditTime: 2022-09-20 17:23:46
|
|
6
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/CWRangePicker/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
|
recover: "恢复默认值",
|
|
11
3
|
forwardSmooth: "向前平滑",
|
|
@@ -32,5 +24,6 @@ export default {
|
|
|
32
24
|
"fit-the-input-format": "符合输入格式",
|
|
33
25
|
"does-not-match-the-input-format": "不符合输入格式,请重新输入",
|
|
34
26
|
"the-selected-time-does-not-meet-the-rule-limit": "选择的时间二者相同或者某一时间超过当前时间,请重新选择",
|
|
35
|
-
"the-maximum-time-span-is-exceeded": "超过了限制的最大时间跨度,请重新输入"
|
|
27
|
+
"the-maximum-time-span-is-exceeded": "超过了限制的最大时间跨度,请重新输入",
|
|
28
|
+
"unconverted-title": "未转化标题"
|
|
36
29
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
recover: "恢復默認值",
|
|
3
|
+
forwardSmooth: "向前平滑",
|
|
4
|
+
backSmooth: "向後平滑",
|
|
5
|
+
ExpandSpan: "按{span}倍增加時間跨度",
|
|
6
|
+
refresh: "刷新",
|
|
7
|
+
autoRefresh: "自動刷新",
|
|
8
|
+
s: "秒",
|
|
9
|
+
m: "分鐘",
|
|
10
|
+
h: "小時",
|
|
11
|
+
d: "天",
|
|
12
|
+
mo: "個月",
|
|
13
|
+
y: "年",
|
|
14
|
+
more: "更多",
|
|
15
|
+
"select-calendar": "日曆選擇",
|
|
16
|
+
recently: "最近",
|
|
17
|
+
relative: "相對",
|
|
18
|
+
absolute: "絕對",
|
|
19
|
+
unixTimestamp: "Unix",
|
|
20
|
+
other: "其他",
|
|
21
|
+
history: "歷史記錄",
|
|
22
|
+
clear: "清空",
|
|
23
|
+
"enter manually": "可根據以下類型,按查詢語句格式手動輸入",
|
|
24
|
+
"fit-the-input-format": "符合輸入格式",
|
|
25
|
+
"does-not-match-the-input-format": "不符合輸入格式,請重新輸入",
|
|
26
|
+
"the-selected-time-does-not-meet-the-rule-limit": "選擇的時間二者相同或者某一時間超過當前時間,請重新選擇",
|
|
27
|
+
"the-maximum-time-span-is-exceeded": "超過了限制的最大時間跨度,請重新輸入",
|
|
28
|
+
"unconverted-title": "未轉化標題"
|
|
29
|
+
};
|
|
@@ -111,7 +111,8 @@ export var judgeType = function judgeType(recordDateValue) {
|
|
|
111
111
|
return [isRule, captureUnit, recordUnit];
|
|
112
112
|
};
|
|
113
113
|
export var echoRecentlyTimeTitle = function echoRecentlyTimeTitle(locale, captureUnit) {
|
|
114
|
-
|
|
114
|
+
// todo: 需要优化
|
|
115
|
+
if (locale == "zh_CN" || locale == "zh" || locale == "zh_TW") {
|
|
115
116
|
if (captureUnit[1] === "mo") {
|
|
116
117
|
return "\u6700\u8FD1".concat(captureUnit[0], "\u4E2A").concat(ENUM_TimeUnit.mo[2]);
|
|
117
118
|
}
|
|
@@ -135,7 +136,7 @@ export var echoAbsoluteTimeTitle = function echoAbsoluteTimeTitle(value, format)
|
|
|
135
136
|
export var echoInputValue = function echoInputValue() {
|
|
136
137
|
var recordDateValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
137
138
|
var isFoucs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
138
|
-
var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "
|
|
139
|
+
var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "zh_CN";
|
|
139
140
|
var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "YYYY/MM/DD HH:mm:ss";
|
|
140
141
|
var forceRenderTitle = arguments.length > 4 ? arguments[4] : undefined;
|
|
141
142
|
var isAutoRefresh = arguments.length > 5 ? arguments[5] : undefined;
|
|
@@ -460,7 +461,9 @@ export var getCorrectValue = function getCorrectValue(value) {
|
|
|
460
461
|
* @param {Object} value
|
|
461
462
|
* @returns
|
|
462
463
|
*/
|
|
463
|
-
export var getHistoryInfo = function getHistoryInfo(recordValue, historyList,
|
|
464
|
+
export var getHistoryInfo = function getHistoryInfo(recordValue, historyList, _ref, format, timeSpanBoundary) {
|
|
465
|
+
var localeObj = _ref.localeObj,
|
|
466
|
+
locale = _ref.locale;
|
|
464
467
|
var key = recordValue.key,
|
|
465
468
|
value = recordValue.value,
|
|
466
469
|
_recordValue$title = recordValue.title,
|
|
@@ -480,7 +483,7 @@ export var getHistoryInfo = function getHistoryInfo(recordValue, historyList, lo
|
|
|
480
483
|
}
|
|
481
484
|
}
|
|
482
485
|
if (!values && !isRule && !_title) {
|
|
483
|
-
_title =
|
|
486
|
+
_title = localeObj(["unconverted-title"]);
|
|
484
487
|
}
|
|
485
488
|
var isRepeat = Boolean(historyList.find(function (item) {
|
|
486
489
|
return item.key === key || item.title === _title;
|
|
@@ -38,7 +38,6 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
38
38
|
_this.rcSelect = node;
|
|
39
39
|
});
|
|
40
40
|
_defineProperty(_assertThisInitialized(_this), "renderSelect", function (_ref) {
|
|
41
|
-
var _classNames;
|
|
42
41
|
var getContextPopupContainer = _ref.getPopupContainer,
|
|
43
42
|
getPrefixCls = _ref.getPrefixCls,
|
|
44
43
|
renderEmpty = _ref.renderEmpty;
|
|
@@ -63,7 +62,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
63
62
|
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
64
63
|
var rest = omit(restProps, ['inputIcon']);
|
|
65
64
|
var prefixCls = getPrefixCls('select', customizePrefixCls);
|
|
66
|
-
var cls = classNames((
|
|
65
|
+
var cls = classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-lg"), size === 'large'), "".concat(prefixCls, "-sm"), size === 'small'), "".concat(prefixCls, "-allow-drag"), allowDrag), className);
|
|
67
66
|
var dropdownCls = classNames({
|
|
68
67
|
'cw-select-dropdown-multiple': ["multiple", "tags"].includes(mode),
|
|
69
68
|
'cw-select-dropdown-has-checkbox': mode === 'multiple' && showCheckbox
|
package/lib/CWSelect/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
|
5
5
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
6
6
|
import "@chaoswise/ui/lib/Tag/index.less";
|
|
7
7
|
import _Tag from "@chaoswise/ui/lib/Tag";
|
|
8
|
-
import
|
|
8
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
9
9
|
var _excluded = ["onChange", "tagTooltipRender", "tagLabelRender", "maxTagCount", "maxTagTextLength", "defaultValue", "tagRender", "tagDropdownStyle", "mode", "value", "labelInValue", "allowDrag", "onDragEnd", "showTooltip", "showCheckbox", "dropdownRender", "onSelect", "onDeselect", "listHeight", "onDropdownVisibleChange", "selectLabel", "label"];
|
|
10
10
|
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); }
|
|
11
11
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -32,12 +32,12 @@ import PropTypes from "prop-types";
|
|
|
32
32
|
import Tag from './Tag';
|
|
33
33
|
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
34
34
|
import { DndProvider } from "react-dnd";
|
|
35
|
-
import { useDrag, useDrop } from "react-dnd";
|
|
36
35
|
import update from 'immutability-helper';
|
|
37
|
-
import { getLocale } from "./locale";
|
|
38
36
|
import { getDefaultPaddingLeft } from './utils';
|
|
39
37
|
import useConfigContext from '../useConfigContext';
|
|
40
38
|
import DragTag from './DragTag';
|
|
39
|
+
import langConfig from './locale';
|
|
40
|
+
import { formatMessage } from "../utils";
|
|
41
41
|
var Option = RCSelect.Option,
|
|
42
42
|
OptGroup = RCSelect.OptGroup;
|
|
43
43
|
/**
|
|
@@ -76,10 +76,8 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
76
76
|
selectLabel = props.selectLabel,
|
|
77
77
|
label = props.label,
|
|
78
78
|
rest = _objectWithoutProperties(props, _excluded);
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
82
|
-
var localeObj = getLocale(locale);
|
|
79
|
+
var _useLocale = _useLocale2(langConfig),
|
|
80
|
+
localeObj = _useLocale.langObj;
|
|
83
81
|
var _useConfigContext = useConfigContext(),
|
|
84
82
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
85
83
|
var prefixCls = getPrefixCls();
|
|
@@ -366,7 +364,7 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
366
364
|
});
|
|
367
365
|
return !dataSource.length ? /*#__PURE__*/React.createElement("div", {
|
|
368
366
|
className: "cw-select-show-checkbox-empty"
|
|
369
|
-
}, localeObj["no-results-were-found"]) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
367
|
+
}, formatMessage(localeObj["no-results-were-found"])) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
370
368
|
className: "cw-checkbox-all",
|
|
371
369
|
onMouseDown: function onMouseDown(e) {
|
|
372
370
|
e.preventDefault();
|
|
@@ -385,7 +383,7 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
385
383
|
style: {
|
|
386
384
|
width: '100%'
|
|
387
385
|
}
|
|
388
|
-
}, localeObj["checkAll"], "\uFF08", filterActiveValues.length, "/", dataSource.length, "\uFF09")), originNode);
|
|
386
|
+
}, formatMessage(localeObj["checkAll"]), "\uFF08", filterActiveValues.length, "/", dataSource.length, "\uFF09")), originNode);
|
|
389
387
|
};
|
|
390
388
|
var onDropdownVisibleChange = function onDropdownVisibleChange(open) {
|
|
391
389
|
setResOpen(open);
|
|
@@ -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/CWTable/EditLine.js
CHANGED
|
@@ -9,7 +9,7 @@ import "@chaoswise/ui/lib/Form/index.less";
|
|
|
9
9
|
import _Form from "@chaoswise/ui/lib/Form";
|
|
10
10
|
import "@chaoswise/ui/lib/Input/index.less";
|
|
11
11
|
import _Input from "@chaoswise/ui/lib/Input";
|
|
12
|
-
import
|
|
12
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
13
13
|
var _excluded = ["form"],
|
|
14
14
|
_excluded2 = ["render", "helpText", "rules"];
|
|
15
15
|
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; }
|
|
@@ -31,7 +31,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
31
31
|
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; }
|
|
32
32
|
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; }
|
|
33
33
|
import React, { useEffect, useState } from 'react';
|
|
34
|
-
import
|
|
34
|
+
import langConfig from './locale';
|
|
35
|
+
import { formatMessage } from "../utils";
|
|
35
36
|
import useConfigContext from '../useConfigContext';
|
|
36
37
|
var EditableContext = /*#__PURE__*/React.createContext();
|
|
37
38
|
|
|
@@ -105,10 +106,8 @@ var EditableRowCell = function EditableRowCell(props) {
|
|
|
105
106
|
var _useConfigContext2 = useConfigContext(),
|
|
106
107
|
getPrefixCls = _useConfigContext2.getPrefixCls;
|
|
107
108
|
var prefixCls = getPrefixCls();
|
|
108
|
-
var
|
|
109
|
-
|
|
110
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
111
|
-
var localeObj = getLocale(locale);
|
|
109
|
+
var _useLocale = _useLocale2(langConfig),
|
|
110
|
+
localeObj = _useLocale.langObj;
|
|
112
111
|
var editable = ['line', 'cell'].includes(editMode);
|
|
113
112
|
var renderCell = function renderCell(_ref2) {
|
|
114
113
|
var form = _ref2.form,
|
|
@@ -157,12 +156,12 @@ var EditableRowCell = function EditableRowCell(props) {
|
|
|
157
156
|
disabled: Boolean(loading),
|
|
158
157
|
type: "primary",
|
|
159
158
|
onClick: onOk
|
|
160
|
-
}, localeObj
|
|
159
|
+
}, formatMessage(localeObj["sure"])), /*#__PURE__*/React.createElement(_Button, {
|
|
161
160
|
disabled: Boolean(loading),
|
|
162
161
|
onClick: function onClick() {
|
|
163
162
|
return setEditing(false);
|
|
164
163
|
}
|
|
165
|
-
}, localeObj
|
|
164
|
+
}, formatMessage(localeObj["cancel"]))), /*#__PURE__*/React.createElement("span", {
|
|
166
165
|
className: "".concat(prefixCls, "-cw-editcell-help")
|
|
167
166
|
}, helpText)) : '',
|
|
168
167
|
trigger: "click",
|
|
@@ -171,7 +170,7 @@ var EditableRowCell = function EditableRowCell(props) {
|
|
|
171
170
|
}, /*#__PURE__*/React.createElement("a", {
|
|
172
171
|
className: "cw-edit-text"
|
|
173
172
|
}, children, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
174
|
-
title: localeObj
|
|
173
|
+
title: formatMessage(localeObj["edit"])
|
|
175
174
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
176
175
|
className: "cw-edit-icon",
|
|
177
176
|
type: "edit",
|
package/lib/CWTable/Filter.js
CHANGED
|
@@ -2,7 +2,7 @@ import "@chaoswise/ui/lib/Button/index.less";
|
|
|
2
2
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
3
3
|
import "@chaoswise/ui/lib/Checkbox/index.less";
|
|
4
4
|
import _Checkbox from "@chaoswise/ui/lib/Checkbox";
|
|
5
|
-
import
|
|
5
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
6
6
|
import _Tree from "@chaoswise/ui/lib/Antd/Tree";
|
|
7
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
8
|
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."); }
|
|
@@ -11,13 +11,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import React, { memo, useEffect, useState } from "react";
|
|
14
|
-
import
|
|
14
|
+
import langConfig from './locale';
|
|
15
|
+
import { formatMessage } from "../utils";
|
|
15
16
|
var TreeNode = _Tree.TreeNode;
|
|
16
17
|
function Filter(props) {
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
20
|
-
var localeObj = getLocale(locale);
|
|
18
|
+
var _useLocale = _useLocale2(langConfig),
|
|
19
|
+
localeObj = _useLocale.langObj;
|
|
21
20
|
var _props$filters = props.filters,
|
|
22
21
|
filters = _props$filters === void 0 ? [] : _props$filters,
|
|
23
22
|
filterMultiple = props.filterMultiple,
|
|
@@ -105,7 +104,7 @@ function Filter(props) {
|
|
|
105
104
|
setTempSelectKey(allKeys.length === tempSelectKey.length ? [] : allKeys);
|
|
106
105
|
},
|
|
107
106
|
checked: allKeys.length === tempSelectKey.length
|
|
108
|
-
}, localeObj
|
|
107
|
+
}, formatMessage(localeObj["selectAll"]))), /*#__PURE__*/React.createElement(_Tree, {
|
|
109
108
|
checkable: true,
|
|
110
109
|
selectedKeys: [],
|
|
111
110
|
checkedKeys: tempSelectKey,
|
|
@@ -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/CWTree/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import "@chaoswise/ui/lib/TooltipText/index.less";
|
|
|
5
5
|
import _TooltipText from "@chaoswise/ui/lib/TooltipText";
|
|
6
6
|
import _Dropdown from "@chaoswise/ui/lib/Antd/Dropdown";
|
|
7
7
|
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
8
|
-
import
|
|
8
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
9
9
|
import _Menu from "@chaoswise/ui/lib/Menu";
|
|
10
10
|
import "antd/es/tree/style";
|
|
11
11
|
import _Tree from "antd/es/tree";
|
|
@@ -31,10 +31,11 @@ import isUndefined from "lodash-es/isUndefined";
|
|
|
31
31
|
import PropTypes from "prop-types";
|
|
32
32
|
import classnames from "classnames";
|
|
33
33
|
import DragSvg from "./assets/Drag";
|
|
34
|
-
import { getLocale } from "./locale";
|
|
35
34
|
import "./index.less";
|
|
36
35
|
import { createTitle, KMPMatch } from "../QuickTransfer/utils";
|
|
37
36
|
import { createTree } from "./utils";
|
|
37
|
+
import langConfig from './locale';
|
|
38
|
+
import { formatMessage } from "../utils";
|
|
38
39
|
var TreeNode = _Tree.TreeNode,
|
|
39
40
|
DirectoryTree = _Tree.DirectoryTree;
|
|
40
41
|
var SubMenu = _Menu.SubMenu;
|
|
@@ -89,10 +90,8 @@ function CWTree(_ref) {
|
|
|
89
90
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
90
91
|
selfSelectedKeys = _useState6[0],
|
|
91
92
|
setSelfSelectedKeys = _useState6[1];
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
95
|
-
var localeObj = getLocale(locale);
|
|
93
|
+
var _useLocale = _useLocale2(langConfig),
|
|
94
|
+
localeObj = _useLocale.langObj;
|
|
96
95
|
useEffect(function () {
|
|
97
96
|
if (selectedKeys !== undefined) {
|
|
98
97
|
setSelfSelectedKeys(selectedKeys);
|
|
@@ -201,7 +200,7 @@ function CWTree(_ref) {
|
|
|
201
200
|
}, title)), isDrawer && draggable && _showExtend === key && /*#__PURE__*/React.createElement("span", {
|
|
202
201
|
className: classnames("cw-tree-treenode-drag-icon")
|
|
203
202
|
}, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
204
|
-
title: localeObj["dragMove"]
|
|
203
|
+
title: formatMessage(localeObj["dragMove"])
|
|
205
204
|
}, /*#__PURE__*/React.createElement(DragSvg, null)))), /*#__PURE__*/React.createElement("span", {
|
|
206
205
|
className: "cw-tree-treenode-extend ".concat(_showExtend === key ? "cw-tree-treenode-extend-show" : ""),
|
|
207
206
|
treekey: key
|
package/lib/CWTree/index.less
CHANGED
|
@@ -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-09-13 17:59:38
|
|
4
|
-
* @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
|
|
5
|
-
* @LastEditTime: 2022-11-14 10:41:23
|
|
6
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/CWUpload/locale/en_US.js
|
|
7
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
-
*/
|
|
9
1
|
export default {
|
|
10
2
|
reUpload: 'reUpload',
|
|
11
3
|
"delete": 'delete',
|
|
@@ -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
|
};
|