@chaoswise/ui 2.7.12 → 2.8.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/AlgorithmChart/common/chart.option.js +14 -11
- package/lib/AlgorithmChart/index.js +29 -26
- package/lib/Antd4Form/FormItem.js +1 -1
- package/lib/BasicLayout/Nav.js +3 -5
- package/lib/BasicLayout/index.js +6 -7
- package/lib/CWMessage/MessageContent/TabList/index.js +9 -7
- package/lib/CWMessage/MessageContent/index.js +63 -48
- package/lib/CWMessage/index.js +28 -13
- package/lib/CWMessage/service/index.js +14 -14
- package/lib/CWMessage/utils/index.js +18 -11
- package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +16 -10
- package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +4 -6
- package/lib/CWRangePicker/DropdownMenu/index.js +20 -13
- package/lib/CWRangePicker/Refresh/index.js +4 -7
- package/lib/CWRangePicker/TimeSpan/index.js +6 -9
- package/lib/CWRangePicker/index.js +28 -21
- package/lib/CWRangePicker/utils/index.js +45 -114
- package/lib/CWSelect/index.js +4 -7
- package/lib/CWTable/EditLine.js +5 -8
- package/lib/CWTable/Filter.js +5 -8
- package/lib/CWTable/index.js +3 -0
- package/lib/CWTree/index.js +4 -7
- package/lib/CWUpload/upload/Dragger.js +4 -7
- package/lib/CWUpload/upload/UploadList.js +12 -15
- package/lib/CardSelect/index.js +16 -14
- package/lib/CitySelect/index.js +3 -1
- package/lib/ColorPicker/index.js +4 -7
- package/lib/ConfigProvider/ConfigProvider.js +143 -48
- package/lib/ConfigProvider/Switch.js +10 -2
- package/lib/ConfigProvider/context.js +8 -0
- package/lib/ConfigProvider/useLocale.js +1 -1
- package/lib/DatePicker/useLocale.js +17 -10
- package/lib/DateRangePicker/components/ExtraQuickFooter.js +5 -8
- package/lib/DateRangePicker/index.js +6 -5
- package/lib/DropdownDatePicker/DropdownMenu/MoreTimeList/index.js +4 -6
- package/lib/DropdownDatePicker/DropdownMenu/index.js +4 -7
- package/lib/DropdownDatePicker/index.js +9 -10
- package/lib/DropdownDatePicker/utils/index.js +5 -93
- package/lib/EchartsBar/index.js +1 -1
- package/lib/Empty/index.js +3 -6
- package/lib/ErrorBoundary/ErrorPage.js +8 -9
- package/lib/Exception/index.js +9 -12
- package/lib/FilterDropDown/index.js +3 -6
- package/lib/Flow/tools/index.js +4 -1
- package/lib/Header/Document/index.js +3 -8
- package/lib/Header/LocaleSwitcher.js +2 -0
- package/lib/Header/UserSetting/index.js +27 -45
- package/lib/IconSelect/components/CustomImg/index.js +8 -11
- package/lib/IconSelect/components/SearchIcon/index.js +9 -9
- package/lib/IconSelect/index.js +4 -7
- package/lib/ImagePreview/index.js +3 -1
- package/lib/Joyride/List.js +9 -8
- package/lib/Joyride/index.js +19 -22
- package/lib/Pagination/index.js +14 -14
- package/lib/PolymerizationSearch/DropdownMenu.js +4 -2
- package/lib/Progress/index.js +3 -6
- package/lib/QuickTransfer/DragList.js +3 -6
- package/lib/QuickTransfer/index.js +6 -9
- package/lib/RangePicker/components/ExtraTimeFooter.js +4 -7
- package/lib/SearchBar/index.js +6 -9
- package/lib/SimpleCard/index.js +3 -1
- package/lib/SingleSpa/index.js +10 -4
- package/lib/ThemeProvider/Switcher.js +3 -1
- package/lib/TimeRangeSlider/Refresh/index.js +4 -7
- package/lib/TimeRangeSlider/TimeSpan/index.js +6 -9
- package/lib/TimeRangeSlider/index.js +22 -18
- package/lib/TimeRangeSlider/utils/index.js +20 -100
- package/lib/TimeZoneSelect/index.js +1 -1
- package/lib/TreeSelect111/index.js +3 -6
- package/lib/Upload-back/index.js +27 -25
- package/lib/VerticalLayout/index.js +3 -1
- package/lib/WangEditor/extraLanguage.js +19 -0
- package/lib/WangEditor/index.js +19 -13
- package/lib/WangEditor/messages.js +49 -0
- package/lib/WangEditor/wangEditor.js +47 -20
- package/lib/index.js +1 -0
- package/lib/locales/en_US.json +1 -0
- package/lib/locales/index.js +2 -0
- package/lib/locales/ja_JP.json +1 -0
- package/lib/locales/load.js +48 -0
- package/lib/locales/messages/antd.js +404 -0
- package/lib/locales/messages/editor.js +42 -0
- package/lib/locales/messages/timeRanges.js +36 -0
- package/lib/locales/messages/timeTypes.js +11 -0
- package/lib/locales/runtime.js +127 -0
- package/lib/locales/zh_CN.json +1 -0
- package/lib/locales/zh_HK.json +1 -0
- package/lib/locales/zh_TW.json +1 -0
- package/lib/useIntl/index.js +9 -0
- package/lib/useLocale/index.js +16 -13
- package/lib/utils/index.js +4 -1
- package/package.json +11 -2
- package/lib/Antd4/notification/index.copy.js +0 -301
- package/lib/BasicLayout/locale/en_US.js +0 -4
- package/lib/BasicLayout/locale/index.js +0 -13
- package/lib/BasicLayout/locale/ja_JP.js +0 -4
- package/lib/BasicLayout/locale/zh_CN.js +0 -4
- package/lib/BasicLayout/locale/zh_TW.js +0 -4
- package/lib/CWMessage/locale/en_US.js +0 -8
- package/lib/CWMessage/locale/index.js +0 -13
- package/lib/CWMessage/locale/ja_JP.js +0 -8
- package/lib/CWMessage/locale/zh_CN.js +0 -8
- package/lib/CWMessage/locale/zh_TW.js +0 -8
- package/lib/CWRangePicker/locale/en_US.js +0 -29
- package/lib/CWRangePicker/locale/index.js +0 -13
- package/lib/CWRangePicker/locale/ja_JP.js +0 -29
- package/lib/CWRangePicker/locale/zh_CN.js +0 -29
- package/lib/CWRangePicker/locale/zh_TW.js +0 -29
- package/lib/CWSelect/locale/en_US.js +0 -4
- package/lib/CWSelect/locale/index.js +0 -13
- package/lib/CWSelect/locale/ja_JP.js +0 -4
- package/lib/CWSelect/locale/zh_CN.js +0 -4
- package/lib/CWSelect/locale/zh_TW.js +0 -4
- package/lib/CWTable/locale/en_US.js +0 -6
- package/lib/CWTable/locale/index.js +0 -13
- package/lib/CWTable/locale/ja_JP.js +0 -6
- package/lib/CWTable/locale/zh_CN.js +0 -6
- package/lib/CWTable/locale/zh_TW.js +0 -6
- package/lib/CWTree/locale/en_US.js +0 -3
- package/lib/CWTree/locale/index.js +0 -13
- package/lib/CWTree/locale/ja_JP.js +0 -3
- package/lib/CWTree/locale/zh_CN.js +0 -3
- package/lib/CWTree/locale/zh_TW.js +0 -3
- package/lib/CWUpload/locale/en_US.js +0 -6
- package/lib/CWUpload/locale/index.js +0 -13
- package/lib/CWUpload/locale/ja_JP.js +0 -6
- package/lib/CWUpload/locale/zh_CN.js +0 -6
- package/lib/CWUpload/locale/zh_TW.js +0 -6
- package/lib/ColorPicker/locale/en_US.js +0 -4
- package/lib/ColorPicker/locale/index.js +0 -13
- package/lib/ColorPicker/locale/ja_JP.js +0 -4
- package/lib/ColorPicker/locale/zh_CN.js +0 -4
- package/lib/ColorPicker/locale/zh_TW.js +0 -4
- package/lib/DateRangePicker/locale/en_US.js +0 -5
- package/lib/DateRangePicker/locale/index.js +0 -13
- package/lib/DateRangePicker/locale/ja_JP.js +0 -5
- package/lib/DateRangePicker/locale/zh_CN.js +0 -5
- package/lib/DateRangePicker/locale/zh_TW.js +0 -5
- package/lib/DropdownDatePicker/locale/en_US.js +0 -21
- package/lib/DropdownDatePicker/locale/index.js +0 -13
- package/lib/DropdownDatePicker/locale/ja_JP.js +0 -21
- package/lib/DropdownDatePicker/locale/zh_CN.js +0 -21
- package/lib/DropdownDatePicker/locale/zh_TW.js +0 -21
- package/lib/Empty/locale/en_US.js +0 -3
- package/lib/Empty/locale/index.js +0 -13
- package/lib/Empty/locale/ja_JP.js +0 -3
- package/lib/Empty/locale/zh_CN.js +0 -3
- package/lib/Empty/locale/zh_TW.js +0 -3
- package/lib/ErrorBoundary/index.less +0 -15
- package/lib/ErrorBoundary/locale/en_US.js +0 -5
- package/lib/ErrorBoundary/locale/index.js +0 -13
- package/lib/ErrorBoundary/locale/ja_JP.js +0 -5
- package/lib/ErrorBoundary/locale/zh_CN.js +0 -5
- package/lib/ErrorBoundary/locale/zh_TW.js +0 -5
- package/lib/Exception/locale/en_US.js +0 -9
- package/lib/Exception/locale/index.js +0 -13
- package/lib/Exception/locale/ja_JP.js +0 -9
- package/lib/Exception/locale/zh_CN.js +0 -9
- package/lib/Exception/locale/zh_TW.js +0 -9
- package/lib/FilterDropDown/drag.svg +0 -17
- package/lib/FilterDropDown/locale/en_US.js +0 -3
- package/lib/FilterDropDown/locale/index.js +0 -13
- package/lib/FilterDropDown/locale/ja_JP.js +0 -3
- package/lib/FilterDropDown/locale/zh_CN.js +0 -3
- package/lib/FilterDropDown/locale/zh_TW.js +0 -3
- package/lib/IconSelect/locale/en_US.js +0 -11
- package/lib/IconSelect/locale/index.js +0 -13
- package/lib/IconSelect/locale/ja_JP.js +0 -11
- package/lib/IconSelect/locale/zh_CN.js +0 -11
- package/lib/IconSelect/locale/zh_TW.js +0 -11
- package/lib/Joyride/locale/en_US.js +0 -25
- package/lib/Joyride/locale/index.js +0 -13
- package/lib/Joyride/locale/ja_JP.js +0 -25
- package/lib/Joyride/locale/zh_CN.js +0 -25
- package/lib/Joyride/locale/zh_TW.js +0 -25
- package/lib/Pagination/locale/en_US.js +0 -8
- package/lib/Pagination/locale/index.js +0 -13
- package/lib/Pagination/locale/ja_JP.js +0 -8
- package/lib/Pagination/locale/zh_CN.js +0 -8
- package/lib/Pagination/locale/zh_TW.js +0 -8
- package/lib/Progress/locale/en_US.js +0 -3
- package/lib/Progress/locale/index.js +0 -13
- package/lib/Progress/locale/ja_JP.js +0 -3
- package/lib/Progress/locale/zh_CN.js +0 -3
- package/lib/Progress/locale/zh_TW.js +0 -3
- package/lib/QuickTransfer/CheckList.js +0 -47
- package/lib/QuickTransfer/TopicList.js +0 -152
- package/lib/QuickTransfer/locale/en_US.js +0 -8
- package/lib/QuickTransfer/locale/index.js +0 -13
- package/lib/QuickTransfer/locale/ja_JP.js +0 -8
- package/lib/QuickTransfer/locale/zh_CN.js +0 -8
- package/lib/QuickTransfer/locale/zh_TW.js +0 -8
- package/lib/RangePicker/locale/en_US.js +0 -5
- package/lib/RangePicker/locale/index.js +0 -13
- package/lib/RangePicker/locale/ja_JP.js +0 -5
- package/lib/RangePicker/locale/zh_CN.js +0 -5
- package/lib/RangePicker/locale/zh_TW.js +0 -5
- package/lib/SearchBar/locale/en_US.js +0 -6
- package/lib/SearchBar/locale/index.js +0 -13
- package/lib/SearchBar/locale/ja_JP.js +0 -6
- package/lib/SearchBar/locale/zh_CN.js +0 -6
- package/lib/SearchBar/locale/zh_TW.js +0 -6
- package/lib/TimeRangeSlider/locale/en_US.js +0 -31
- package/lib/TimeRangeSlider/locale/index.js +0 -13
- package/lib/TimeRangeSlider/locale/ja_JP.js +0 -31
- package/lib/TimeRangeSlider/locale/zh_CN.js +0 -31
- package/lib/TimeRangeSlider/locale/zh_TW.js +0 -31
- package/lib/TreeSelect111/locale/en_US.js +0 -3
- package/lib/TreeSelect111/locale/index.js +0 -13
- package/lib/TreeSelect111/locale/ja_JP.js +0 -3
- package/lib/TreeSelect111/locale/zh_CN.js +0 -3
- package/lib/TreeSelect111/locale/zh_TW.js +0 -3
- package/lib/WangEditor/locale/index.js +0 -93
- package/lib/useConfgiContext/index.js +0 -6
|
@@ -9,7 +9,6 @@ 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/Icon";
|
|
12
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
13
12
|
var _excluded = ["showTipIcon"],
|
|
14
13
|
_excluded2 = ["timeDomain", "number", "unit", "isRecently", "value"],
|
|
15
14
|
_excluded3 = ["value", "timeDomain", "number", "unit", "isRecently"];
|
|
@@ -31,6 +30,8 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
31
30
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
32
31
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
33
32
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
33
|
+
import useIntl from '../useIntl';
|
|
34
|
+
import useConfigLocale from '../ConfigProvider/useLocale';
|
|
34
35
|
import React, { forwardRef, useState, useEffect, useMemo, useRef, useImperativeHandle } from "react";
|
|
35
36
|
import PropTypes from "prop-types";
|
|
36
37
|
import classnames from "classnames";
|
|
@@ -43,14 +44,13 @@ import RecoverSvg from "./assets/Recover";
|
|
|
43
44
|
import { regroupDataSourceFn, echoInputValue, getUnit, judgeType, getChangeUnitDate, isInvalidDate, range, funcValueChangeArrayValue, getCorrectValue, getHistoryInfo, getFinalDateOption, getTruthDateCount, isAfterDate, isSameDate, isExceedMaxTimeSpan, getYears, computedRecentlyValue, getTimeSpanFromValue } from "./utils";
|
|
44
45
|
import { isEqual } from "lodash-es";
|
|
45
46
|
import moment from "moment";
|
|
46
|
-
import langConfig from "./locale";
|
|
47
|
-
import { formatMessage } from "../utils";
|
|
48
47
|
import "./index.less";
|
|
48
|
+
var EMPTY_DATA_SOURCE = [];
|
|
49
49
|
var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
50
50
|
var defaultValue = props.defaultValue,
|
|
51
51
|
value = props.value,
|
|
52
52
|
_props$dataSource = props.dataSource,
|
|
53
|
-
dataSource = _props$dataSource === void 0 ?
|
|
53
|
+
dataSource = _props$dataSource === void 0 ? EMPTY_DATA_SOURCE : _props$dataSource,
|
|
54
54
|
classNameWrapper = props.classNameWrapper,
|
|
55
55
|
_props$onChange = props.onChange,
|
|
56
56
|
_onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
@@ -74,10 +74,10 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
74
74
|
open = props.open,
|
|
75
75
|
_props$rangePickerFor = props.rangePickerFormat,
|
|
76
76
|
rangePickerFormat = _props$rangePickerFor === void 0 ? "YYYY/MM/DD" : _props$rangePickerFor;
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
locale =
|
|
77
|
+
var intl = useIntl();
|
|
78
|
+
var _useConfigLocale = useConfigLocale(),
|
|
79
|
+
_useConfigLocale$loca = _useConfigLocale.locale,
|
|
80
|
+
locale = _useConfigLocale$loca === void 0 ? "zh_CN" : _useConfigLocale$loca;
|
|
81
81
|
var _refreshOption$onAuto = refreshOption.onAutoRefresh,
|
|
82
82
|
onAutoRefresh = _refreshOption$onAuto === void 0 ? function () {} : _refreshOption$onAuto,
|
|
83
83
|
_refreshOption$onAuto2 = refreshOption.onAutoRefreshChange,
|
|
@@ -128,6 +128,7 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
128
128
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
129
129
|
recordDateValue = _useState6[0],
|
|
130
130
|
setRecordDateValue = _useState6[1];
|
|
131
|
+
var inputSourceRef = useRef(recordDateValue);
|
|
131
132
|
// 自动刷新状态是否开启
|
|
132
133
|
var _useState7 = useState(false),
|
|
133
134
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
@@ -263,8 +264,14 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
263
264
|
|
|
264
265
|
// 输入框回显
|
|
265
266
|
useEffect(function () {
|
|
266
|
-
|
|
267
|
-
|
|
267
|
+
var sourceChanged = inputSourceRef.current !== recordDateValue;
|
|
268
|
+
inputSourceRef.current = recordDateValue;
|
|
269
|
+
if (sourceChanged) isInputRef.current = false;
|
|
270
|
+
// Localizing the committed value must not overwrite an unsubmitted draft.
|
|
271
|
+
// A new controlled/selected value still takes precedence over that draft.
|
|
272
|
+
if (isFocus && isInputRef.current && !sourceChanged) return;
|
|
273
|
+
setInputValue(customRenderTitle ? customRenderTitle(recordDateValue, isFocus) : echoInputValue(recordDateValue, isFocus, locale, format, forceRenderTitle, timeSpanBoundary, isSpecialRelativeTime, _defaultValue, intl));
|
|
274
|
+
}, [recordDateValue, isFocus, locale, format, forceRenderTitle, _defaultValue, customRenderTitle, intl]);
|
|
268
275
|
useEffect(function () {
|
|
269
276
|
var _judgeType5 = judgeType(recordDateValue),
|
|
270
277
|
_judgeType6 = _slicedToArray(_judgeType5, 1),
|
|
@@ -429,7 +436,7 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
429
436
|
type: "question-circle",
|
|
430
437
|
className: classnames("cw-range-picker-suffix-tips")
|
|
431
438
|
})) : showRecoverIcon && !isFocus && !isEqualDateValue ? /*#__PURE__*/React.createElement(_Tooltip, {
|
|
432
|
-
title:
|
|
439
|
+
title: intl.get("8aba20b3-9ee3-48b9-863c-224e6bdb4947").d("恢复默认值")
|
|
433
440
|
}, /*#__PURE__*/React.createElement(RecoverSvg, {
|
|
434
441
|
onClick: onRecover,
|
|
435
442
|
className: classnames("cw-range-picker-suffix-recover")
|
|
@@ -471,16 +478,16 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
471
478
|
}, inputValue);
|
|
472
479
|
var isInvalidDate_ = isInvalidDate(returnValue.value);
|
|
473
480
|
if (!isInvalidDate_) {
|
|
474
|
-
//
|
|
481
|
+
// Input format validation succeeded.
|
|
475
482
|
var passValue = returnValue.value;
|
|
476
483
|
if (isExceedMaxTimeSpan(passValue, timeSpanBoundary)) {
|
|
477
|
-
_message.error(
|
|
484
|
+
_message.error(intl.get("e8a046c4-4611-47b9-bef0-cb46de7dd733").d("超过了限制的最大时间跨度,请重新输入"));
|
|
478
485
|
return;
|
|
479
486
|
}
|
|
480
487
|
_onChange(returnValue);
|
|
481
488
|
setIsFocus(false);
|
|
482
489
|
var _getHistoryInfo = getHistoryInfo(returnValue, historyList, {
|
|
483
|
-
|
|
490
|
+
intl: intl,
|
|
484
491
|
locale: locale
|
|
485
492
|
}, format, timeSpanBoundary),
|
|
486
493
|
_getHistoryInfo2 = _slicedToArray(_getHistoryInfo, 2),
|
|
@@ -495,7 +502,7 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
495
502
|
setRecordDateValue(returnValue);
|
|
496
503
|
}
|
|
497
504
|
} else {
|
|
498
|
-
_message.error(
|
|
505
|
+
_message.error(intl.get("e2008629-6fc2-4222-b28c-ada43aa79a74").d("不符合输入格式,请重新输入"));
|
|
499
506
|
}
|
|
500
507
|
} else {
|
|
501
508
|
var finalDateOption = getFinalDateOption(inputValue);
|
|
@@ -507,13 +514,13 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
507
514
|
});
|
|
508
515
|
var _passValue = _returnValue.value;
|
|
509
516
|
if (isExceedMaxTimeSpan(_passValue, timeSpanBoundary)) {
|
|
510
|
-
_message.error(
|
|
517
|
+
_message.error(intl.get("e8a046c4-4611-47b9-bef0-cb46de7dd733").d("超过了限制的最大时间跨度,请重新输入"));
|
|
511
518
|
return;
|
|
512
519
|
}
|
|
513
520
|
_onChange(_returnValue);
|
|
514
521
|
setIsFocus(false);
|
|
515
522
|
var _getHistoryInfo3 = getHistoryInfo(_returnValue, historyList, {
|
|
516
|
-
|
|
523
|
+
intl: intl,
|
|
517
524
|
locale: locale
|
|
518
525
|
}, format, timeSpanBoundary),
|
|
519
526
|
_getHistoryInfo4 = _slicedToArray(_getHistoryInfo3, 2),
|
|
@@ -528,7 +535,7 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
528
535
|
setRecordDateValue(_returnValue);
|
|
529
536
|
}
|
|
530
537
|
} else {
|
|
531
|
-
_message.error(
|
|
538
|
+
_message.error(intl.get("e2008629-6fc2-4222-b28c-ada43aa79a74").d("不符合输入格式,请重新输入"));
|
|
532
539
|
}
|
|
533
540
|
}
|
|
534
541
|
isInputRef.current = false;
|
|
@@ -596,16 +603,16 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
596
603
|
var _values2 = values,
|
|
597
604
|
resValue = _values2.value;
|
|
598
605
|
if (isSameDate(resValue[0], resValue[1], "second") || isAfterDate(resValue[0], resValue[1])) {
|
|
599
|
-
_message.error(
|
|
606
|
+
_message.error(intl.get("92eb0ee0-1f72-4f49-bfad-ff7f0d1bd21d").d("选择的时间二者相同或者某一时间超过当前时间,请重新选择"));
|
|
600
607
|
return;
|
|
601
608
|
}
|
|
602
609
|
if (isExceedMaxTimeSpan(resValue, timeSpanBoundary)) {
|
|
603
|
-
_message.error(
|
|
610
|
+
_message.error(intl.get("e8a046c4-4611-47b9-bef0-cb46de7dd733").d("超过了限制的最大时间跨度,请重新输入"));
|
|
604
611
|
return;
|
|
605
612
|
}
|
|
606
613
|
_onChange(values);
|
|
607
614
|
var _getHistoryInfo5 = getHistoryInfo(values, historyList, {
|
|
608
|
-
|
|
615
|
+
intl: intl,
|
|
609
616
|
locale: locale
|
|
610
617
|
}, format, timeSpanBoundary),
|
|
611
618
|
_getHistoryInfo6 = _slicedToArray(_getHistoryInfo5, 2),
|
|
@@ -10,63 +10,29 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
10
10
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
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(r) { if (Array.isArray(r)) return r; }
|
|
13
|
+
import formatRecentTime from '../../locales/messages/timeRanges';
|
|
13
14
|
import moment from "moment";
|
|
15
|
+
import { getFallbackIntl } from '../../locales/runtime';
|
|
14
16
|
var _require = require("uuid"),
|
|
15
17
|
uuidv4 = _require.v4;
|
|
16
18
|
// 枚举时间单位
|
|
17
19
|
var ENUM_TimeUnit = {
|
|
18
20
|
s: {
|
|
19
|
-
zh_CN: "秒",
|
|
20
|
-
en_US: {
|
|
21
|
-
singular: "Second",
|
|
22
|
-
plural: "Seconds"
|
|
23
|
-
},
|
|
24
|
-
zh_TW: "秒",
|
|
25
21
|
unit: "seconds"
|
|
26
22
|
},
|
|
27
23
|
m: {
|
|
28
|
-
zh_CN: "分钟",
|
|
29
|
-
en_US: {
|
|
30
|
-
singular: "Minute",
|
|
31
|
-
plural: "Minutes"
|
|
32
|
-
},
|
|
33
|
-
zh_TW: "分鐘",
|
|
34
24
|
unit: "minutes"
|
|
35
25
|
},
|
|
36
26
|
h: {
|
|
37
|
-
zh_CN: "小时",
|
|
38
|
-
en_US: {
|
|
39
|
-
singular: "Hour",
|
|
40
|
-
plural: "Hours"
|
|
41
|
-
},
|
|
42
|
-
zh_TW: "小時",
|
|
43
27
|
unit: "hours"
|
|
44
28
|
},
|
|
45
29
|
d: {
|
|
46
|
-
zh_CN: "天",
|
|
47
|
-
en_US: {
|
|
48
|
-
singular: "Day",
|
|
49
|
-
plural: "Days"
|
|
50
|
-
},
|
|
51
|
-
zh_TW: "天",
|
|
52
30
|
unit: "days"
|
|
53
31
|
},
|
|
54
32
|
mo: {
|
|
55
|
-
zh_CN: "月",
|
|
56
|
-
en_US: {
|
|
57
|
-
singular: "Month",
|
|
58
|
-
plural: "Months"
|
|
59
|
-
},
|
|
60
|
-
zh_TW: "月",
|
|
61
33
|
unit: "mo"
|
|
62
34
|
},
|
|
63
35
|
y: {
|
|
64
|
-
zh_CN: "年",
|
|
65
|
-
en_US: {
|
|
66
|
-
singular: "Year",
|
|
67
|
-
plural: "Years"
|
|
68
|
-
},
|
|
69
|
-
zh_TW: "年",
|
|
70
36
|
unit: "years"
|
|
71
37
|
}
|
|
72
38
|
};
|
|
@@ -153,62 +119,7 @@ export var judgeType = function judgeType(recordDateValue) {
|
|
|
153
119
|
}
|
|
154
120
|
return [isRule, captureUnit, recordUnit];
|
|
155
121
|
};
|
|
156
|
-
export var echoRecentlyTimeTitle =
|
|
157
|
-
// 参数验证
|
|
158
|
-
if (!captureUnit || !Array.isArray(captureUnit) || captureUnit.length < 2) {
|
|
159
|
-
return '';
|
|
160
|
-
}
|
|
161
|
-
var _captureUnit3 = _slicedToArray(captureUnit, 2),
|
|
162
|
-
count = _captureUnit3[0],
|
|
163
|
-
unit = _captureUnit3[1];
|
|
164
|
-
var timeUnit = ENUM_TimeUnit[unit];
|
|
165
|
-
if (!timeUnit) {
|
|
166
|
-
return '';
|
|
167
|
-
}
|
|
168
|
-
var countNum = parseInt(count, 10);
|
|
169
|
-
|
|
170
|
-
// 语言配置映射
|
|
171
|
-
var localeConfig = {
|
|
172
|
-
zh_CN: {
|
|
173
|
-
template: function template(count, unitText) {
|
|
174
|
-
return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '个' : '').concat(unitText);
|
|
175
|
-
},
|
|
176
|
-
getUnitText: function getUnitText() {
|
|
177
|
-
return timeUnit.zh_CN;
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
zh: {
|
|
181
|
-
template: function template(count, unitText) {
|
|
182
|
-
return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '个' : '').concat(unitText);
|
|
183
|
-
},
|
|
184
|
-
getUnitText: function getUnitText() {
|
|
185
|
-
return timeUnit.zh_CN;
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
zh_TW: {
|
|
189
|
-
template: function template(count, unitText) {
|
|
190
|
-
return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '個' : '').concat(unitText);
|
|
191
|
-
},
|
|
192
|
-
getUnitText: function getUnitText() {
|
|
193
|
-
return timeUnit.zh_TW;
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
"default": {
|
|
197
|
-
template: function template(count, unitText) {
|
|
198
|
-
return "Past ".concat(count, " ").concat(unitText);
|
|
199
|
-
},
|
|
200
|
-
getUnitText: function getUnitText() {
|
|
201
|
-
var isPlural = countNum !== 1;
|
|
202
|
-
return isPlural ? timeUnit.en_US.plural : timeUnit.en_US.singular;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
// 获取当前语言配置,如果不存在则使用默认配置
|
|
208
|
-
var config = localeConfig[locale] || localeConfig["default"];
|
|
209
|
-
var unitText = config.getUnitText();
|
|
210
|
-
return config.template(count, unitText);
|
|
211
|
-
};
|
|
122
|
+
export var echoRecentlyTimeTitle = formatRecentTime;
|
|
212
123
|
export var echoAbsoluteTimeTitle = function echoAbsoluteTimeTitle(value, format) {
|
|
213
124
|
var hasTimeSpan = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
214
125
|
var timeSpanBoundary = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -227,8 +138,12 @@ export var echoInputValue = function echoInputValue() {
|
|
|
227
138
|
var timeSpanBoundary = arguments.length > 5 ? arguments[5] : undefined;
|
|
228
139
|
var isSpecialRelativeTime = arguments.length > 6 ? arguments[6] : undefined;
|
|
229
140
|
var _defaultValue = arguments.length > 7 ? arguments[7] : undefined;
|
|
230
|
-
var
|
|
231
|
-
|
|
141
|
+
var intl = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : getFallbackIntl(locale);
|
|
142
|
+
var type = recordDateValue.type;
|
|
143
|
+
var title = recordDateValue.autoTitle ? getHistoryTitle(recordDateValue, {
|
|
144
|
+
locale: locale,
|
|
145
|
+
intl: intl
|
|
146
|
+
}, format, timeSpanBoundary) : recordDateValue.title;
|
|
232
147
|
var _judgeType = judgeType(recordDateValue),
|
|
233
148
|
_judgeType2 = _slicedToArray(_judgeType, 2),
|
|
234
149
|
isRule = _judgeType2[0],
|
|
@@ -241,7 +156,7 @@ export var echoInputValue = function echoInputValue() {
|
|
|
241
156
|
return title;
|
|
242
157
|
}
|
|
243
158
|
if (isRule && !isFoucs) {
|
|
244
|
-
return echoRecentlyTimeTitle(locale, captureUnit);
|
|
159
|
+
return echoRecentlyTimeTitle(locale, captureUnit, intl);
|
|
245
160
|
}
|
|
246
161
|
if (Array.isArray(_defaultValue) && _defaultValue !== null && _defaultValue !== void 0 && _defaultValue.length) {
|
|
247
162
|
return echoAbsoluteTimeTitle(_defaultValue, format, true, timeSpanBoundary);
|
|
@@ -516,17 +431,22 @@ export var getCorrectValue = function getCorrectValue(value) {
|
|
|
516
431
|
};
|
|
517
432
|
// ----------------------------------历史记录----------------------------------
|
|
518
433
|
/**
|
|
519
|
-
*
|
|
520
|
-
* @param {Object}
|
|
521
|
-
* @returns
|
|
434
|
+
* Resolve generated history labels at render time; caller titles stay untouched.
|
|
435
|
+
* @param {Object} recordValue Stored time range and title origin.
|
|
522
436
|
*/
|
|
523
|
-
export var
|
|
524
|
-
var
|
|
525
|
-
|
|
526
|
-
var
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
437
|
+
export var getHistoryTitle = function getHistoryTitle(recordValue) {
|
|
438
|
+
var language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
439
|
+
var format = arguments.length > 2 ? arguments[2] : undefined;
|
|
440
|
+
var timeSpanBoundary = arguments.length > 3 ? arguments[3] : undefined;
|
|
441
|
+
var _ref = typeof language === 'string' ? {
|
|
442
|
+
locale: language
|
|
443
|
+
} : language,
|
|
444
|
+
_ref$locale = _ref.locale,
|
|
445
|
+
locale = _ref$locale === void 0 ? 'zh_CN' : _ref$locale,
|
|
446
|
+
_ref$intl = _ref.intl,
|
|
447
|
+
intl = _ref$intl === void 0 ? getFallbackIntl(locale) : _ref$intl;
|
|
448
|
+
var value = recordValue.value;
|
|
449
|
+
var title = recordValue.autoTitle ? '' : recordValue.title || '';
|
|
530
450
|
var _judgeType3 = judgeType(recordValue),
|
|
531
451
|
_judgeType4 = _slicedToArray(_judgeType3, 2),
|
|
532
452
|
isRule = _judgeType4[0],
|
|
@@ -538,19 +458,30 @@ export var getHistoryInfo = function getHistoryInfo(recordValue, historyList, _r
|
|
|
538
458
|
}
|
|
539
459
|
if (isRule) {
|
|
540
460
|
if (!title) {
|
|
541
|
-
_title = echoRecentlyTimeTitle(locale, captureUnit);
|
|
461
|
+
_title = echoRecentlyTimeTitle(locale, captureUnit, intl);
|
|
542
462
|
}
|
|
543
463
|
}
|
|
544
464
|
if (!values && !isRule && !_title) {
|
|
545
|
-
_title =
|
|
465
|
+
_title = intl.get("bbf8ccde-ab7c-4040-97eb-35b56742de27").d("未转化标题");
|
|
546
466
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
var
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
467
|
+
return _title;
|
|
468
|
+
};
|
|
469
|
+
export var getHistoryInfo = function getHistoryInfo(recordValue, historyList) {
|
|
470
|
+
var language = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
471
|
+
var format = arguments.length > 3 ? arguments[3] : undefined;
|
|
472
|
+
var timeSpanBoundary = arguments.length > 4 ? arguments[4] : undefined;
|
|
473
|
+
// Preserve the old title field/signature, but mark generated labels for rendering.
|
|
474
|
+
var autoTitle = recordValue.autoTitle === true || !recordValue.title;
|
|
475
|
+
var record = _objectSpread(_objectSpread({}, recordValue), {}, {
|
|
476
|
+
autoTitle: autoTitle
|
|
477
|
+
});
|
|
478
|
+
var title = getHistoryTitle(record, language, format, timeSpanBoundary);
|
|
479
|
+
var isRepeat = historyList.some(function (item) {
|
|
480
|
+
return item.key === record.key || getHistoryTitle(item, language, format, timeSpanBoundary) === title;
|
|
481
|
+
});
|
|
482
|
+
return [isRepeat, _objectSpread(_objectSpread({}, record), {}, {
|
|
483
|
+
title: title,
|
|
484
|
+
key: record.key || uuidv4()
|
|
554
485
|
})];
|
|
555
486
|
};
|
|
556
487
|
|
package/lib/CWSelect/index.js
CHANGED
|
@@ -5,7 +5,6 @@ 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 _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
9
8
|
var _excluded = ["onChange", "tagTooltipRender", "tagLabelRender", "maxTagCount", "maxTagTextLength", "defaultValue", "tagRender", "tagDropdownStyle", "mode", "value", "labelInValue", "allowDrag", "onDragEnd", "showTooltip", "showCheckbox", "dropdownRender", "onSelect", "onDeselect", "listHeight", "onDropdownVisibleChange", "selectLabel", "label", "multipleOptions"];
|
|
10
9
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
10
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
@@ -25,6 +24,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
25
24
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
26
25
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
27
26
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
27
|
+
import useIntl from '../useIntl';
|
|
28
28
|
import React, { useEffect, useState, forwardRef, useRef, useCallback, useMemo } from "react";
|
|
29
29
|
import ReactDom from "react-dom";
|
|
30
30
|
import RCSelect from "./antd-select";
|
|
@@ -36,8 +36,6 @@ import update from "immutability-helper";
|
|
|
36
36
|
import { getDefaultPaddingLeft } from "./utils";
|
|
37
37
|
import useConfigContext from "../useConfigContext";
|
|
38
38
|
import DragTag from "./DragTag";
|
|
39
|
-
import langConfig from "./locale";
|
|
40
|
-
import { formatMessage } from "../utils";
|
|
41
39
|
var Option = RCSelect.Option,
|
|
42
40
|
OptGroup = RCSelect.OptGroup;
|
|
43
41
|
/**
|
|
@@ -81,8 +79,7 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
81
79
|
isCheckboxMultipleHasSelectAll: true
|
|
82
80
|
} : _props$multipleOption,
|
|
83
81
|
rest = _objectWithoutProperties(props, _excluded);
|
|
84
|
-
var
|
|
85
|
-
localeObj = _useLocale.langObj;
|
|
82
|
+
var intl = useIntl();
|
|
86
83
|
var _useConfigContext = useConfigContext(),
|
|
87
84
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
88
85
|
var prefixCls = getPrefixCls();
|
|
@@ -372,7 +369,7 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
372
369
|
});
|
|
373
370
|
var notFoundContent = rest.notFoundContent ? rest.notFoundContent : /*#__PURE__*/React.createElement("div", {
|
|
374
371
|
className: "cw-select-show-checkbox-empty"
|
|
375
|
-
},
|
|
372
|
+
}, intl.get("812f44fc-ed3c-4bd3-8ad5-35cd2996c5ae").d("未查找到任何结果"));
|
|
376
373
|
return !dataSource.length ? notFoundContent : /*#__PURE__*/React.createElement(React.Fragment, null, multipleOptions.isCheckboxMultipleHasSelectAll && /*#__PURE__*/React.createElement("div", {
|
|
377
374
|
className: "cw-checkbox-all",
|
|
378
375
|
onMouseDown: function onMouseDown(e) {
|
|
@@ -388,7 +385,7 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
388
385
|
style: {
|
|
389
386
|
width: "100%"
|
|
390
387
|
}
|
|
391
|
-
},
|
|
388
|
+
}, intl.get("3991a1d0-65a8-45ca-94a4-f89fbd9f8555").d("全选"), "\uFF08", filterActiveValues.length, "/", dataSource.length, "\uFF09")), originNode);
|
|
392
389
|
};
|
|
393
390
|
var onDropdownVisibleChange = function onDropdownVisibleChange(open) {
|
|
394
391
|
setResOpen(open);
|
package/lib/CWTable/EditLine.js
CHANGED
|
@@ -9,7 +9,6 @@ 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 _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
13
12
|
var _excluded = ["form"],
|
|
14
13
|
_excluded2 = ["render", "helpText", "rules"];
|
|
15
14
|
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; }
|
|
@@ -30,9 +29,8 @@ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(
|
|
|
30
29
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
31
30
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
32
31
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
32
|
+
import useIntl from '../useIntl';
|
|
33
33
|
import React, { useEffect, useState } from 'react';
|
|
34
|
-
import langConfig from './locale';
|
|
35
|
-
import { formatMessage } from "../utils";
|
|
36
34
|
import useConfigContext from '../useConfigContext';
|
|
37
35
|
var EditableContext = /*#__PURE__*/React.createContext();
|
|
38
36
|
|
|
@@ -106,8 +104,7 @@ var EditableRowCell = function EditableRowCell(props) {
|
|
|
106
104
|
var _useConfigContext2 = useConfigContext(),
|
|
107
105
|
getPrefixCls = _useConfigContext2.getPrefixCls;
|
|
108
106
|
var prefixCls = getPrefixCls();
|
|
109
|
-
var
|
|
110
|
-
localeObj = _useLocale.langObj;
|
|
107
|
+
var intl = useIntl();
|
|
111
108
|
var editable = ['line', 'cell'].includes(editMode);
|
|
112
109
|
var renderCell = function renderCell(_ref2) {
|
|
113
110
|
var form = _ref2.form,
|
|
@@ -156,12 +153,12 @@ var EditableRowCell = function EditableRowCell(props) {
|
|
|
156
153
|
disabled: Boolean(loading),
|
|
157
154
|
type: "primary",
|
|
158
155
|
onClick: onOk
|
|
159
|
-
},
|
|
156
|
+
}, intl.get("4253417c-d699-4eed-8c75-34d2a8b18a68").d("确定")), /*#__PURE__*/React.createElement(_Button, {
|
|
160
157
|
disabled: Boolean(loading),
|
|
161
158
|
onClick: function onClick() {
|
|
162
159
|
return setEditing(false);
|
|
163
160
|
}
|
|
164
|
-
},
|
|
161
|
+
}, intl.get("04a57125-d7d3-4559-9e88-cf91124095a4").d("取消"))), /*#__PURE__*/React.createElement("span", {
|
|
165
162
|
className: "".concat(prefixCls, "-cw-editcell-help")
|
|
166
163
|
}, helpText)) : '',
|
|
167
164
|
trigger: "click",
|
|
@@ -170,7 +167,7 @@ var EditableRowCell = function EditableRowCell(props) {
|
|
|
170
167
|
}, /*#__PURE__*/React.createElement("a", {
|
|
171
168
|
className: "cw-edit-text"
|
|
172
169
|
}, children, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
173
|
-
title:
|
|
170
|
+
title: intl.get("01f88687-defa-4388-8ccd-b9842fa5a6f2").d("编辑")
|
|
174
171
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
175
172
|
className: "cw-edit-icon",
|
|
176
173
|
type: "edit",
|
package/lib/CWTable/Filter.js
CHANGED
|
@@ -2,7 +2,6 @@ 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 _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
6
5
|
import _Tree from "@chaoswise/ui/lib/Tree";
|
|
7
6
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
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."); }
|
|
@@ -10,13 +9,11 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
10
9
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
10
|
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
11
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
12
|
+
import useIntl from '../useIntl';
|
|
13
13
|
import React, { memo, useEffect, useState } from "react";
|
|
14
|
-
import langConfig from './locale';
|
|
15
|
-
import { formatMessage } from "../utils";
|
|
16
14
|
var TreeNode = _Tree.TreeNode;
|
|
17
15
|
function Filter(props) {
|
|
18
|
-
var
|
|
19
|
-
localeObj = _useLocale.langObj;
|
|
16
|
+
var intl = useIntl();
|
|
20
17
|
var _props$filters = props.filters,
|
|
21
18
|
filters = _props$filters === void 0 ? [] : _props$filters,
|
|
22
19
|
filterMultiple = props.filterMultiple,
|
|
@@ -104,7 +101,7 @@ function Filter(props) {
|
|
|
104
101
|
setTempSelectKey(allKeys.length === tempSelectKey.length ? [] : allKeys);
|
|
105
102
|
},
|
|
106
103
|
checked: allKeys.length === tempSelectKey.length
|
|
107
|
-
},
|
|
104
|
+
}, intl.get("3991a1d0-65a8-45ca-94a4-f89fbd9f8555").d("全选"))), /*#__PURE__*/React.createElement(_Tree, {
|
|
108
105
|
checkable: true,
|
|
109
106
|
selectedKeys: [],
|
|
110
107
|
checkedKeys: tempSelectKey,
|
|
@@ -119,10 +116,10 @@ function Filter(props) {
|
|
|
119
116
|
style: {
|
|
120
117
|
marginLeft: '8px'
|
|
121
118
|
}
|
|
122
|
-
},
|
|
119
|
+
}, intl.get("04a57125-d7d3-4559-9e88-cf91124095a4").d("取消")), /*#__PURE__*/React.createElement(_Button, {
|
|
123
120
|
size: "small",
|
|
124
121
|
onClick: sure,
|
|
125
122
|
type: "primary"
|
|
126
|
-
},
|
|
123
|
+
}, intl.get("4253417c-d699-4eed-8c75-34d2a8b18a68").d("确定")))) : _renderSelect(filters));
|
|
127
124
|
}
|
|
128
125
|
export default Filter;
|
package/lib/CWTable/index.js
CHANGED
|
@@ -241,7 +241,10 @@ Table.propTypes = {
|
|
|
241
241
|
* 编辑行和编辑单元格,自定义渲染
|
|
242
242
|
* example2 render: `(props) => <Input {...props} />`
|
|
243
243
|
*/
|
|
244
|
+
// PropTypes metadata is not display text; preserve the existing contract.
|
|
245
|
+
/* cw-i18n-disable */
|
|
244
246
|
'columns[0].form.render': PropTypes.oneOf(['React组件']),
|
|
247
|
+
/* cw-i18n-enable */
|
|
245
248
|
/**
|
|
246
249
|
* 编辑单元格的提示文字
|
|
247
250
|
*/
|
package/lib/CWTree/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import "@chaoswise/ui/lib/TooltipText/index.less";
|
|
|
4
4
|
import _TooltipText from "@chaoswise/ui/lib/TooltipText";
|
|
5
5
|
import _Dropdown from "@chaoswise/ui/lib/Dropdown";
|
|
6
6
|
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
7
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
8
7
|
import _Menu from "@chaoswise/ui/lib/Menu";
|
|
9
8
|
import "antd/es/tree/style";
|
|
10
9
|
import _Tree from "antd/es/tree";
|
|
@@ -19,6 +18,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
19
18
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
20
19
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
21
20
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
21
|
+
import useIntl from '../useIntl';
|
|
22
22
|
import React, { Fragment, useState, useEffect, useMemo, useCallback } from "react";
|
|
23
23
|
import PropTypes from "prop-types";
|
|
24
24
|
import classnames from "classnames";
|
|
@@ -26,8 +26,6 @@ import DragSvg from "./assets/Drag";
|
|
|
26
26
|
import "./index.less";
|
|
27
27
|
import { createTitle } from "../QuickTransfer/utils";
|
|
28
28
|
import { createTree } from "./utils";
|
|
29
|
-
import langConfig from './locale';
|
|
30
|
-
import { formatMessage } from "../utils";
|
|
31
29
|
var TreeNode = _Tree.TreeNode,
|
|
32
30
|
DirectoryTree = _Tree.DirectoryTree;
|
|
33
31
|
var SubMenu = _Menu.SubMenu;
|
|
@@ -84,8 +82,7 @@ function CWTree(_ref) {
|
|
|
84
82
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
85
83
|
selfSelectedKeys = _useState6[0],
|
|
86
84
|
setSelfSelectedKeys = _useState6[1];
|
|
87
|
-
var
|
|
88
|
-
localeObj = _useLocale.langObj;
|
|
85
|
+
var intl = useIntl();
|
|
89
86
|
useEffect(function () {
|
|
90
87
|
if (selectedKeys !== undefined) {
|
|
91
88
|
setSelfSelectedKeys(selectedKeys);
|
|
@@ -186,7 +183,7 @@ function CWTree(_ref) {
|
|
|
186
183
|
}, title) : title), isDrawer && draggable && _showExtend === key && /*#__PURE__*/React.createElement("span", {
|
|
187
184
|
className: classnames("cw-tree-treenode-drag-icon")
|
|
188
185
|
}, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
189
|
-
title:
|
|
186
|
+
title: intl.get("d3158ace-0470-41b5-9f04-0dd8db0137c3").d("拖拽移动")
|
|
190
187
|
}, /*#__PURE__*/React.createElement(DragSvg, null)))), /*#__PURE__*/React.createElement("span", {
|
|
191
188
|
className: "cw-tree-treenode-extend ".concat(_showExtend === key ? "cw-tree-treenode-extend-show" : ""),
|
|
192
189
|
treekey: key
|
|
@@ -196,7 +193,7 @@ function CWTree(_ref) {
|
|
|
196
193
|
className: "cw-tree-treenode-extend-dropdown"
|
|
197
194
|
}, menuDom) : creatButton(icon, title, key, props))));
|
|
198
195
|
return titleDom;
|
|
199
|
-
}, [menuData, extendType, tooltipPlacement, isDrawer, draggable, _showExtend, menuRender,
|
|
196
|
+
}, [menuData, extendType, tooltipPlacement, isDrawer, draggable, _showExtend, menuRender, intl, useTooltipText, creatButton, creatMenu]);
|
|
200
197
|
var innerTreeNode = useMemo(function () {
|
|
201
198
|
function creatTreeNode(data) {
|
|
202
199
|
// 创建树结构
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
2
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
3
2
|
var __rest = this && this.__rest || function (s, e) {
|
|
4
3
|
var t = {};
|
|
5
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -8,6 +7,8 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
8
7
|
}
|
|
9
8
|
return t;
|
|
10
9
|
};
|
|
10
|
+
// @ts-nocheck
|
|
11
|
+
import useIntl from '../../useIntl';
|
|
11
12
|
/*
|
|
12
13
|
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
13
14
|
* @Date: 2022-09-13 17:59:38
|
|
@@ -16,17 +17,13 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
16
17
|
* @FilePath: /change_01/aops_web_commons/packages/ui/components/CWUpload/upload/Dragger.tsx
|
|
17
18
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
18
19
|
*/
|
|
19
|
-
// @ts-nocheck
|
|
20
20
|
import * as React from "react";
|
|
21
21
|
import Upload from "./Upload";
|
|
22
22
|
import classnames from "classnames";
|
|
23
|
-
import langConfig from '../locale';
|
|
24
|
-
import { formatMessage } from "../../utils";
|
|
25
23
|
var DefaultChildren = function DefaultChildren(_ref) {
|
|
26
24
|
var title = _ref.title,
|
|
27
25
|
description = _ref.description;
|
|
28
|
-
var
|
|
29
|
-
localeObj = _useLocale.langObj;
|
|
26
|
+
var intl = useIntl();
|
|
30
27
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
28
|
className: "cw-upload-drag-wrapper"
|
|
32
29
|
}, /*#__PURE__*/React.createElement("p", {
|
|
@@ -35,7 +32,7 @@ var DefaultChildren = function DefaultChildren(_ref) {
|
|
|
35
32
|
type: "cloud-upload"
|
|
36
33
|
})), /*#__PURE__*/React.createElement("div", {
|
|
37
34
|
className: "cw-upload-drag-text"
|
|
38
|
-
}, title !== null && title !== void 0 ? title :
|
|
35
|
+
}, title !== null && title !== void 0 ? title : intl.get("dda16720-d447-4d73-9e71-b5af7b5bbcfd").d("单击或拖动文件到此区域")), description && /*#__PURE__*/React.createElement("div", {
|
|
39
36
|
className: "cw-upload-drag-desc"
|
|
40
37
|
}, description));
|
|
41
38
|
};
|