@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
package/lib/BasicLayout/index.js
CHANGED
|
@@ -26,6 +26,7 @@ import './index.less';
|
|
|
26
26
|
import { eventManager } from '../utils';
|
|
27
27
|
import useLocale from '../useLocale';
|
|
28
28
|
import langConfig from './locale';
|
|
29
|
+
import { formatMessage } from "../utils";
|
|
29
30
|
import useConfigContext from '../useConfigContext';
|
|
30
31
|
var Content = _Layout.Content,
|
|
31
32
|
AntHeader = _Layout.Header;
|
|
@@ -126,8 +127,12 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
126
127
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
127
128
|
enableResizable = _useState8[0],
|
|
128
129
|
setEnableResizable = _useState8[1];
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
var SIDER_WIDTH_MAP = {
|
|
131
|
+
'en_US': siderWidth + 40,
|
|
132
|
+
'en': siderWidth + 40 // 兼容老版本
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
var defaultSiderWidth = SIDER_WIDTH_MAP[locale] || siderWidth;
|
|
131
136
|
var _useState9 = useState(defaultSiderWidth),
|
|
132
137
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
133
138
|
_siderDragWidth = _useState10[0],
|
|
@@ -267,7 +272,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
267
272
|
topNavigationClassName: topNavigationClassName,
|
|
268
273
|
topNavigationTrigger: topNavigationTrigger,
|
|
269
274
|
onClickTopNavigation: onClickTopNavigation,
|
|
270
|
-
allProductsTitle: allProductsTitle || langObj
|
|
275
|
+
allProductsTitle: allProductsTitle || formatMessage(langObj["allProductsTitle"]),
|
|
271
276
|
localeSwitcherOption: localeSwitcherOption,
|
|
272
277
|
messageOption: messageOption,
|
|
273
278
|
documentOption: documentOption,
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import zh_CN from './zh_CN.js';
|
|
2
|
+
import en_US from './en_US.js';
|
|
3
|
+
import zh_TW from './zh_TW.js';
|
|
3
4
|
export default {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
zh_CN: zh_CN,
|
|
6
|
+
en_US: en_US,
|
|
7
|
+
zh_TW: zh_TW,
|
|
8
|
+
// 兼容
|
|
9
|
+
zh: zh_CN,
|
|
10
|
+
en: en_US
|
|
6
11
|
};
|
|
@@ -71,7 +71,6 @@ var defaultSearchRender = function defaultSearchRender(inputValue, path, prefixC
|
|
|
71
71
|
return optionList;
|
|
72
72
|
};
|
|
73
73
|
var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
74
|
-
var _classNames2;
|
|
75
74
|
var customizePrefixCls = props.prefixCls,
|
|
76
75
|
customizeSize = props.size,
|
|
77
76
|
className = props.className,
|
|
@@ -174,7 +173,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
174
173
|
// ==================== Render =====================
|
|
175
174
|
return /*#__PURE__*/React.createElement(RcCascader, _extends({
|
|
176
175
|
prefixCls: prefixCls,
|
|
177
|
-
className: classNames(!customizePrefixCls && cascaderPrefixCls, (
|
|
176
|
+
className: classNames(!customizePrefixCls && cascaderPrefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-lg"), mergedSize === 'large'), "".concat(prefixCls, "-sm"), mergedSize === 'small'), "".concat(prefixCls, "-rtl"), isRtl), "".concat(prefixCls, "-borderless"), !bordered), "".concat(prefixCls, "-in-form-item"), isFormItemInput), getStatusClassNames(prefixCls, mergedStatus, hasFeedback), className)
|
|
178
177
|
}, restProps, {
|
|
179
178
|
direction: mergedDirection,
|
|
180
179
|
placement: getPlacement(),
|
|
@@ -6,7 +6,6 @@ import * as React from "react";
|
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import CascaderContext from "../context";
|
|
8
8
|
export default function Checkbox(_ref) {
|
|
9
|
-
var _classNames;
|
|
10
9
|
var prefixCls = _ref.prefixCls,
|
|
11
10
|
checked = _ref.checked,
|
|
12
11
|
halfChecked = _ref.halfChecked,
|
|
@@ -16,7 +15,7 @@ export default function Checkbox(_ref) {
|
|
|
16
15
|
checkable = _React$useContext.checkable;
|
|
17
16
|
var customCheckbox = typeof checkable !== "boolean" ? checkable : null;
|
|
18
17
|
return /*#__PURE__*/React.createElement("span", {
|
|
19
|
-
className: classNames("".concat(prefixCls), (
|
|
18
|
+
className: classNames("".concat(prefixCls), _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-checked"), checked), "".concat(prefixCls, "-indeterminate"), !checked && halfChecked), "".concat(prefixCls, "-disabled"), disabled)),
|
|
20
19
|
onClick: onClick
|
|
21
20
|
}, customCheckbox);
|
|
22
21
|
}
|
|
@@ -177,7 +177,6 @@ export default function Column(_ref) {
|
|
|
177
177
|
};
|
|
178
178
|
}()
|
|
179
179
|
}, optionInfoList.map(function (_ref4) {
|
|
180
|
-
var _classNames;
|
|
181
180
|
var disabled = _ref4.disabled,
|
|
182
181
|
label = _ref4.label,
|
|
183
182
|
value = _ref4.value,
|
|
@@ -212,7 +211,7 @@ export default function Column(_ref) {
|
|
|
212
211
|
// >>>>> Render
|
|
213
212
|
return /*#__PURE__*/React.createElement("li", {
|
|
214
213
|
key: fullPathKey,
|
|
215
|
-
className: classNames(menuItemPrefixCls, (
|
|
214
|
+
className: classNames(menuItemPrefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(menuItemPrefixCls, "-expand"), !isMergedLeaf), "".concat(menuItemPrefixCls, "-active"), activeValue === value), "".concat(menuItemPrefixCls, "-disabled"), disabled), "".concat(menuItemPrefixCls, "-loading"), isLoading)),
|
|
216
215
|
style: dropdownMenuColumnStyle,
|
|
217
216
|
role: "menuitemcheckbox",
|
|
218
217
|
title: title,
|
|
@@ -26,7 +26,7 @@ import Column, { FIX_LABEL } from './Column';
|
|
|
26
26
|
import useActive from './useActive';
|
|
27
27
|
import useKeyboard from './useKeyboard';
|
|
28
28
|
var RefOptionList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
29
|
-
var _optionColumns
|
|
29
|
+
var _optionColumns$;
|
|
30
30
|
var _useBaseProps = useBaseProps(),
|
|
31
31
|
prefixCls = _useBaseProps.prefixCls,
|
|
32
32
|
multiple = _useBaseProps.multiple,
|
|
@@ -181,7 +181,7 @@ var RefOptionList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
181
181
|
// ========================== Render ==========================
|
|
182
182
|
// >>>>> Empty
|
|
183
183
|
var isEmpty = !((_optionColumns$ = optionColumns[0]) !== null && _optionColumns$ !== void 0 && (_optionColumns$ = _optionColumns$.options) !== null && _optionColumns$ !== void 0 && _optionColumns$.length);
|
|
184
|
-
var emptyList = [(
|
|
184
|
+
var emptyList = [_defineProperty(_defineProperty(_defineProperty({}, fieldNames.value, '__EMPTY__'), FIX_LABEL, notFoundContent), "disabled", true)];
|
|
185
185
|
var columnProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
186
186
|
multiple: !isEmpty && multiple,
|
|
187
187
|
onSelect: onPathSelect,
|
|
@@ -213,7 +213,7 @@ var RefOptionList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
213
213
|
|
|
214
214
|
// >>>>> Render
|
|
215
215
|
return /*#__PURE__*/React.createElement("div", {
|
|
216
|
-
className: classNames("".concat(mergedPrefixCls, "-menus"), (
|
|
216
|
+
className: classNames("".concat(mergedPrefixCls, "-menus"), _defineProperty(_defineProperty({}, "".concat(mergedPrefixCls, "-menu-empty"), isEmpty), "".concat(mergedPrefixCls, "-rtl"), rtl)),
|
|
217
217
|
ref: containerRef
|
|
218
218
|
}, columnNodes);
|
|
219
219
|
});
|
|
@@ -53,8 +53,7 @@ export default (function (search, options, fieldNames, prefixCls, config, change
|
|
|
53
53
|
if (filter(search, connectedPathOptions, {
|
|
54
54
|
label: fieldNames.label
|
|
55
55
|
})) {
|
|
56
|
-
|
|
57
|
-
filteredOptions.push(_objectSpread(_objectSpread({}, option), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, fieldNames.label, render(search, connectedPathOptions, prefixCls, fieldNames)), _defineProperty(_objectSpread2, SEARCH_MARK, connectedPathOptions), _objectSpread2)));
|
|
56
|
+
filteredOptions.push(_objectSpread(_objectSpread({}, option), {}, _defineProperty(_defineProperty({}, fieldNames.label, render(search, connectedPathOptions, prefixCls, fieldNames)), SEARCH_MARK, connectedPathOptions)));
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
if (children) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
import "@chaoswise/ui/lib/Button/index.less";
|
|
3
3
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
4
|
-
import
|
|
4
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
5
5
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
6
6
|
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; }
|
|
7
7
|
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; }
|
|
@@ -10,18 +10,11 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
10
10
|
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); }
|
|
11
11
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
12
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
-
/*
|
|
14
|
-
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
15
|
-
* @Date: 2022-05-20 07:58:37
|
|
16
|
-
* @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
|
|
17
|
-
* @LastEditTime: 2023-05-14 20:53:06
|
|
18
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/CWMessage/MessageContent/TabList/index.js
|
|
19
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
20
|
-
*/
|
|
21
13
|
import React from "react";
|
|
22
14
|
import moment from "moment";
|
|
23
15
|
import { readInnerMessageApi } from "../../service";
|
|
24
|
-
import
|
|
16
|
+
import langConfig from '../../locale';
|
|
17
|
+
import { formatMessage } from "../../../utils";
|
|
25
18
|
import "./index.less";
|
|
26
19
|
var TabList = function TabList(props) {
|
|
27
20
|
var _props$messages = props.messages,
|
|
@@ -37,10 +30,8 @@ var TabList = function TabList(props) {
|
|
|
37
30
|
requestOption = props.requestOption,
|
|
38
31
|
code = props.code,
|
|
39
32
|
onTabListAllRead = props.onTabListAllRead;
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
43
|
-
var localeObj = getLocale(locale);
|
|
33
|
+
var _useLocale = _useLocale2(langConfig),
|
|
34
|
+
localeObj = _useLocale.langObj;
|
|
44
35
|
var _readInnerMessageApi = requestOption.readInnerMessageApi;
|
|
45
36
|
var onHandleMessage = function onHandleMessage(message) {
|
|
46
37
|
var userMessageId = message.userMessageId,
|
|
@@ -121,6 +112,6 @@ var TabList = function TabList(props) {
|
|
|
121
112
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, {
|
|
122
113
|
className: "cw-message-content-all-read",
|
|
123
114
|
onClick: onHandleReadAllMessage
|
|
124
|
-
}, localeObj["markAllRead"]), messageList);
|
|
115
|
+
}, formatMessage(localeObj["markAllRead"])), messageList);
|
|
125
116
|
};
|
|
126
117
|
export default TabList;
|
|
@@ -7,7 +7,7 @@ import _Empty from "@chaoswise/ui/lib/Empty";
|
|
|
7
7
|
import _Spin from "@chaoswise/ui/lib/Antd/Spin";
|
|
8
8
|
import "@chaoswise/ui/lib/Badge/index.less";
|
|
9
9
|
import _Badge from "@chaoswise/ui/lib/Badge";
|
|
10
|
-
import
|
|
10
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
11
11
|
import "@chaoswise/ui/lib/Tabs/index.less";
|
|
12
12
|
import _Tabs from "@chaoswise/ui/lib/Tabs";
|
|
13
13
|
import _ThemeProvider from "@chaoswise/ui/lib/ThemeProvider";
|
|
@@ -30,6 +30,8 @@ import React, { useState, useEffect, useRef } from "react";
|
|
|
30
30
|
import { getMessageTypeApi, getMessageListApi, getMessageUnreadCountApi } from "../service";
|
|
31
31
|
import TabList from "./TabList";
|
|
32
32
|
import { useHistory } from "react-router-dom";
|
|
33
|
+
import langConfig from "../locale";
|
|
34
|
+
import { formatMessage } from "../../utils";
|
|
33
35
|
import "./index.less";
|
|
34
36
|
var useThemeSwitcher = _ThemeProvider.useThemeSwitcher;
|
|
35
37
|
var TabPane = _Tabs.TabPane;
|
|
@@ -101,10 +103,10 @@ var MessageContent = function MessageContent(props) {
|
|
|
101
103
|
}, _callee);
|
|
102
104
|
}))();
|
|
103
105
|
}, []);
|
|
104
|
-
var
|
|
105
|
-
|
|
106
|
-
locale =
|
|
107
|
-
|
|
106
|
+
var _useLocale = _useLocale2(langConfig),
|
|
107
|
+
localeObj = _useLocale.langObj,
|
|
108
|
+
_useLocale$locale = _useLocale.locale,
|
|
109
|
+
locale = _useLocale$locale === void 0 ? "zh_CN" : _useLocale$locale;
|
|
108
110
|
// 查询消息列表(接口)
|
|
109
111
|
var getMessageList = /*#__PURE__*/function () {
|
|
110
112
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
@@ -208,7 +210,7 @@ var MessageContent = function MessageContent(props) {
|
|
|
208
210
|
total: total
|
|
209
211
|
};
|
|
210
212
|
};
|
|
211
|
-
var emptyDescription =
|
|
213
|
+
var emptyDescription = formatMessage(localeObj["no_new_messages"]);
|
|
212
214
|
return /*#__PURE__*/React.createElement("div", {
|
|
213
215
|
className: "cw-message-content"
|
|
214
216
|
}, tabOption.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Tabs, {
|
|
@@ -216,8 +218,8 @@ var MessageContent = function MessageContent(props) {
|
|
|
216
218
|
className: "cw-message-content-tabs",
|
|
217
219
|
animated: false
|
|
218
220
|
}, tabOption.map(function (item) {
|
|
219
|
-
var tabName =
|
|
220
|
-
var moreTitle =
|
|
221
|
+
var tabName = item.name;
|
|
222
|
+
var moreTitle = formatMessage(localeObj["more"]);
|
|
221
223
|
return /*#__PURE__*/React.createElement(TabPane, {
|
|
222
224
|
tab: unreadTypeArr.includes(item.code) ? /*#__PURE__*/React.createElement(_Badge, {
|
|
223
225
|
color: themeVars["red-5"]
|
|
@@ -255,7 +257,9 @@ var MessageContent = function MessageContent(props) {
|
|
|
255
257
|
})));
|
|
256
258
|
})), total == 0 || hideOnSinglePage && total <= pageInfo.pageSize ? null : /*#__PURE__*/React.createElement("div", {
|
|
257
259
|
className: "cw-message-pagination-wrapper"
|
|
258
|
-
}, /*#__PURE__*/React.createElement("span", null,
|
|
260
|
+
}, /*#__PURE__*/React.createElement("span", null, formatMessage(localeObj["totalItems"], {
|
|
261
|
+
total: total
|
|
262
|
+
})), /*#__PURE__*/React.createElement(_Pagination, _extends({
|
|
259
263
|
simple: true
|
|
260
264
|
}, getPaginationOption())))) : /*#__PURE__*/React.createElement(_Empty, {
|
|
261
265
|
description: emptyDescription
|
|
@@ -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,24 +1,23 @@
|
|
|
1
1
|
import "@chaoswise/ui/lib/Tag/index.less";
|
|
2
2
|
import _Tag from "@chaoswise/ui/lib/Tag";
|
|
3
3
|
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
4
|
-
import
|
|
4
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
5
5
|
import React from "react";
|
|
6
|
-
import
|
|
6
|
+
import langConfig from "../../locale";
|
|
7
|
+
import { formatMessage } from "../../../utils";
|
|
7
8
|
import "./index.less";
|
|
8
9
|
export default function MoreHistoryList(props) {
|
|
9
10
|
var historyList = props.historyList,
|
|
10
11
|
onClickTag = props.onClickTag,
|
|
11
12
|
onCloseTag = props.onCloseTag,
|
|
12
13
|
onCloseAllTag = props.onCloseAllTag;
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
16
|
-
var localeObj = getLocale(locale);
|
|
14
|
+
var _useLocale = _useLocale2(langConfig),
|
|
15
|
+
localeObj = _useLocale.langObj;
|
|
17
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
18
17
|
className: "cw-dropdown-menu-history-popup-more-wrapper"
|
|
19
18
|
}, /*#__PURE__*/React.createElement("div", {
|
|
20
19
|
className: "cw-dropdown-menu-history-popup-more-header"
|
|
21
|
-
}, /*#__PURE__*/React.createElement("span", null, localeObj["history"]), /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
}, /*#__PURE__*/React.createElement("span", null, formatMessage(localeObj["history"])), /*#__PURE__*/React.createElement("div", {
|
|
22
21
|
onClick: onCloseAllTag
|
|
23
22
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
24
23
|
type: "delete"
|
|
@@ -26,7 +25,7 @@ export default function MoreHistoryList(props) {
|
|
|
26
25
|
style: {
|
|
27
26
|
marginLeft: "4px"
|
|
28
27
|
}
|
|
29
|
-
}, localeObj["clear"]))), /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
}, formatMessage(localeObj["clear"])))), /*#__PURE__*/React.createElement("div", {
|
|
30
29
|
className: "cw-dropdown-menu-history-popup-more-content"
|
|
31
30
|
}, historyList.map(function (tag) {
|
|
32
31
|
return /*#__PURE__*/React.createElement(_Tag, {
|
|
@@ -2,27 +2,18 @@ import _Row from "@chaoswise/ui/lib/Antd/Row";
|
|
|
2
2
|
import _Col from "@chaoswise/ui/lib/Antd/Col";
|
|
3
3
|
import "@chaoswise/ui/lib/TooltipText/index.less";
|
|
4
4
|
import _TooltipText from "@chaoswise/ui/lib/TooltipText";
|
|
5
|
-
import
|
|
6
|
-
/*
|
|
7
|
-
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
8
|
-
* @Date: 2022-10-25 10:26:15
|
|
9
|
-
* @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
|
|
10
|
-
* @LastEditTime: 2022-11-16 17:28:56
|
|
11
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/CWRangePicker/DropdownMenu/MoreTimeList/index.js
|
|
12
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
13
|
-
*/
|
|
5
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
14
6
|
import React from "react";
|
|
15
7
|
import classnames from "classnames";
|
|
16
|
-
import
|
|
8
|
+
import langConfig from "../../locale";
|
|
9
|
+
import { formatMessage } from "../../../utils";
|
|
17
10
|
import "./index.less";
|
|
18
11
|
var MoreTimeList = function MoreTimeList(props) {
|
|
19
12
|
var regroupDataSource = props.regroupDataSource,
|
|
20
13
|
recordDateValue = props.recordDateValue,
|
|
21
14
|
onClickItem = props.onClickItem;
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
25
|
-
var localeObj = getLocale(locale);
|
|
15
|
+
var _useLocale = _useLocale2(langConfig),
|
|
16
|
+
localeObj = _useLocale.langObj;
|
|
26
17
|
// 点击Menu.Item中切换常规模式
|
|
27
18
|
var onClickMoreItem = function onClickMoreItem(item) {
|
|
28
19
|
onClickItem(item);
|
|
@@ -36,7 +27,7 @@ var MoreTimeList = function MoreTimeList(props) {
|
|
|
36
27
|
borderBottom: regroupDataSource.length - 1 !== index ? "1px solid rgba(0,0,0,0.06)" : ""
|
|
37
28
|
},
|
|
38
29
|
key: timeTypeItem.type
|
|
39
|
-
}, /*#__PURE__*/React.createElement("h3", null, localeObj[timeTypeItem.type]), /*#__PURE__*/React.createElement(_Row, null, timeTypeItem.timeList.map(function (item) {
|
|
30
|
+
}, /*#__PURE__*/React.createElement("h3", null, formatMessage(localeObj[timeTypeItem.type])), /*#__PURE__*/React.createElement(_Row, null, timeTypeItem.timeList.map(function (item) {
|
|
40
31
|
return /*#__PURE__*/React.createElement(_Col, {
|
|
41
32
|
key: item.key,
|
|
42
33
|
span: timeTypeItem.type === "absolute" || timeTypeItem.type == "unixTimestamp" ? 12 : 8,
|
|
@@ -3,7 +3,7 @@ import "@chaoswise/ui/lib/Tag/index.less";
|
|
|
3
3
|
import _Tag from "@chaoswise/ui/lib/Tag";
|
|
4
4
|
import _Dropdown from "@chaoswise/ui/lib/Antd/Dropdown";
|
|
5
5
|
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
6
|
-
import
|
|
6
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
7
7
|
var _excluded = ["timeDomain", "number", "unit", "value", "isRecently"];
|
|
8
8
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
9
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -24,7 +24,6 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
24
24
|
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; }
|
|
25
25
|
import React from "react";
|
|
26
26
|
import classnames from "classnames";
|
|
27
|
-
import { getLocale } from "../locale";
|
|
28
27
|
import CalendarSvg from "../assets/Calendar";
|
|
29
28
|
import Calendar2Svg from "../assets/Calendar2";
|
|
30
29
|
import LiveSvg from "../assets/live";
|
|
@@ -32,6 +31,8 @@ import MoreSvg from "../assets/more";
|
|
|
32
31
|
import MoreTimeList from "./MoreTimeList";
|
|
33
32
|
import MoreHistoryList from "./MoreHistoryList";
|
|
34
33
|
import { judgeType, funcValueChangeArrayValue, getCorrectValue, getHistoryInfo } from "../utils";
|
|
34
|
+
import langConfig from "../locale";
|
|
35
|
+
import { formatMessage } from "../../utils";
|
|
35
36
|
import "./index.less";
|
|
36
37
|
var DropdownMenu = function DropdownMenu(props) {
|
|
37
38
|
var dataSource = props.dataSource,
|
|
@@ -48,10 +49,10 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
48
49
|
setHistoryList = props.setHistoryList,
|
|
49
50
|
format = props.format,
|
|
50
51
|
timeSpanOption = props.timeSpanOption;
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
locale =
|
|
54
|
-
|
|
52
|
+
var _useLocale = _useLocale2(langConfig),
|
|
53
|
+
localeObj = _useLocale.langObj,
|
|
54
|
+
_useLocale$locale = _useLocale.locale,
|
|
55
|
+
locale = _useLocale$locale === void 0 ? "zh_CN" : _useLocale$locale;
|
|
55
56
|
var _timeSpanOption$timeS = timeSpanOption.timeSpanBoundary,
|
|
56
57
|
timeSpanBoundary = _timeSpanOption$timeS === void 0 ? 94608000 : _timeSpanOption$timeS;
|
|
57
58
|
var _menuOption$showCalen = menuOption.showCalendar,
|
|
@@ -181,7 +182,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
181
182
|
style: {
|
|
182
183
|
marginLeft: "4px"
|
|
183
184
|
}
|
|
184
|
-
}, localeObj
|
|
185
|
+
}, formatMessage(localeObj["more"]))), /*#__PURE__*/React.createElement(_Icon, {
|
|
185
186
|
type: "right"
|
|
186
187
|
}))), showCalendar && /*#__PURE__*/React.createElement("div", {
|
|
187
188
|
className: classnames("cw-dropdown-menu-_item"),
|
|
@@ -195,7 +196,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
195
196
|
style: {
|
|
196
197
|
marginLeft: "4px"
|
|
197
198
|
}
|
|
198
|
-
}, localeObj["select-calendar"])), showHistoryList && Boolean(historyList.length) && /*#__PURE__*/React.createElement(_Dropdown, {
|
|
199
|
+
}, formatMessage(localeObj["select-calendar"]))), showHistoryList && Boolean(historyList.length) && /*#__PURE__*/React.createElement(_Dropdown, {
|
|
199
200
|
overlay: /*#__PURE__*/React.createElement(MoreHistoryList, {
|
|
200
201
|
historyList: historyList,
|
|
201
202
|
onClickTag: onClickTag,
|
|
@@ -214,7 +215,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
214
215
|
className: classnames("cw-dropdown-menu-history-wrapper")
|
|
215
216
|
}, /*#__PURE__*/React.createElement("span", {
|
|
216
217
|
className: "cw-dropdown-menu-history-title"
|
|
217
|
-
}, localeObj["history"], ":"), historyList.slice(0, showDefaultHistoryCount).map(function (tag) {
|
|
218
|
+
}, formatMessage(localeObj["history"]), ":"), historyList.slice(0, showDefaultHistoryCount).map(function (tag) {
|
|
218
219
|
return /*#__PURE__*/React.createElement(_Tag, {
|
|
219
220
|
type: "custom_type01",
|
|
220
221
|
closable: true,
|
|
@@ -3,7 +3,7 @@ import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
|
3
3
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
4
4
|
import "@chaoswise/ui/lib/Button/index.less";
|
|
5
5
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
6
|
-
import
|
|
6
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
7
7
|
var _excluded = ["value", "key"];
|
|
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; }
|
|
@@ -24,7 +24,8 @@ import Refresh1Svg from "../assets/Refresh1";
|
|
|
24
24
|
import Refresh2Svg from "../assets/Refresh2";
|
|
25
25
|
import Refresh3Svg from "../assets/Refresh3";
|
|
26
26
|
import { getChangeUnitDate, funcValueChangeArrayValue, getTimeSpanFromValue, computedRecentlyValue, judgeType } from "../utils";
|
|
27
|
-
import
|
|
27
|
+
import langConfig from "../locale";
|
|
28
|
+
import { formatMessage } from "../../utils";
|
|
28
29
|
import "./index.less";
|
|
29
30
|
var Refresh = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
30
31
|
var recordDateValue = props.recordDateValue,
|
|
@@ -51,10 +52,8 @@ var Refresh = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
51
52
|
showRefresh = _refreshOption$showRe === void 0 ? true : _refreshOption$showRe;
|
|
52
53
|
var _timeSpanOption$timeS = timeSpanOption.timeSpanBoundary,
|
|
53
54
|
timeSpanBoundary = _timeSpanOption$timeS === void 0 ? 94608000 : _timeSpanOption$timeS;
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
57
|
-
var localeObj = getLocale(locale);
|
|
55
|
+
var _useLocale = _useLocale2(langConfig),
|
|
56
|
+
localeObj = _useLocale.langObj;
|
|
58
57
|
// 手动刷新
|
|
59
58
|
var onRefresh = function onRefresh() {
|
|
60
59
|
var values = recordDateValue.value;
|
|
@@ -143,12 +142,12 @@ var Refresh = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
143
142
|
return (showRefresh || showAutoRefresh) && /*#__PURE__*/React.createElement(_Button.Group, {
|
|
144
143
|
className: "cw-range-picker-refresh-wrapper"
|
|
145
144
|
}, showRefresh && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
146
|
-
title: localeObj["refresh"]
|
|
145
|
+
title: formatMessage(localeObj["refresh"])
|
|
147
146
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
148
147
|
onClick: onRefresh,
|
|
149
148
|
disabled: isDisabledRefresh
|
|
150
149
|
}, /*#__PURE__*/React.createElement(Refresh1Svg, null))), showAutoRefresh && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
151
|
-
title: localeObj["autoRefresh"]
|
|
150
|
+
title: formatMessage(localeObj["autoRefresh"])
|
|
152
151
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
153
152
|
onClick: onAutoRefresh,
|
|
154
153
|
disabled: isDisabledAutoRefresh,
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
2
2
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
3
|
-
import
|
|
3
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
4
4
|
import "@chaoswise/ui/lib/Button/index.less";
|
|
5
5
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
6
|
-
/*
|
|
7
|
-
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
8
|
-
* @Date: 2022-08-11 18:23:40
|
|
9
|
-
* @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
|
|
10
|
-
* @LastEditTime: 2023-03-28 10:39:35
|
|
11
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/CWRangePicker/TimeSpan/index.js
|
|
12
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
13
|
-
*/
|
|
14
6
|
import React from "react";
|
|
15
7
|
import { getChangeDate } from "../utils";
|
|
16
|
-
import
|
|
8
|
+
import langConfig from "../locale";
|
|
9
|
+
import { formatMessage } from "../../utils";
|
|
17
10
|
import "./index.less";
|
|
18
11
|
_Button.__ANT_BUTTON = true;
|
|
19
12
|
var TimeSpan = function TimeSpan(props) {
|
|
@@ -26,10 +19,8 @@ var TimeSpan = function TimeSpan(props) {
|
|
|
26
19
|
timeSpanOption = props.timeSpanOption,
|
|
27
20
|
isRightDisabled = props.isRightDisabled,
|
|
28
21
|
isDisabledEnlargeBtn = props.isDisabledEnlargeBtn;
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
32
|
-
var localeObj = getLocale(locale);
|
|
22
|
+
var _useLocale = _useLocale2(langConfig),
|
|
23
|
+
localeObj = _useLocale.langObj;
|
|
33
24
|
var _timeSpanOption$showF = timeSpanOption.showForwardBtn,
|
|
34
25
|
showForwardBtn = _timeSpanOption$showF === void 0 ? true : _timeSpanOption$showF,
|
|
35
26
|
_timeSpanOption$showB = timeSpanOption.showBackwardBtn,
|
|
@@ -46,11 +37,13 @@ var TimeSpan = function TimeSpan(props) {
|
|
|
46
37
|
_timeSpanOption$timeS = timeSpanOption.timeSpanBoundary,
|
|
47
38
|
timeSpanBoundary = _timeSpanOption$timeS === void 0 ? 94608000 : _timeSpanOption$timeS;
|
|
48
39
|
var _tooltipTitleCustom$f = tooltipTitleCustom.forwardTitle,
|
|
49
|
-
forwardTitle = _tooltipTitleCustom$f === void 0 ? localeObj["forwardSmooth"] : _tooltipTitleCustom$f,
|
|
40
|
+
forwardTitle = _tooltipTitleCustom$f === void 0 ? formatMessage(localeObj["forwardSmooth"]) : _tooltipTitleCustom$f,
|
|
50
41
|
_tooltipTitleCustom$b = tooltipTitleCustom.backTitle,
|
|
51
|
-
backTitle = _tooltipTitleCustom$b === void 0 ? localeObj["backSmooth"] : _tooltipTitleCustom$b,
|
|
42
|
+
backTitle = _tooltipTitleCustom$b === void 0 ? formatMessage(localeObj["backSmooth"]) : _tooltipTitleCustom$b,
|
|
52
43
|
_tooltipTitleCustom$e = tooltipTitleCustom.expandTitle,
|
|
53
|
-
expandTitle = _tooltipTitleCustom$e === void 0 ? localeObj["ExpandSpan"]
|
|
44
|
+
expandTitle = _tooltipTitleCustom$e === void 0 ? formatMessage(localeObj["ExpandSpan"], {
|
|
45
|
+
span: "".concat(growSize)
|
|
46
|
+
}) : _tooltipTitleCustom$e;
|
|
54
47
|
var onChangeTimeSpan = function onChangeTimeSpan(direction) {
|
|
55
48
|
var _getChangeDate = getChangeDate(recordDateValue, direction, growSize, timeSpanBoundary),
|
|
56
49
|
value = _getChangeDate.value,
|