@chaoswise/ui 2.7.11 → 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/Antd4/comment/index.js +1 -1
- package/lib/Antd4Form/FormItem.js +1 -1
- package/lib/BasicLayout/Nav.js +3 -5
- package/lib/BasicLayout/index.js +9 -10
- package/lib/CWCascader/rc-cascader/OptionList/Column.js +17 -18
- package/lib/CWMessage/MessageContent/TabList/index.js +19 -17
- package/lib/CWMessage/MessageContent/index.js +86 -73
- package/lib/CWMessage/index.js +62 -50
- 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 +39 -32
- package/lib/CWRangePicker/utils/index.js +45 -114
- package/lib/CWSelect/index.js +7 -10
- package/lib/CWTable/CWTable.js +23 -23
- 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/RangeDateTimePicker.js +3 -3
- 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 +12 -13
- 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 +22 -25
- package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +38 -39
- package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +22 -23
- package/lib/Pagination/index.js +14 -14
- package/lib/PolymerizationSearch/DropdownMenu.js +4 -2
- package/lib/PolymerizationSearch/index.js +7 -7
- package/lib/Progress/index.js +3 -6
- package/lib/QuickTransfer/DragList.js +3 -6
- package/lib/QuickTransfer/index.js +19 -22
- package/lib/RangePicker/components/ExtraTimeFooter.js +4 -7
- package/lib/SearchBar/OutSearch.js +9 -2
- package/lib/SearchBar/index.js +13 -16
- package/lib/SimpleCard/index.js +3 -1
- package/lib/SingleSpa/index.js +30 -26
- package/lib/ThemeProvider/Switcher.js +3 -1
- package/lib/TimeRangeSlider/Refresh/index.js +4 -7
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useMouse.js +3 -3
- package/lib/TimeRangeSlider/TimeSpan/index.js +6 -9
- package/lib/TimeRangeSlider/index.js +28 -24
- package/lib/TimeRangeSlider/utils/index.js +20 -100
- package/lib/TimeZoneSelect/index.js +21 -22
- 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 +14 -3
- 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/Card/index.less +0 -10
- 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/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/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
|
@@ -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
|
}
|
|
@@ -19,6 +19,7 @@ function OutSearch(_ref) {
|
|
|
19
19
|
var getFieldDecorator = form.getFieldDecorator,
|
|
20
20
|
getFieldsValue = form.getFieldsValue,
|
|
21
21
|
resetFields = form.resetFields;
|
|
22
|
+
var prevFilterSignatureRef = useRef(null);
|
|
22
23
|
//获取外线筛选条件的form方法
|
|
23
24
|
useEffect(function () {
|
|
24
25
|
getOutOperation({
|
|
@@ -52,9 +53,15 @@ function OutSearch(_ref) {
|
|
|
52
53
|
}), innerForm);
|
|
53
54
|
setFilterOption(outFilterOption.concat(innerFilterOption));
|
|
54
55
|
//默认显示的搜索框,默认全部显示
|
|
55
|
-
|
|
56
|
+
//仅当可选条件集合或默认勾选变化时才重置勾选,避免父组件render产生新searchContent引用(或拖拽换序)导致用户勾选被重置
|
|
57
|
+
var allIds = outFilterOption.concat(innerFilterOption).map(function (item) {
|
|
56
58
|
return item.id;
|
|
57
|
-
}));
|
|
59
|
+
}).sort();
|
|
60
|
+
var filterSignature = [allIds.join(','), (defaultShowFilterCols || []).join(',')].join('|');
|
|
61
|
+
if (filterSignature !== prevFilterSignatureRef.current) {
|
|
62
|
+
prevFilterSignatureRef.current = filterSignature;
|
|
63
|
+
setShowCols(defaultShowFilterCols ? defaultShowFilterCols : allIds);
|
|
64
|
+
}
|
|
58
65
|
}, [searchContents, defaultShowFilterCols]);
|
|
59
66
|
var renderFormItem = function renderFormItem(child, index, isFunc) {
|
|
60
67
|
return /*#__PURE__*/React.createElement(_Form.Item, {
|
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
|
//传入的搜索框
|
|
@@ -175,13 +172,13 @@ var SearchBar = function SearchBar(props) {
|
|
|
175
172
|
setExpandSearch = _useState8[1];
|
|
176
173
|
//外部搜索条件的值,
|
|
177
174
|
var _useState9 = useState({}),
|
|
178
|
-
|
|
179
|
-
outOperation =
|
|
180
|
-
setOutOperation =
|
|
181
|
-
var
|
|
182
|
-
|
|
183
|
-
filterOption =
|
|
184
|
-
setFilterOption =
|
|
175
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
176
|
+
outOperation = _useState0[0],
|
|
177
|
+
setOutOperation = _useState0[1];
|
|
178
|
+
var _useState1 = useState([]),
|
|
179
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
180
|
+
filterOption = _useState10[0],
|
|
181
|
+
setFilterOption = _useState10[1];
|
|
185
182
|
//获取外部搜索条件的操作
|
|
186
183
|
var getOutOperation = function getOutOperation(operation) {
|
|
187
184
|
setOutOperation(operation);
|
|
@@ -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; }
|
|
@@ -9,7 +10,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
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; }
|
|
10
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
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); }
|
|
12
|
-
function
|
|
13
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
14
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
13
15
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
14
16
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
15
17
|
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; }
|
|
@@ -37,6 +39,10 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
37
39
|
_ref$routerType = _ref.routerType,
|
|
38
40
|
routerType = _ref$routerType === void 0 ? "hash" : _ref$routerType,
|
|
39
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;
|
|
40
46
|
var container = useRef();
|
|
41
47
|
var model = useModel();
|
|
42
48
|
var currentAppId = model.currentAppId;
|
|
@@ -64,15 +70,15 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
64
70
|
return;
|
|
65
71
|
}
|
|
66
72
|
// 注册微应用
|
|
67
|
-
registerApplication(project.id, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
68
|
-
var indexInfo, style, script, _res;
|
|
69
|
-
return
|
|
70
|
-
while (1) switch (_context.
|
|
73
|
+
registerApplication(project.id, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
74
|
+
var indexInfo, style, script, _intl, _res, _t;
|
|
75
|
+
return _regenerator().w(function (_context) {
|
|
76
|
+
while (1) switch (_context.p = _context.n) {
|
|
71
77
|
case 0:
|
|
72
|
-
_context.
|
|
78
|
+
_context.n = 1;
|
|
73
79
|
return importHTML(project.entry + '/index.html');
|
|
74
|
-
case
|
|
75
|
-
indexInfo = _context.
|
|
80
|
+
case 1:
|
|
81
|
+
indexInfo = _context.v;
|
|
76
82
|
style = formatUrl(indexInfo.style);
|
|
77
83
|
script = formatUrl(indexInfo.script); // FIXED 子应用没有部署 会将portal文件引入 导致白屏报错
|
|
78
84
|
if (script.length && script[0].includes('.portal')) {
|
|
@@ -80,19 +86,20 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
80
86
|
script = [];
|
|
81
87
|
}
|
|
82
88
|
if (script.length) {
|
|
83
|
-
_context.
|
|
89
|
+
_context.n = 2;
|
|
84
90
|
break;
|
|
85
91
|
}
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
_intl = intlRef.current;
|
|
93
|
+
return _context.a(2, Promise.reject(_intl.get("eb2ef811-bd15-4dd7-b003-45ee51ae4388").d("未检索到子应用相关脚本")));
|
|
94
|
+
case 2:
|
|
88
95
|
// 注入样式文件
|
|
89
96
|
if (style.length) {
|
|
90
97
|
style.forEach(function (st) {
|
|
91
98
|
SystemCss(st);
|
|
92
99
|
});
|
|
93
100
|
}
|
|
94
|
-
_context.
|
|
95
|
-
_context.
|
|
101
|
+
_context.p = 3;
|
|
102
|
+
_context.n = 4;
|
|
96
103
|
return importScripts(script).then(function (result) {
|
|
97
104
|
var _result$default;
|
|
98
105
|
model.updateLoadedIds(project.id);
|
|
@@ -101,27 +108,24 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
101
108
|
unloadApplication(project.id, {
|
|
102
109
|
waitForUnmount: true
|
|
103
110
|
}).then(function () {
|
|
104
|
-
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
|
|
105
112
|
removeStyleAndScript(project.entry, script);
|
|
106
|
-
console.log('===卸载成功====');
|
|
113
|
+
console.log('===卸载成功===='); // cw-i18n-disable-line
|
|
107
114
|
});
|
|
108
115
|
return Promise.resolve();
|
|
109
116
|
});
|
|
110
117
|
// 处理ES6: export default *;
|
|
111
118
|
return result["default"];
|
|
112
119
|
});
|
|
113
|
-
case
|
|
114
|
-
_res = _context.
|
|
115
|
-
return _context.
|
|
116
|
-
case
|
|
117
|
-
_context.
|
|
118
|
-
|
|
119
|
-
return _context.
|
|
120
|
-
case 19:
|
|
121
|
-
case "end":
|
|
122
|
-
return _context.stop();
|
|
120
|
+
case 4:
|
|
121
|
+
_res = _context.v;
|
|
122
|
+
return _context.a(2, Promise.resolve(_res));
|
|
123
|
+
case 5:
|
|
124
|
+
_context.p = 5;
|
|
125
|
+
_t = _context.v;
|
|
126
|
+
return _context.a(2, Promise.reject(_t));
|
|
123
127
|
}
|
|
124
|
-
}, _callee, null, [[
|
|
128
|
+
}, _callee, null, [[3, 5]]);
|
|
125
129
|
})),
|
|
126
130
|
// 是否展示子应用判断
|
|
127
131
|
hashPrefix(project.id, storeObj, routerType, model.updateCurrentAppId), // 给子产品通信
|
|
@@ -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,
|
|
@@ -56,9 +56,9 @@ var useMouse = function useMouse(_ref) {
|
|
|
56
56
|
bottomSliderHoverInfo = _useState8[0],
|
|
57
57
|
setBottomSliderHoverInfo = _useState8[1];
|
|
58
58
|
var _useState9 = useState([]),
|
|
59
|
-
|
|
60
|
-
recordTimeDateWrapper =
|
|
61
|
-
setRecordTimeDateWrapper =
|
|
59
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
60
|
+
recordTimeDateWrapper = _useState0[0],
|
|
61
|
+
setRecordTimeDateWrapper = _useState0[1]; // 记录时间日期用于时间滑块外层容器渲染
|
|
62
62
|
var currentMomentRef = useRef(moment()); // 保存当前时间,用于计算时间滑块位置(下部分滑块),每次打开弹窗时更新
|
|
63
63
|
var recordEndTimeDateWrapper = useRef([]); // 保存最后一次时间日期用于时间滑块外层容器渲染(拖拽结束后)(下部分滑块)
|
|
64
64
|
var dragableRef = useRef({
|
|
@@ -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,11 +91,12 @@ 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
|
-
|
|
98
|
-
isAutoRefresh =
|
|
99
|
-
setIsAutoRefresh =
|
|
97
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
98
|
+
isAutoRefresh = _useState0[0],
|
|
99
|
+
setIsAutoRefresh = _useState0[1];
|
|
100
100
|
// 特殊时间选择器外壳容器
|
|
101
101
|
var calendarRef = useRef(null);
|
|
102
102
|
// 定时器计数
|
|
@@ -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),
|
|
@@ -266,9 +270,9 @@ var TimeRangeSlider = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
266
270
|
// 不符合最近时间格式和没有日期数据返回false
|
|
267
271
|
var values = recordDateValue.value;
|
|
268
272
|
var _judgeType9 = judgeType(recordDateValue),
|
|
269
|
-
|
|
270
|
-
isRule =
|
|
271
|
-
captureUnit =
|
|
273
|
+
_judgeType0 = _slicedToArray(_judgeType9, 2),
|
|
274
|
+
isRule = _judgeType0[0],
|
|
275
|
+
captureUnit = _judgeType0[1];
|
|
272
276
|
values = funcValueChangeArrayValue(values);
|
|
273
277
|
var isHasDate = true;
|
|
274
278
|
var isRightDisabled = false;
|
|
@@ -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;
|