@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
package/lib/Progress/index.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
2
2
|
import "antd/es/progress/style";
|
|
3
3
|
import _Progress from "antd/es/progress";
|
|
4
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
5
4
|
import _ThemeProvider from "@chaoswise/ui/lib/ThemeProvider";
|
|
6
5
|
var _excluded = ["size", "type", "strokeWidth", "width", "onClickReload"];
|
|
7
6
|
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); }
|
|
8
7
|
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; }
|
|
9
8
|
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; }
|
|
9
|
+
import useIntl from '../useIntl';
|
|
10
10
|
import React, { forwardRef, useMemo, useEffect } from "react";
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
import classnames from "classnames";
|
|
13
|
-
import langConfig from './locale';
|
|
14
|
-
import { formatMessage } from "../utils";
|
|
15
13
|
import "./index.less";
|
|
16
14
|
var CWProgress = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
17
15
|
var _props$size = props.size,
|
|
@@ -26,8 +24,7 @@ var CWProgress = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
26
24
|
// 获取modifyVars注入的主题变量
|
|
27
25
|
var _ThemeProvider$useThe = _ThemeProvider.useThemeSwitcher(),
|
|
28
26
|
themeVars = _ThemeProvider$useThe.themeVars;
|
|
29
|
-
var
|
|
30
|
-
localeObj = _useLocale.langObj;
|
|
27
|
+
var intl = useIntl();
|
|
31
28
|
var strokeWidth_ = useMemo(function () {
|
|
32
29
|
if (strokeWidth) return strokeWidth;
|
|
33
30
|
if (size == "large") {
|
|
@@ -47,7 +44,7 @@ var CWProgress = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
47
44
|
strokeWidth: strokeWidth_,
|
|
48
45
|
strokeColor: (_rest$strokeColor = rest.strokeColor) !== null && _rest$strokeColor !== void 0 ? _rest$strokeColor : "".concat(themeVars["primary-color"]),
|
|
49
46
|
format: rest.format ? rest.format : function () {
|
|
50
|
-
return
|
|
47
|
+
return intl.get("5a790c89-5326-4316-8d12-32601e1c7bdf").d("进行中...");
|
|
51
48
|
},
|
|
52
49
|
percent: 40,
|
|
53
50
|
showInfo: (_rest$showInfo = rest.showInfo) !== null && _rest$showInfo !== void 0 ? _rest$showInfo : true,
|
|
@@ -2,7 +2,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
3
3
|
import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
4
4
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
5
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
6
5
|
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); }
|
|
7
6
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
@@ -13,13 +12,12 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
13
12
|
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; }
|
|
14
13
|
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; } }
|
|
15
14
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
15
|
+
import useIntl from '../useIntl';
|
|
16
16
|
import React, { Fragment, useRef } from "react";
|
|
17
17
|
import { useDrag, useDrop } from "react-dnd";
|
|
18
18
|
import classnames from "classnames";
|
|
19
19
|
import LockSvg from "./assets/LockSvg";
|
|
20
20
|
import DragSvg from "./assets/DragSvg";
|
|
21
|
-
import langConfig from "./locale";
|
|
22
|
-
import { formatMessage } from "../utils";
|
|
23
21
|
var DragList = function DragList(_ref) {
|
|
24
22
|
var index = _ref.index,
|
|
25
23
|
listItem = _ref.listItem,
|
|
@@ -34,8 +32,7 @@ var DragList = function DragList(_ref) {
|
|
|
34
32
|
var title = listItem.title,
|
|
35
33
|
disabled = listItem.disabled;
|
|
36
34
|
// 获取当前语言
|
|
37
|
-
var
|
|
38
|
-
localeObj = _useLocale.langObj;
|
|
35
|
+
var intl = useIntl();
|
|
39
36
|
var dragRef = useRef(null);
|
|
40
37
|
var _useDrag = useDrag({
|
|
41
38
|
item: {
|
|
@@ -94,7 +91,7 @@ var DragList = function DragList(_ref) {
|
|
|
94
91
|
var renderPrefixIcon = /*#__PURE__*/React.createElement("div", {
|
|
95
92
|
className: "cw-transfer-right-content-item-prefix-icon-wrapper"
|
|
96
93
|
}, disabled ? /*#__PURE__*/React.createElement(LockSvg, null) : /*#__PURE__*/React.createElement(_Tooltip, {
|
|
97
|
-
title:
|
|
94
|
+
title: intl.get("d3158ace-0470-41b5-9f04-0dd8db0137c3").d("拖拽移动")
|
|
98
95
|
}, /*#__PURE__*/React.createElement(DragSvg, null)));
|
|
99
96
|
var renderItemContent = /*#__PURE__*/React.createElement("div", {
|
|
100
97
|
className: "cw-transfer-right-content-item"
|
|
@@ -7,7 +7,6 @@ import "@chaoswise/ui/lib/CWTable/index.less";
|
|
|
7
7
|
import _CWTable from "@chaoswise/ui/lib/CWTable";
|
|
8
8
|
import "@chaoswise/ui/lib/Checkbox/index.less";
|
|
9
9
|
import _Checkbox from "@chaoswise/ui/lib/Checkbox";
|
|
10
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
11
10
|
import "@chaoswise/ui/lib/TooltipText/index.less";
|
|
12
11
|
import _TooltipText from "@chaoswise/ui/lib/TooltipText";
|
|
13
12
|
import "@chaoswise/ui/lib/Input/index.less";
|
|
@@ -36,6 +35,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
36
35
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
37
36
|
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; }
|
|
38
37
|
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; }
|
|
38
|
+
import useIntl from '../useIntl';
|
|
39
39
|
import React, { useState, useEffect, Fragment, forwardRef, useMemo, useCallback } from "react";
|
|
40
40
|
import { filterTreeByName, filterTree, filterTreeByNameTable, filterObj, getNotSelectKeys, getKeysAndTitle, getBottomKey, renderLeafNodetree, renderRelationNode, createTitle } from "./utils";
|
|
41
41
|
import classnames from "classnames";
|
|
@@ -45,8 +45,6 @@ import "./index.less";
|
|
|
45
45
|
import { isEqual } from "lodash-es";
|
|
46
46
|
import NoDrag from "./NoDrag";
|
|
47
47
|
import { createTree } from "../CWTree/utils";
|
|
48
|
-
import langConfig from './locale';
|
|
49
|
-
import { formatMessage } from "../utils";
|
|
50
48
|
var Search = _Input.Search;
|
|
51
49
|
|
|
52
50
|
/**
|
|
@@ -194,8 +192,7 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
194
192
|
saveSearchValueRight = _useState14[0],
|
|
195
193
|
setSaveSearchValueRight = _useState14[1];
|
|
196
194
|
// 获取当前语言
|
|
197
|
-
var
|
|
198
|
-
localeObj = _useLocale.langObj;
|
|
195
|
+
var intl = useIntl();
|
|
199
196
|
//表格情况下右侧列表渲染的列
|
|
200
197
|
var newRenderColumns = [];
|
|
201
198
|
var newSearchColumns = [];
|
|
@@ -640,7 +637,7 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
640
637
|
setCheckedKeys(newCheckedKeys);
|
|
641
638
|
setListCheckedStyle(listCheckedKeys_, data);
|
|
642
639
|
};
|
|
643
|
-
var allSelectedText = "".concat(
|
|
640
|
+
var allSelectedText = "".concat(intl.get("3991a1d0-65a8-45ca-94a4-f89fbd9f8555").d("全选"), "\uFF08").concat(listCheckedKeys.length, "\uFF09");
|
|
644
641
|
// 根据不同的type渲染不同的列表类型,目前支持list tree table
|
|
645
642
|
|
|
646
643
|
var getFinalTitle = function getFinalTitle(title) {
|
|
@@ -708,7 +705,7 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
708
705
|
};
|
|
709
706
|
// todo - react-dnd:DndProvider的问题拖拽和非拖拽需要分开写
|
|
710
707
|
var renderRightList = searchCheckedValue.length === 0 ? /*#__PURE__*/React.createElement(_Empty, {
|
|
711
|
-
description:
|
|
708
|
+
description: intl.get("6c4b6d6c-f6a5-4f91-bd15-309fe52b0de1").d("请从左侧列表选择")
|
|
712
709
|
}) : dragList ? /*#__PURE__*/React.createElement(Drag, {
|
|
713
710
|
checkValue: searchCheckedValue,
|
|
714
711
|
handleDelete: handleDelete,
|
|
@@ -771,14 +768,14 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
771
768
|
})
|
|
772
769
|
}, typeof rightHeader === "boolean" ? /*#__PURE__*/React.createElement("div", {
|
|
773
770
|
className: "cw-transfer-right-header-top"
|
|
774
|
-
}, /*#__PURE__*/React.createElement("span", null,
|
|
771
|
+
}, /*#__PURE__*/React.createElement("span", null, intl.get("0a23534a-4af3-438f-9b54-748ae0d5f27c").d("已添加"), /*#__PURE__*/React.createElement("span", {
|
|
775
772
|
style: {
|
|
776
773
|
marginLeft: "8px"
|
|
777
774
|
}
|
|
778
775
|
}, "(", searchCheckedValue.length, ")")), Boolean(searchCheckedValue.length) && /*#__PURE__*/React.createElement("span", {
|
|
779
776
|
onClick: clearAll,
|
|
780
777
|
className: "cw-transfer-right-header-clear"
|
|
781
|
-
},
|
|
778
|
+
}, intl.get("53e957d9-8aee-4322-a144-31d4cff11c9f").d("清空"))) : /*#__PURE__*/React.createElement(Fragment, null, rightHeader)), /*#__PURE__*/React.createElement("div", {
|
|
782
779
|
className: "cw-transfer-right-main-wrapper"
|
|
783
780
|
}, renderRightList)), rightFooter && /*#__PURE__*/React.createElement("div", {
|
|
784
781
|
className: "cw-transfer-footer"
|
|
@@ -1,20 +1,18 @@
|
|
|
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
1
|
import "@chaoswise/ui/lib/Button/index.less";
|
|
3
2
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
4
3
|
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
5
4
|
import "antd/es/time-picker/style";
|
|
6
5
|
import _TimePicker from "antd/es/time-picker";
|
|
7
|
-
|
|
6
|
+
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); }
|
|
8
7
|
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); }
|
|
9
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
10
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
12
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
import useIntl from '../../useIntl';
|
|
14
14
|
import React from "react";
|
|
15
15
|
import classnames from "classnames";
|
|
16
|
-
import langConfig from "../locale";
|
|
17
|
-
import { formatMessage } from "../../utils";
|
|
18
16
|
export default function ExtraTimeFooter(_ref) {
|
|
19
17
|
var startTimeValue = _ref.startTimeValue,
|
|
20
18
|
endTimeValue = _ref.endTimeValue,
|
|
@@ -26,8 +24,7 @@ export default function ExtraTimeFooter(_ref) {
|
|
|
26
24
|
onOk = _ref.onOk,
|
|
27
25
|
getPopupContainer = _ref.getPopupContainer,
|
|
28
26
|
disabledConfirm = _ref.disabledConfirm;
|
|
29
|
-
var
|
|
30
|
-
localeObj = _useLocale.langObj;
|
|
27
|
+
var intl = useIntl();
|
|
31
28
|
var res = typeof showTime == "boolean" ? {} : _objectSpread({}, showTime);
|
|
32
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
33
30
|
className: classnames("cw-rangePicker-time-wrapper", {
|
|
@@ -64,5 +61,5 @@ export default function ExtraTimeFooter(_ref) {
|
|
|
64
61
|
type: "primary",
|
|
65
62
|
disabled: disabledConfirm,
|
|
66
63
|
onClick: onOk
|
|
67
|
-
},
|
|
64
|
+
}, intl.get("4253417c-d699-4eed-8c75-34d2a8b18a68").d("确定")));
|
|
68
65
|
}
|
package/lib/SearchBar/index.js
CHANGED
|
@@ -12,7 +12,6 @@ import _Icon from "@chaoswise/ui/lib/Icon";
|
|
|
12
12
|
import "@chaoswise/ui/lib/Button/index.less";
|
|
13
13
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
14
14
|
import _Menu from "@chaoswise/ui/lib/Menu";
|
|
15
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
16
15
|
var _excluded = ["showTooltipIcon"];
|
|
17
16
|
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); }
|
|
18
17
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
@@ -32,12 +31,11 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
32
31
|
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; }
|
|
33
32
|
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; } }
|
|
34
33
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
34
|
+
import useIntl from '../useIntl';
|
|
35
35
|
import React, { useState, useEffect, Fragment, useMemo, useRef } from "react";
|
|
36
36
|
import classnames from "classnames";
|
|
37
37
|
import PropTypes from "prop-types";
|
|
38
38
|
import OutSearch from "./OutSearch";
|
|
39
|
-
import langConfig from './locale';
|
|
40
|
-
import { formatMessage } from "../utils";
|
|
41
39
|
import "./index.less";
|
|
42
40
|
|
|
43
41
|
/**
|
|
@@ -153,8 +151,7 @@ var SearchBar = function SearchBar(props) {
|
|
|
153
151
|
var getFieldDecorator = form.getFieldDecorator,
|
|
154
152
|
resetFields = form.resetFields,
|
|
155
153
|
getFieldsValue = form.getFieldsValue;
|
|
156
|
-
var
|
|
157
|
-
localeObj = _useLocale.langObj;
|
|
154
|
+
var intl = useIntl();
|
|
158
155
|
var domRef = useRef(null);
|
|
159
156
|
|
|
160
157
|
//传入的搜索框
|
|
@@ -350,11 +347,11 @@ var SearchBar = function SearchBar(props) {
|
|
|
350
347
|
type: "primary",
|
|
351
348
|
onClick: handleSearch,
|
|
352
349
|
className: "cw-search-expand-search-search"
|
|
353
|
-
}, searchButtonProps), searchTitle ? searchTitle :
|
|
350
|
+
}, searchButtonProps), searchTitle ? searchTitle : intl.get("0d2fd4ff-51eb-4c95-a52d-a78585336915").d("查询")), /*#__PURE__*/React.createElement(_Button, _extends({
|
|
354
351
|
type: "default",
|
|
355
352
|
onClick: handleReset,
|
|
356
353
|
className: "cw-search-expand-search-reset"
|
|
357
|
-
}, resetButtonProps), resetTitle ? resetTitle :
|
|
354
|
+
}, resetButtonProps), resetTitle ? resetTitle : intl.get("7dd09e88-61ac-45fe-8355-168dede5909c").d("重置")), /*#__PURE__*/React.createElement("div", {
|
|
358
355
|
className: "cw-search-expand-icon-wrapper",
|
|
359
356
|
onClick: handleExpandSearch
|
|
360
357
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
@@ -416,7 +413,7 @@ var SearchBar = function SearchBar(props) {
|
|
|
416
413
|
}), showAdvancedSearch ? /*#__PURE__*/React.createElement("div", {
|
|
417
414
|
className: "cw-search-advanced",
|
|
418
415
|
onClick: handleExpandSearch
|
|
419
|
-
}, /*#__PURE__*/React.createElement("span", null, advancedSearchTitle ? advancedSearchTitle :
|
|
416
|
+
}, /*#__PURE__*/React.createElement("span", null, advancedSearchTitle ? advancedSearchTitle : intl.get("b1db2936-33f9-410b-aba2-997c57d40e7a").d("高级筛选")), /*#__PURE__*/React.createElement(_Icon, {
|
|
420
417
|
className: "cw-search-advanced-icon",
|
|
421
418
|
type: expandSearch ? "up" : "down"
|
|
422
419
|
})) : null), /*#__PURE__*/React.createElement(_Row, {
|
|
@@ -540,7 +537,7 @@ var SearchBar = function SearchBar(props) {
|
|
|
540
537
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
541
538
|
icon: "plus",
|
|
542
539
|
type: "link"
|
|
543
|
-
},
|
|
540
|
+
}, intl.get("d9da8b9f-a96a-46f5-baf0-7f2bb0d6d526").d("添加筛选条件")), /*#__PURE__*/React.createElement(_Tooltip, tipTooltipOptionRest, showTooltipIcon && /*#__PURE__*/React.createElement("div", {
|
|
544
541
|
className: "cw-search-bar-filter-title-icon-wrapper"
|
|
545
542
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
546
543
|
type: "question-circle",
|
package/lib/SimpleCard/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import "antd/es/card/style";
|
|
|
2
2
|
import _Card from "antd/es/card";
|
|
3
3
|
import "antd/es/icon/style";
|
|
4
4
|
import _Icon from "antd/es/icon";
|
|
5
|
+
import _useIntl from "@chaoswise/ui/lib/useIntl";
|
|
5
6
|
var _excluded = ["iconBackgroundColor", "icon", "title", "statisticsData", "className", "noNum", "data"],
|
|
6
7
|
_excluded2 = ["type", "con", "unit"];
|
|
7
8
|
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); }
|
|
@@ -24,6 +25,7 @@ function SimpleCard(_ref) {
|
|
|
24
25
|
noNum = _ref.noNum,
|
|
25
26
|
data = _ref.data,
|
|
26
27
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
var intl = _useIntl();
|
|
27
29
|
function renderData(statisticsData) {
|
|
28
30
|
return statisticsData.map(function (item, index) {
|
|
29
31
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -79,7 +81,7 @@ function SimpleCard(_ref) {
|
|
|
79
81
|
className: "cw-simple-card-right"
|
|
80
82
|
}, /*#__PURE__*/React.createElement("p", {
|
|
81
83
|
className: "cw-simple-card-title"
|
|
82
|
-
}, title ? title :
|
|
84
|
+
}, title ? title : intl.get("07232570-6be2-4c38-8ce3-d6e8beb13961").d("标题文字")), /*#__PURE__*/React.createElement("div", {
|
|
83
85
|
className: "cw-simple-card-content"
|
|
84
86
|
}, statisticsData ? renderData(statisticsData) : renderNewData(data))));
|
|
85
87
|
}
|
package/lib/SingleSpa/index.js
CHANGED
|
@@ -2,6 +2,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
import _Skeleton from "@chaoswise/ui/lib/Skeleton";
|
|
3
3
|
import "@chaoswise/ui/lib/Exception/index.less";
|
|
4
4
|
import _Exception from "@chaoswise/ui/lib/Exception";
|
|
5
|
+
import _useIntl from "@chaoswise/ui/lib/useIntl";
|
|
5
6
|
var _excluded = ["apps", "props", "routerPrefix", "style", "routerType"];
|
|
6
7
|
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); }
|
|
7
8
|
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; }
|
|
@@ -38,6 +39,10 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
38
39
|
_ref$routerType = _ref.routerType,
|
|
39
40
|
routerType = _ref$routerType === void 0 ? "hash" : _ref$routerType,
|
|
40
41
|
res = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
+
var intl = _useIntl();
|
|
43
|
+
// Registered application loaders outlive the render that created them.
|
|
44
|
+
var intlRef = useRef(intl);
|
|
45
|
+
intlRef.current = intl;
|
|
41
46
|
var container = useRef();
|
|
42
47
|
var model = useModel();
|
|
43
48
|
var currentAppId = model.currentAppId;
|
|
@@ -66,7 +71,7 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
66
71
|
}
|
|
67
72
|
// 注册微应用
|
|
68
73
|
registerApplication(project.id, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
69
|
-
var indexInfo, style, script, _res, _t;
|
|
74
|
+
var indexInfo, style, script, _intl, _res, _t;
|
|
70
75
|
return _regenerator().w(function (_context) {
|
|
71
76
|
while (1) switch (_context.p = _context.n) {
|
|
72
77
|
case 0:
|
|
@@ -84,7 +89,8 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
84
89
|
_context.n = 2;
|
|
85
90
|
break;
|
|
86
91
|
}
|
|
87
|
-
|
|
92
|
+
_intl = intlRef.current;
|
|
93
|
+
return _context.a(2, Promise.reject(_intl.get("eb2ef811-bd15-4dd7-b003-45ee51ae4388").d("未检索到子应用相关脚本")));
|
|
88
94
|
case 2:
|
|
89
95
|
// 注入样式文件
|
|
90
96
|
if (style.length) {
|
|
@@ -102,9 +108,9 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
102
108
|
unloadApplication(project.id, {
|
|
103
109
|
waitForUnmount: true
|
|
104
110
|
}).then(function () {
|
|
105
|
-
console.log("===\u5378\u8F7D\u5B50\u5E94\u7528".concat(project.id, "\u6837\u5F0F===="));
|
|
111
|
+
console.log("===\u5378\u8F7D\u5B50\u5E94\u7528".concat(project.id, "\u6837\u5F0F====")); // cw-i18n-disable-line
|
|
106
112
|
removeStyleAndScript(project.entry, script);
|
|
107
|
-
console.log('===卸载成功====');
|
|
113
|
+
console.log('===卸载成功===='); // cw-i18n-disable-line
|
|
108
114
|
});
|
|
109
115
|
return Promise.resolve();
|
|
110
116
|
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import "antd/es/button/style";
|
|
2
2
|
import _Button from "antd/es/button";
|
|
3
|
+
import _useIntl from "@chaoswise/ui/lib/useIntl";
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { useThemeSwitcher } from './main';
|
|
5
6
|
function Switcher(_ref) {
|
|
6
7
|
var render = _ref.render;
|
|
8
|
+
var intl = _useIntl();
|
|
7
9
|
var _useThemeSwitcher = useThemeSwitcher(),
|
|
8
10
|
switcher = _useThemeSwitcher.switcher,
|
|
9
11
|
currentTheme = _useThemeSwitcher.currentTheme;
|
|
@@ -21,6 +23,6 @@ function Switcher(_ref) {
|
|
|
21
23
|
}
|
|
22
24
|
return /*#__PURE__*/React.createElement(_Button, {
|
|
23
25
|
onClick: toggleDarkMode
|
|
24
|
-
}, "
|
|
26
|
+
}, intl.get("a01ba4ad-2510-4a13-98d2-137b81204a9c").d("主题切换"));
|
|
25
27
|
}
|
|
26
28
|
export default Switcher;
|
|
@@ -3,7 +3,6 @@ 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 _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
7
6
|
var _excluded = ["value", "key"];
|
|
8
7
|
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; }
|
|
9
8
|
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; }
|
|
@@ -18,14 +17,13 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
18
17
|
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; }
|
|
19
18
|
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; } }
|
|
20
19
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
20
|
+
import useIntl from '../../useIntl';
|
|
21
21
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
22
22
|
import classnames from "classnames";
|
|
23
23
|
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 langConfig from "../locale";
|
|
28
|
-
import { formatMessage } from "../../utils";
|
|
29
27
|
import "./index.less";
|
|
30
28
|
var Refresh = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
31
29
|
var recordDateValue = props.recordDateValue,
|
|
@@ -52,8 +50,7 @@ var Refresh = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
52
50
|
showRefresh = _refreshOption$showRe === void 0 ? true : _refreshOption$showRe;
|
|
53
51
|
var _timeSpanOption$timeS = timeSpanOption.timeSpanBoundary,
|
|
54
52
|
timeSpanBoundary = _timeSpanOption$timeS === void 0 ? 94608000 : _timeSpanOption$timeS;
|
|
55
|
-
var
|
|
56
|
-
localeObj = _useLocale.langObj;
|
|
53
|
+
var intl = useIntl();
|
|
57
54
|
// 手动刷新
|
|
58
55
|
var onRefresh = function onRefresh() {
|
|
59
56
|
var values = recordDateValue.value;
|
|
@@ -142,12 +139,12 @@ var Refresh = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
142
139
|
return (showRefresh || showAutoRefresh) && /*#__PURE__*/React.createElement(_Button.Group, {
|
|
143
140
|
className: "cw-range-picker-refresh-wrapper"
|
|
144
141
|
}, showRefresh && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
145
|
-
title:
|
|
142
|
+
title: intl.get("1d0f3c0c-188f-4f83-bff0-2792dffcdc2d").d("刷新")
|
|
146
143
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
147
144
|
onClick: onRefresh,
|
|
148
145
|
disabled: isDisabledRefresh
|
|
149
146
|
}, /*#__PURE__*/React.createElement(Refresh1Svg, null))), showAutoRefresh && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
150
|
-
title:
|
|
147
|
+
title: intl.get("502d0d23-e942-4ecd-89e4-e85431a3098f").d("自动刷新")
|
|
151
148
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
152
149
|
onClick: onAutoRefresh,
|
|
153
150
|
disabled: isDisabledAutoRefresh,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
2
2
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
3
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
4
3
|
import "@chaoswise/ui/lib/Button/index.less";
|
|
5
4
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
5
|
+
import useIntl from '../../useIntl';
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { getChangeDate } from "../utils";
|
|
8
|
-
import langConfig from "../locale";
|
|
9
|
-
import { formatMessage } from "../../utils";
|
|
10
8
|
import "./index.less";
|
|
11
9
|
_Button.__ANT_BUTTON = true;
|
|
12
10
|
var TimeSpan = function TimeSpan(props) {
|
|
@@ -19,8 +17,7 @@ var TimeSpan = function TimeSpan(props) {
|
|
|
19
17
|
timeSpanOption = props.timeSpanOption,
|
|
20
18
|
isRightDisabled = props.isRightDisabled,
|
|
21
19
|
isDisabledEnlargeBtn = props.isDisabledEnlargeBtn;
|
|
22
|
-
var
|
|
23
|
-
localeObj = _useLocale.langObj;
|
|
20
|
+
var intl = useIntl();
|
|
24
21
|
var _timeSpanOption$showF = timeSpanOption.showForwardBtn,
|
|
25
22
|
showForwardBtn = _timeSpanOption$showF === void 0 ? true : _timeSpanOption$showF,
|
|
26
23
|
_timeSpanOption$showB = timeSpanOption.showBackwardBtn,
|
|
@@ -37,13 +34,13 @@ var TimeSpan = function TimeSpan(props) {
|
|
|
37
34
|
_timeSpanOption$timeS = timeSpanOption.timeSpanBoundary,
|
|
38
35
|
timeSpanBoundary = _timeSpanOption$timeS === void 0 ? 94608000 : _timeSpanOption$timeS;
|
|
39
36
|
var _tooltipTitleCustom$f = tooltipTitleCustom.forwardTitle,
|
|
40
|
-
forwardTitle = _tooltipTitleCustom$f === void 0 ?
|
|
37
|
+
forwardTitle = _tooltipTitleCustom$f === void 0 ? intl.get("df9a3bfb-00df-44cd-9761-87dc21ffc0e8").d("向前平滑") : _tooltipTitleCustom$f,
|
|
41
38
|
_tooltipTitleCustom$b = tooltipTitleCustom.backTitle,
|
|
42
|
-
backTitle = _tooltipTitleCustom$b === void 0 ?
|
|
39
|
+
backTitle = _tooltipTitleCustom$b === void 0 ? intl.get("cefeccff-2f9e-4b59-925c-af11c28aa8ed").d("向后平滑") : _tooltipTitleCustom$b,
|
|
43
40
|
_tooltipTitleCustom$e = tooltipTitleCustom.expandTitle,
|
|
44
|
-
expandTitle = _tooltipTitleCustom$e === void 0 ?
|
|
41
|
+
expandTitle = _tooltipTitleCustom$e === void 0 ? intl.get("56a89179-5086-4c43-8814-06eac1ba9983", {
|
|
45
42
|
span: "".concat(growSize)
|
|
46
|
-
}) : _tooltipTitleCustom$e;
|
|
43
|
+
}).d("按{span}倍增加时间跨度") : _tooltipTitleCustom$e;
|
|
47
44
|
var onChangeTimeSpan = function onChangeTimeSpan(direction) {
|
|
48
45
|
var _getChangeDate = getChangeDate(recordDateValue, direction, growSize, timeSpanBoundary),
|
|
49
46
|
value = _getChangeDate.value,
|
|
@@ -5,7 +5,6 @@ import _Input from "@chaoswise/ui/lib/Input";
|
|
|
5
5
|
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
6
6
|
import "@chaoswise/ui/lib/message/index.less";
|
|
7
7
|
import _message from "@chaoswise/ui/lib/message";
|
|
8
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
9
8
|
var _excluded = ["timeDomain", "number", "unit", "isRecently", "value"],
|
|
10
9
|
_excluded2 = ["value", "timeDomain", "number", "unit", "isRecently"];
|
|
11
10
|
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); }
|
|
@@ -22,6 +21,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
22
21
|
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; }
|
|
23
22
|
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; } }
|
|
24
23
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
24
|
+
import useIntl from '../useIntl';
|
|
25
|
+
import useConfigLocale from '../ConfigProvider/useLocale';
|
|
25
26
|
import React, { forwardRef, useState, useEffect, useMemo, useRef, useImperativeHandle } from "react";
|
|
26
27
|
import PropTypes from "prop-types";
|
|
27
28
|
import classnames from "classnames";
|
|
@@ -30,8 +31,6 @@ import TimeRangeSliderCmp from "./TimeRangeSliderCmp";
|
|
|
30
31
|
import Refresh from "./Refresh";
|
|
31
32
|
import CalendarSvg from "./assets/Calendar";
|
|
32
33
|
import { echoInputValue, getUnit, judgeType, getChangeUnitDate, isInvalidDate, funcValueChangeArrayValue, getCorrectValue, getFinalDateOption, getTruthDateCount, isLessThanMinTimeSpan, isExceedMaxTimeSpan, isWithinTimeSpan, getYears, computedRecentlyValue } from "./utils";
|
|
33
|
-
import langConfig from "./locale";
|
|
34
|
-
import { formatMessage } from "../utils";
|
|
35
34
|
import "./index.less";
|
|
36
35
|
var TimeRangeSlider = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
37
36
|
var defaultValue = props.defaultValue,
|
|
@@ -51,10 +50,10 @@ var TimeRangeSlider = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
51
50
|
forceRenderTitle = props.forceRenderTitle,
|
|
52
51
|
_props$timeSliderOpti = props.timeSliderOption,
|
|
53
52
|
timeSliderOption = _props$timeSliderOpti === void 0 ? {} : _props$timeSliderOpti;
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
locale =
|
|
53
|
+
var intl = useIntl();
|
|
54
|
+
var _useConfigLocale = useConfigLocale(),
|
|
55
|
+
_useConfigLocale$loca = _useConfigLocale.locale,
|
|
56
|
+
locale = _useConfigLocale$loca === void 0 ? "zh_CN" : _useConfigLocale$loca;
|
|
58
57
|
var _refreshOption$onAuto = refreshOption.onAutoRefresh,
|
|
59
58
|
onAutoRefresh = _refreshOption$onAuto === void 0 ? function () {} : _refreshOption$onAuto,
|
|
60
59
|
_refreshOption$onAuto2 = refreshOption.onAutoRefreshChange,
|
|
@@ -92,6 +91,7 @@ var TimeRangeSlider = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
92
91
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
93
92
|
recordDateValue = _useState8[0],
|
|
94
93
|
setRecordDateValue = _useState8[1];
|
|
94
|
+
var inputSourceRef = useRef(recordDateValue);
|
|
95
95
|
// 自动刷新状态是否开启
|
|
96
96
|
var _useState9 = useState(false),
|
|
97
97
|
_useState0 = _slicedToArray(_useState9, 2),
|
|
@@ -163,8 +163,12 @@ var TimeRangeSlider = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
163
163
|
}, [openAutoRefresh, isAutoRefresh]);
|
|
164
164
|
// 输入框回显
|
|
165
165
|
useEffect(function () {
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
var sourceChanged = inputSourceRef.current !== recordDateValue;
|
|
167
|
+
inputSourceRef.current = recordDateValue;
|
|
168
|
+
if (sourceChanged) isInputRef.current = false;
|
|
169
|
+
if (isFocus && isInputRef.current && !sourceChanged) return;
|
|
170
|
+
setInputValue(echoInputValue(recordDateValue, isFocus, locale, format, forceRenderTitle, enableAutoRefresh, timeSpanBoundary, intl));
|
|
171
|
+
}, [recordDateValue, isFocus, locale, format, forceRenderTitle, enableAutoRefresh, timeSpanBoundary, intl]);
|
|
168
172
|
useEffect(function () {
|
|
169
173
|
var _judgeType3 = judgeType(recordDateValue),
|
|
170
174
|
_judgeType4 = _slicedToArray(_judgeType3, 1),
|
|
@@ -379,18 +383,18 @@ var TimeRangeSlider = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
379
383
|
}, inputValue);
|
|
380
384
|
var isInvalidDate_ = isInvalidDate(returnValue.value);
|
|
381
385
|
if (!isInvalidDate_) {
|
|
382
|
-
//
|
|
386
|
+
// Input format validation succeeded.
|
|
383
387
|
var passValue = returnValue.value;
|
|
384
388
|
if (isLessThanMinTimeSpan(passValue, timeSpanBoundaryStart)) {
|
|
385
|
-
_message.error(
|
|
389
|
+
_message.error(intl.get("e598e58b-604f-4d98-bf6b-5f7813a33fa5").d("小于限制的最小时间跨度,请重新输入"));
|
|
386
390
|
return;
|
|
387
391
|
}
|
|
388
392
|
if (isExceedMaxTimeSpan(passValue, timeSpanBoundary)) {
|
|
389
|
-
_message.error(
|
|
393
|
+
_message.error(intl.get("e8a046c4-4611-47b9-bef0-cb46de7dd733").d("超过了限制的最大时间跨度,请重新输入"));
|
|
390
394
|
return;
|
|
391
395
|
}
|
|
392
396
|
if (!isWithinTimeSpan(passValue, days)) {
|
|
393
|
-
_message.error(
|
|
397
|
+
_message.error(intl.get("af0592fb-8027-4bd3-afb2-48956cf829fa").d("不在要求的时间跨度之内,请重新输入"));
|
|
394
398
|
return;
|
|
395
399
|
}
|
|
396
400
|
_onChange(returnValue);
|
|
@@ -399,7 +403,7 @@ var TimeRangeSlider = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
399
403
|
setRecordDateValue(returnValue);
|
|
400
404
|
}
|
|
401
405
|
} else {
|
|
402
|
-
_message.error(
|
|
406
|
+
_message.error(intl.get("e2008629-6fc2-4222-b28c-ada43aa79a74").d("不符合输入格式,请重新输入"));
|
|
403
407
|
}
|
|
404
408
|
} else {
|
|
405
409
|
var finalDateOption = getFinalDateOption(inputValue);
|
|
@@ -411,15 +415,15 @@ var TimeRangeSlider = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
411
415
|
});
|
|
412
416
|
var _passValue = _returnValue.value;
|
|
413
417
|
if (isLessThanMinTimeSpan(_passValue, timeSpanBoundaryStart)) {
|
|
414
|
-
_message.error(
|
|
418
|
+
_message.error(intl.get("e598e58b-604f-4d98-bf6b-5f7813a33fa5").d("小于限制的最小时间跨度,请重新输入"));
|
|
415
419
|
return;
|
|
416
420
|
}
|
|
417
421
|
if (isExceedMaxTimeSpan(_passValue, timeSpanBoundary)) {
|
|
418
|
-
_message.error(
|
|
422
|
+
_message.error(intl.get("e8a046c4-4611-47b9-bef0-cb46de7dd733").d("超过了限制的最大时间跨度,请重新输入"));
|
|
419
423
|
return;
|
|
420
424
|
}
|
|
421
425
|
if (!isWithinTimeSpan(_passValue, days)) {
|
|
422
|
-
_message.error(
|
|
426
|
+
_message.error(intl.get("af0592fb-8027-4bd3-afb2-48956cf829fa").d("不在要求的时间跨度之内,请重新输入"));
|
|
423
427
|
return;
|
|
424
428
|
}
|
|
425
429
|
_onChange(_returnValue);
|
|
@@ -428,7 +432,7 @@ var TimeRangeSlider = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
428
432
|
setRecordDateValue(_returnValue);
|
|
429
433
|
}
|
|
430
434
|
} else {
|
|
431
|
-
_message.error(
|
|
435
|
+
_message.error(intl.get("e2008629-6fc2-4222-b28c-ada43aa79a74").d("不符合输入格式,请重新输入"));
|
|
432
436
|
}
|
|
433
437
|
}
|
|
434
438
|
isInputRef.current = false;
|