@chaoswise/ui 3.1.16 → 3.1.17
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/Antd5/_util/isNumeric.js +4 -0
- package/lib/Antd5/avatar/group.js +121 -0
- package/lib/Antd5/button/LoadingIcon.js +82 -0
- package/lib/Antd5/pagination/Select.js +24 -0
- package/lib/BasicLayout/locale/en_US.js +4 -0
- package/lib/BasicLayout/locale/index.js +11 -0
- package/lib/BasicLayout/locale/zh_CN.js +4 -0
- package/lib/BasicLayout/locale/zh_TW.js +4 -0
- package/lib/CWColorPicker/index.js +44 -44
- package/lib/CWMessage/MessageContent/TabList/index.js +13 -13
- package/lib/CWMessage/MessageContent/index.js +24 -24
- package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +7 -7
- package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +14 -14
- package/lib/CWRangePicker/DropdownMenu/index.js +34 -34
- package/lib/CWRangePicker/Refresh/index.js +12 -12
- package/lib/CWRangePicker/TimeSpan/index.js +14 -14
- package/lib/CWRangePicker/index.js +56 -56
- package/lib/CWRangePicker/utils/generate/dayjs.js +110 -93
- package/lib/CWRangePicker/utils/generate/moment.js +99 -82
- package/lib/CWTable/assets/DownGraySvg.js +16 -0
- package/lib/CWTable/assets/DownLightSvg.js +16 -0
- package/lib/CWTable/assets/SortSvg.js +16 -0
- package/lib/CWTable/assets/SortingSvg.js +16 -0
- package/lib/CWTable/assets/UpGraySvg.js +15 -0
- package/lib/CWTable/assets/UpLightSvg.js +15 -0
- package/lib/CWTree/locale/en_US.js +3 -0
- package/lib/CWTree/locale/index.js +11 -0
- package/lib/CWTree/locale/zh_CN.js +3 -0
- package/lib/CWTree/locale/zh_TW.js +3 -0
- package/lib/ConfigProvider/ConfigProvider.js +6 -0
- package/lib/ConfigProvider/generate/dayjs.js +4 -0
- package/lib/Empty/index.js +10 -10
- package/lib/ErrorBoundary/ErrorPage.js +10 -10
- package/lib/Exception/index.js +22 -22
- package/lib/FilterDropDown/index.js +19 -19
- package/lib/Header/Document/index.js +5 -5
- package/lib/IconSelect/components/CustomImg/index.js +10 -10
- package/lib/IconSelect/components/SearchIcon/index.js +8 -8
- package/lib/IconSelect/index.js +16 -16
- package/lib/Joyride/List.js +11 -11
- package/lib/Joyride/index.js +55 -55
- package/lib/Pagination/index.js +34 -34
- package/lib/QuickTransfer/DragList.js +15 -15
- package/lib/QuickTransfer/index.js +59 -59
- package/lib/RangePicker/components/ExtraTimeFooter.js +1 -1
- package/lib/SearchBar/index.js +40 -40
- package/lib/TimeRangeSlider/Refresh/index.js +11 -11
- package/lib/TimeRangeSlider/TimeSpan/index.js +13 -13
- package/lib/TimeRangeSlider/index.js +32 -32
- package/lib/TimeRangeSlider/utils/generate/moment.js +106 -89
- package/lib/locales/en_US.json +1 -86
- package/lib/locales/index.js +11 -0
- package/lib/locales/ja_JP.json +1 -0
- package/lib/locales/zh_CN.json +1 -86
- package/lib/locales/zh_TW.json +1 -86
- package/package.json +2 -1
- /package/lib/Antd5/avatar/{Avatar.js → avatar.js} +0 -0
package/lib/Empty/index.js
CHANGED
|
@@ -8,14 +8,14 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
8
8
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
9
9
|
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; }
|
|
10
10
|
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; }
|
|
11
|
-
import React, { forwardRef } from
|
|
12
|
-
import Empty from
|
|
13
|
-
import PropTypes from
|
|
14
|
-
import classnames from
|
|
15
|
-
import { cloneComProps } from
|
|
16
|
-
import useConfigContext from
|
|
17
|
-
import { useIntl } from
|
|
18
|
-
import useStyle from
|
|
11
|
+
import React, { forwardRef } from 'react';
|
|
12
|
+
import Empty from '../Antd5/empty';
|
|
13
|
+
import PropTypes from 'prop-types';
|
|
14
|
+
import classnames from 'classnames';
|
|
15
|
+
import { cloneComProps } from '../utils';
|
|
16
|
+
import useConfigContext from '../useConfigContext';
|
|
17
|
+
import { useIntl } from '../locales';
|
|
18
|
+
import useStyle from './index.style';
|
|
19
19
|
var CWEmpty = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
20
20
|
var _props$image = props.image,
|
|
21
21
|
image = _props$image === void 0 ? Empty.PRESENTED_IMAGE_SIMPLE : _props$image,
|
|
@@ -27,7 +27,7 @@ var CWEmpty = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
27
27
|
var intl = useIntl();
|
|
28
28
|
var _useConfigContext = useConfigContext(),
|
|
29
29
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
30
|
-
var prefixCls = getPrefixCls(
|
|
30
|
+
var prefixCls = getPrefixCls('empty');
|
|
31
31
|
var _useStyle = useStyle(prefixCls),
|
|
32
32
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
33
33
|
wrapCSSVar = _useStyle2[0],
|
|
@@ -36,7 +36,7 @@ var CWEmpty = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
36
36
|
if (onlyDescription) {
|
|
37
37
|
return wrapCSSVar(/*#__PURE__*/React.createElement("div", {
|
|
38
38
|
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-only-description"), className)
|
|
39
|
-
}, /*#__PURE__*/React.createElement("div", null, description ? description : intl.get(
|
|
39
|
+
}, /*#__PURE__*/React.createElement("div", null, description ? description : intl.get('c2c4fb87-08a5-4727-ad30-2f00a60186e0').d('暂无数据')), props.children && /*#__PURE__*/React.createElement("div", {
|
|
40
40
|
className: "".concat(prefixCls, "-only-description-children")
|
|
41
41
|
}, props.children)));
|
|
42
42
|
}
|
|
@@ -4,19 +4,19 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
4
4
|
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; }
|
|
5
5
|
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; } }
|
|
6
6
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
-
import React from
|
|
8
|
-
import NoPage from
|
|
9
|
-
import classnames from
|
|
10
|
-
import useStyle from
|
|
11
|
-
import useConfigContext from
|
|
12
|
-
import { useIntl } from
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import NoPage from './assets/images/No-data.png';
|
|
9
|
+
import classnames from 'classnames';
|
|
10
|
+
import useStyle from './index.styles';
|
|
11
|
+
import useConfigContext from '../useConfigContext';
|
|
12
|
+
import { useIntl } from '../locales';
|
|
13
13
|
var ErrorPage = function ErrorPage() {
|
|
14
14
|
var _useConfigContext = useConfigContext(),
|
|
15
15
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
16
16
|
var intl = useIntl();
|
|
17
17
|
var _intl$getInitOptions = intl.getInitOptions(),
|
|
18
18
|
currentLocale = _intl$getInitOptions.currentLocale;
|
|
19
|
-
var prefixCls = getPrefixCls(
|
|
19
|
+
var prefixCls = getPrefixCls('error-boundary');
|
|
20
20
|
var _useStyle = useStyle(prefixCls),
|
|
21
21
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
22
22
|
wrapCSSVar = _useStyle2[0],
|
|
@@ -30,13 +30,13 @@ var ErrorPage = function ErrorPage() {
|
|
|
30
30
|
className: "".concat(prefixCls, "-img")
|
|
31
31
|
}), /*#__PURE__*/React.createElement("div", {
|
|
32
32
|
className: "".concat(prefixCls, "-content")
|
|
33
|
-
}, intl.get(
|
|
33
|
+
}, intl.get('1ba80c84-7fc5-4ab0-bed2-15f9a9aeebe0').d('哎呀,页面走丢了,请'), /*#__PURE__*/React.createElement("a", {
|
|
34
34
|
onClick: function onClick() {
|
|
35
35
|
window.location.reload();
|
|
36
36
|
},
|
|
37
37
|
style: {
|
|
38
|
-
margin: currentLocale ===
|
|
38
|
+
margin: currentLocale === 'en_US' ? '0 3px' : 0
|
|
39
39
|
}
|
|
40
|
-
}, intl.get(
|
|
40
|
+
}, intl.get('1d0f3c0c-188f-4f83-bff0-2792dffcdc2d').d('刷新')), intl.get('8cfce2aa-1a8f-4bb1-a868-563ddfa2980d').d('重试'))));
|
|
41
41
|
};
|
|
42
42
|
export default ErrorPage;
|
package/lib/Exception/index.js
CHANGED
|
@@ -4,21 +4,21 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
4
4
|
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; }
|
|
5
5
|
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; } }
|
|
6
6
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
-
import React from
|
|
8
|
-
import classNames from
|
|
9
|
-
import PropTypes from
|
|
10
|
-
import ErrorImg from
|
|
11
|
-
import useConfigContext from
|
|
12
|
-
import { useIntl } from
|
|
13
|
-
import useStyle from
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import ErrorImg from './images/error.svg';
|
|
11
|
+
import useConfigContext from '../useConfigContext';
|
|
12
|
+
import { useIntl } from '../locales';
|
|
13
|
+
import useStyle from './index.style';
|
|
14
14
|
/**
|
|
15
15
|
* 常用异常页面,目前包括:403, 404, 500, loadFail, incompatible
|
|
16
16
|
*/
|
|
17
17
|
function Exception(_ref) {
|
|
18
18
|
var _ref$type = _ref.type,
|
|
19
|
-
type = _ref$type === void 0 ?
|
|
19
|
+
type = _ref$type === void 0 ? '500' : _ref$type,
|
|
20
20
|
_ref$className = _ref.className,
|
|
21
|
-
className = _ref$className === void 0 ?
|
|
21
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
22
22
|
_ref$style = _ref.style,
|
|
23
23
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
24
24
|
children = _ref.children,
|
|
@@ -27,7 +27,7 @@ function Exception(_ref) {
|
|
|
27
27
|
var intl = useIntl();
|
|
28
28
|
var _useConfigContext = useConfigContext(),
|
|
29
29
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
30
|
-
var prefixCls = getPrefixCls(
|
|
30
|
+
var prefixCls = getPrefixCls('exception');
|
|
31
31
|
var _useStyle = useStyle(prefixCls),
|
|
32
32
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
33
33
|
wrapCSSVar = _useStyle2[0],
|
|
@@ -35,27 +35,27 @@ function Exception(_ref) {
|
|
|
35
35
|
cssVarCls = _useStyle2[2];
|
|
36
36
|
var ExceptionType = {
|
|
37
37
|
403: {
|
|
38
|
-
title:
|
|
39
|
-
text: intl.get(
|
|
38
|
+
title: '403',
|
|
39
|
+
text: intl.get('ac05181b-c641-4cb0-84e5-16a060f98851').d('抱歉无权访问此页面/内容')
|
|
40
40
|
},
|
|
41
41
|
404: {
|
|
42
|
-
title:
|
|
43
|
-
text: intl.get(
|
|
42
|
+
title: '404',
|
|
43
|
+
text: intl.get('54653cf2-ee7e-4091-b778-30d21facc877').d('页面走丢了,平台正在找回页面')
|
|
44
44
|
},
|
|
45
45
|
500: {
|
|
46
|
-
title:
|
|
47
|
-
text: intl.get(
|
|
46
|
+
title: '500',
|
|
47
|
+
text: intl.get('06acca4b-d39f-4df8-b707-d6a4de229c53').d('服务器无法跟上您的脚步,平台正在紧急抢修')
|
|
48
48
|
},
|
|
49
49
|
loadFail: {
|
|
50
|
-
title: intl.get(
|
|
51
|
-
text: intl.get(
|
|
50
|
+
title: intl.get('d9ef3e74-3325-4272-aa97-2b861fdcf8ff').d('加载失败'),
|
|
51
|
+
text: intl.get('a796b350-9e45-4712-a5f4-3731fba1958b').d('出错了,平台正在紧急抢修')
|
|
52
52
|
},
|
|
53
53
|
incompatible: {
|
|
54
|
-
title: intl.get(
|
|
55
|
-
text: intl.get(
|
|
54
|
+
title: intl.get('8f5cbd29-b975-44e7-8124-2dc64a6c3182').d('浏览器不兼容'),
|
|
55
|
+
text: intl.get('e1f25f97-3a00-4e98-b73c-069638e57184').d('浏览器版本过低,为避免可能存在的安全隐患,推荐升级一下浏览器')
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
var currentException = ExceptionType[type] ? ExceptionType[type] : ExceptionType[
|
|
58
|
+
var currentException = ExceptionType[type] ? ExceptionType[type] : ExceptionType['500'];
|
|
59
59
|
var title = currentException.title,
|
|
60
60
|
text = currentException.text;
|
|
61
61
|
return wrapCSSVar(/*#__PURE__*/React.createElement("div", {
|
|
@@ -74,7 +74,7 @@ Exception.propTypes = {
|
|
|
74
74
|
/**
|
|
75
75
|
* 异常页类型
|
|
76
76
|
*/
|
|
77
|
-
type: PropTypes.oneOf([
|
|
77
|
+
type: PropTypes.oneOf(['403', '404', '500', 'loadFail', 'incompatible']),
|
|
78
78
|
/**
|
|
79
79
|
* 自定义class
|
|
80
80
|
*/
|
|
@@ -11,16 +11,16 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
11
11
|
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; }
|
|
12
12
|
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; } }
|
|
13
13
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
-
import React, { useState, Fragment, useEffect, useMemo, useRef } from
|
|
15
|
-
import DragList from
|
|
16
|
-
import classnames from
|
|
17
|
-
import PropTypes from
|
|
18
|
-
import { HTML5Backend } from
|
|
19
|
-
import { DndProvider } from
|
|
20
|
-
import useConfigContext from
|
|
21
|
-
import ShowSvgIcon from
|
|
22
|
-
import { useIntl } from
|
|
23
|
-
import useStyle from
|
|
14
|
+
import React, { useState, Fragment, useEffect, useMemo, useRef } from 'react';
|
|
15
|
+
import DragList from './DragList';
|
|
16
|
+
import classnames from 'classnames';
|
|
17
|
+
import PropTypes from 'prop-types';
|
|
18
|
+
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
19
|
+
import { DndProvider } from 'react-dnd';
|
|
20
|
+
import useConfigContext from '../useConfigContext';
|
|
21
|
+
import ShowSvgIcon from './assets/ShowSvgIcon';
|
|
22
|
+
import { useIntl } from '../locales';
|
|
23
|
+
import useStyle from './index.style';
|
|
24
24
|
var CheckboxGroup = _Checkbox.Group;
|
|
25
25
|
function FilterDropDown(props) {
|
|
26
26
|
var selectItems = props.selectItems,
|
|
@@ -66,16 +66,16 @@ function FilterDropDown(props) {
|
|
|
66
66
|
setFilterOptions = _useState8[1];
|
|
67
67
|
var _useConfigContext = useConfigContext(),
|
|
68
68
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
69
|
-
var prefixCls = getPrefixCls(
|
|
69
|
+
var prefixCls = getPrefixCls('filter-dropdown');
|
|
70
70
|
var _useStyle = useStyle(prefixCls),
|
|
71
71
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
72
72
|
wrapCSSVar = _useStyle2[0],
|
|
73
73
|
hashId = _useStyle2[1],
|
|
74
74
|
cssVarCls = _useStyle2[2];
|
|
75
75
|
useEffect(function () {
|
|
76
|
-
document.addEventListener(
|
|
76
|
+
document.addEventListener('click', clickBody);
|
|
77
77
|
return function () {
|
|
78
|
-
document.removeEventListener(
|
|
78
|
+
document.removeEventListener('click', clickBody);
|
|
79
79
|
};
|
|
80
80
|
}, []);
|
|
81
81
|
|
|
@@ -102,7 +102,7 @@ function FilterDropDown(props) {
|
|
|
102
102
|
setShowList(false);
|
|
103
103
|
};
|
|
104
104
|
var _checkedList = useMemo(function () {
|
|
105
|
-
return props.hasOwnProperty(
|
|
105
|
+
return props.hasOwnProperty('selectItems') ? selectItems : checkedList;
|
|
106
106
|
}, [selectItems, checkedList]);
|
|
107
107
|
var toggoleShow = function toggoleShow(e) {
|
|
108
108
|
e.preventDefault();
|
|
@@ -176,11 +176,11 @@ function FilterDropDown(props) {
|
|
|
176
176
|
var renderDropdown = function renderDropdown() {
|
|
177
177
|
var style = {};
|
|
178
178
|
if (fixed) {
|
|
179
|
-
style.position =
|
|
179
|
+
style.position = 'fixed';
|
|
180
180
|
style.top = XY.y;
|
|
181
181
|
style.lef = XY.x;
|
|
182
|
-
style.right =
|
|
183
|
-
style.bottom =
|
|
182
|
+
style.right = 'initial';
|
|
183
|
+
style.bottom = 'initial';
|
|
184
184
|
}
|
|
185
185
|
return /*#__PURE__*/React.createElement("div", {
|
|
186
186
|
className: classnames("".concat(prefixCls, "-content"), dropdownClassName),
|
|
@@ -193,10 +193,10 @@ function FilterDropDown(props) {
|
|
|
193
193
|
className: "".concat(prefixCls, "-select-all"),
|
|
194
194
|
indeterminate: _checkedList.length !== filterOptions.length && !!_checkedList.length,
|
|
195
195
|
checked: _checkedList.length === filterOptions.length
|
|
196
|
-
}, intl.get(
|
|
196
|
+
}, intl.get('e6b82693-9376-4297-9b57-2d3480a5d14b', {
|
|
197
197
|
checkedLength: _checkedList.length,
|
|
198
198
|
optionsLength: filterOptions.length
|
|
199
|
-
}).d(
|
|
199
|
+
}).d('全选({checkedLength}/{optionsLength})')), /*#__PURE__*/React.createElement(CheckboxGroup, {
|
|
200
200
|
value: _checkedList,
|
|
201
201
|
onChange: onChange
|
|
202
202
|
}, setCheckOptions()));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
2
|
-
import React from
|
|
3
|
-
import CommonIcon from
|
|
4
|
-
import icon from
|
|
5
|
-
import { useIntl } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import CommonIcon from '../CommonIcon';
|
|
4
|
+
import icon from './icon.svg';
|
|
5
|
+
import { useIntl } from '../../locales';
|
|
6
6
|
function index(_ref) {
|
|
7
7
|
var option = _ref.option;
|
|
8
8
|
if (!option) {
|
|
@@ -12,7 +12,7 @@ function index(_ref) {
|
|
|
12
12
|
onClick = _option$onClick === void 0 ? function () {} : _option$onClick;
|
|
13
13
|
var intl = useIntl();
|
|
14
14
|
return /*#__PURE__*/React.createElement(_Tooltip, {
|
|
15
|
-
title: intl.get(
|
|
15
|
+
title: intl.get('7bf67185-0725-4307-9bc2-a285ef3e3601').d('在线文档中心'),
|
|
16
16
|
placement: "bottom"
|
|
17
17
|
}, /*#__PURE__*/React.createElement("div", {
|
|
18
18
|
style: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _Upload from "@chaoswise/ui/lib/Upload";
|
|
2
2
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
3
3
|
import _message from "@chaoswise/ui/lib/message";
|
|
4
|
-
import React from
|
|
4
|
+
import React from 'react';
|
|
5
5
|
import { UploadOutlined } from '@ant-design/icons';
|
|
6
|
-
import { useIntl } from
|
|
6
|
+
import { useIntl } from '../../../locales';
|
|
7
7
|
var CustomImg = function CustomImg(_ref) {
|
|
8
8
|
var onChange = _ref.onChange,
|
|
9
9
|
iconInfo = _ref.iconInfo,
|
|
@@ -14,7 +14,7 @@ var CustomImg = function CustomImg(_ref) {
|
|
|
14
14
|
var type = file.type,
|
|
15
15
|
size = file.size;
|
|
16
16
|
var checkTypeIsImage = function checkTypeIsImage() {
|
|
17
|
-
return !(type !== null && type !== void 0 && type.startsWith(
|
|
17
|
+
return !(type !== null && type !== void 0 && type.startsWith('image'));
|
|
18
18
|
};
|
|
19
19
|
var checkSizeIsNull = function checkSizeIsNull() {
|
|
20
20
|
return size == 0;
|
|
@@ -23,15 +23,15 @@ var CustomImg = function CustomImg(_ref) {
|
|
|
23
23
|
return size > 2 * 1024 * 1024;
|
|
24
24
|
};
|
|
25
25
|
if (checkTypeIsImage()) {
|
|
26
|
-
_message.error(intl.get(
|
|
26
|
+
_message.error(intl.get('c0839048-28ed-4a1f-bbad-be025e41ae75').d('暂不支持该格式文件'));
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
29
|
if (checkSizeIsNull()) {
|
|
30
|
-
_message.error(intl.get(
|
|
30
|
+
_message.error(intl.get('b7e613a0-9941-444c-a3f8-ae1f7d1943c3').d('不能上传空文件'));
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
33
33
|
if (checkSizeIsBig()) {
|
|
34
|
-
_message.error(intl.get(
|
|
34
|
+
_message.error(intl.get('eb6227c5-2594-4fb6-92cb-496295288cdd').d('图片大小不超过2M'));
|
|
35
35
|
return false;
|
|
36
36
|
}
|
|
37
37
|
var reader = new FileReader();
|
|
@@ -51,7 +51,7 @@ var CustomImg = function CustomImg(_ref) {
|
|
|
51
51
|
// console.log(reader.result, "reader.result");
|
|
52
52
|
};
|
|
53
53
|
reader.onerror = function () {
|
|
54
|
-
_message.error(intl.get(
|
|
54
|
+
_message.error(intl.get('95862d90-8807-499e-9b92-4b890337c82e').d('读取文件失败'));
|
|
55
55
|
};
|
|
56
56
|
return false;
|
|
57
57
|
};
|
|
@@ -59,7 +59,7 @@ var CustomImg = function CustomImg(_ref) {
|
|
|
59
59
|
className: "link-upload-box"
|
|
60
60
|
}, /*#__PURE__*/React.createElement(_Upload, {
|
|
61
61
|
className: "upload-custom",
|
|
62
|
-
accept:
|
|
62
|
+
accept: '.png,.svg,.jpg,.jpeg',
|
|
63
63
|
dropSingleFileUpload: true,
|
|
64
64
|
beforeUpload: beforeUpload,
|
|
65
65
|
fileList: customFileInfo ? [customFileInfo] : [],
|
|
@@ -78,8 +78,8 @@ var CustomImg = function CustomImg(_ref) {
|
|
|
78
78
|
className: "custom-img"
|
|
79
79
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
80
80
|
icon: /*#__PURE__*/React.createElement(UploadOutlined, null)
|
|
81
|
-
}, intl.get(
|
|
81
|
+
}, intl.get('1a190483-11d6-4fc7-bdd8-9ebed6dcf14e').d('上传本地图片')), /*#__PURE__*/React.createElement("div", {
|
|
82
82
|
className: "custom-img-tip"
|
|
83
|
-
}, intl.get(
|
|
83
|
+
}, intl.get('718c1df1-dba2-4e7a-a078-46c54ee4875a').d('推荐上传40*40的PNG、SVG、JPG、JGPG,⼤⼩不超过2M'))))));
|
|
84
84
|
};
|
|
85
85
|
export default CustomImg;
|
|
@@ -11,11 +11,11 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
11
11
|
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; }
|
|
12
12
|
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; } }
|
|
13
13
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
-
import React, { useEffect, useState, useMemo } from
|
|
15
|
-
import Icon from
|
|
16
|
-
import { iconData } from
|
|
17
|
-
import classnames from
|
|
18
|
-
import { useIntl } from
|
|
14
|
+
import React, { useEffect, useState, useMemo } from 'react';
|
|
15
|
+
import Icon from '@icon-park/react/es/all';
|
|
16
|
+
import { iconData } from '../../constants/icon';
|
|
17
|
+
import classnames from 'classnames';
|
|
18
|
+
import { useIntl } from '../../../locales';
|
|
19
19
|
var SearchIcon = function SearchIcon(_ref) {
|
|
20
20
|
var iconInfo = _ref.iconInfo,
|
|
21
21
|
onChange = _ref.onChange,
|
|
@@ -31,7 +31,7 @@ var SearchIcon = function SearchIcon(_ref) {
|
|
|
31
31
|
var intl = useIntl();
|
|
32
32
|
var _ref2 = (intl === null || intl === void 0 ? void 0 : intl.options) || {},
|
|
33
33
|
_ref2$currentLocale = _ref2.currentLocale,
|
|
34
|
-
locale = _ref2$currentLocale === void 0 ?
|
|
34
|
+
locale = _ref2$currentLocale === void 0 ? 'zh_CN' : _ref2$currentLocale;
|
|
35
35
|
var iconSelectList = useMemo(function () {
|
|
36
36
|
return iconData.filter(function (item) {
|
|
37
37
|
return category.includes(item.category);
|
|
@@ -68,14 +68,14 @@ var SearchIcon = function SearchIcon(_ref) {
|
|
|
68
68
|
}, /*#__PURE__*/React.createElement("div", {
|
|
69
69
|
className: "".concat(prefixCls, "-search")
|
|
70
70
|
}, /*#__PURE__*/React.createElement(_Input.Search, {
|
|
71
|
-
placeholder: intl.get(
|
|
71
|
+
placeholder: intl.get('7c293e5f-8557-469c-a486-d909df4232ad').d('请输入搜索关键字'),
|
|
72
72
|
onChange: onSearch,
|
|
73
73
|
allowClear: true
|
|
74
74
|
})), /*#__PURE__*/React.createElement("div", {
|
|
75
75
|
className: "".concat(prefixCls, "-content")
|
|
76
76
|
}, iconList.length > 0 ? iconList.map(function (item) {
|
|
77
77
|
return /*#__PURE__*/React.createElement(_Tooltip, {
|
|
78
|
-
title: locale ===
|
|
78
|
+
title: locale === 'zh' || locale === 'zh_CN' || locale === 'zh_TW' ? item.title : item.name
|
|
79
79
|
// todo 繁体未做
|
|
80
80
|
,
|
|
81
81
|
key: item.name
|
package/lib/IconSelect/index.js
CHANGED
|
@@ -8,15 +8,15 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
8
8
|
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; }
|
|
9
9
|
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; } }
|
|
10
10
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
|
-
import React, { useEffect, useState } from
|
|
12
|
-
import Icon from
|
|
13
|
-
import CustomImg from
|
|
14
|
-
import SearchIcon from
|
|
15
|
-
import useConfigContext from
|
|
16
|
-
import PropTypes from
|
|
17
|
-
import useStyle from
|
|
18
|
-
import { useIntl } from
|
|
19
|
-
import classnames from
|
|
11
|
+
import React, { useEffect, useState } from 'react';
|
|
12
|
+
import Icon from '@icon-park/react/es/all';
|
|
13
|
+
import CustomImg from './components/CustomImg';
|
|
14
|
+
import SearchIcon from './components/SearchIcon';
|
|
15
|
+
import useConfigContext from '../useConfigContext';
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
17
|
+
import useStyle from './index.style';
|
|
18
|
+
import { useIntl } from '../locales';
|
|
19
|
+
import classnames from 'classnames';
|
|
20
20
|
function IconSelect(_ref) {
|
|
21
21
|
var value = _ref.value,
|
|
22
22
|
defaultValue = _ref.defaultValue,
|
|
@@ -28,13 +28,13 @@ function IconSelect(_ref) {
|
|
|
28
28
|
var intl = useIntl();
|
|
29
29
|
var _useConfigContext = useConfigContext(),
|
|
30
30
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
31
|
-
var prefixCls = getPrefixCls(
|
|
31
|
+
var prefixCls = getPrefixCls('icon-select');
|
|
32
32
|
var _useStyle = useStyle(prefixCls),
|
|
33
33
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
34
34
|
wrapCSSVar = _useStyle2[0],
|
|
35
35
|
hashId = _useStyle2[1],
|
|
36
36
|
cssVarCls = _useStyle2[2];
|
|
37
|
-
var _useState = useState(
|
|
37
|
+
var _useState = useState('icon'),
|
|
38
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
39
|
iconType = _useState2[0],
|
|
40
40
|
setIconType = _useState2[1]; //选中key 图标库 icon 自定义图片 customImg
|
|
@@ -65,8 +65,8 @@ function IconSelect(_ref) {
|
|
|
65
65
|
}
|
|
66
66
|
}, [_value]);
|
|
67
67
|
var items = [{
|
|
68
|
-
key:
|
|
69
|
-
label: intl.get(
|
|
68
|
+
key: 'icon',
|
|
69
|
+
label: intl.get('703fc2b8-0d1b-43ce-a7f8-9ea38de6c293').d('图标库'),
|
|
70
70
|
children: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SearchIcon, {
|
|
71
71
|
category: category,
|
|
72
72
|
iconInfo: iconInfo,
|
|
@@ -76,8 +76,8 @@ function IconSelect(_ref) {
|
|
|
76
76
|
prefixCls: prefixCls
|
|
77
77
|
}))
|
|
78
78
|
}, {
|
|
79
|
-
key:
|
|
80
|
-
label: intl.get(
|
|
79
|
+
key: 'customImg',
|
|
80
|
+
label: intl.get('a3a25b03-18bc-4b75-b795-0c16fd0dcc22').d('自定义图片'),
|
|
81
81
|
children: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CustomImg, {
|
|
82
82
|
iconInfo: iconInfo,
|
|
83
83
|
customFileInfo: customFileInfo,
|
|
@@ -100,7 +100,7 @@ function IconSelect(_ref) {
|
|
|
100
100
|
return wrapCSSVar(/*#__PURE__*/React.createElement("div", {
|
|
101
101
|
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-img-setting-box"))
|
|
102
102
|
}, /*#__PURE__*/React.createElement(_Dropdown, {
|
|
103
|
-
trigger: [
|
|
103
|
+
trigger: ['click'],
|
|
104
104
|
overlay: menu
|
|
105
105
|
}, iconSelectRender ? iconSelectRender({
|
|
106
106
|
customFileInfo: customFileInfo,
|
package/lib/Joyride/List.js
CHANGED
|
@@ -6,13 +6,13 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
6
6
|
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; }
|
|
7
7
|
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; } }
|
|
8
8
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
9
|
-
import React from
|
|
10
|
-
import { CheckCircleOutlined } from
|
|
11
|
-
import useConfigContext from
|
|
12
|
-
import classnames from
|
|
13
|
-
import { chunk, map } from
|
|
14
|
-
import { useIntl } from
|
|
15
|
-
import useStyle from
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { CheckCircleOutlined } from '@ant-design/icons';
|
|
11
|
+
import useConfigContext from '../useConfigContext';
|
|
12
|
+
import classnames from 'classnames';
|
|
13
|
+
import { chunk, map } from 'lodash-es';
|
|
14
|
+
import { useIntl } from '../locales';
|
|
15
|
+
import useStyle from './style/list.style';
|
|
16
16
|
function List(_ref) {
|
|
17
17
|
var _ref$pageSize = _ref.pageSize,
|
|
18
18
|
pageSize = _ref$pageSize === void 0 ? 5 : _ref$pageSize,
|
|
@@ -23,7 +23,7 @@ function List(_ref) {
|
|
|
23
23
|
var intl = useIntl();
|
|
24
24
|
var _useConfigContext = useConfigContext(),
|
|
25
25
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
26
|
-
var prefixCls = getPrefixCls(
|
|
26
|
+
var prefixCls = getPrefixCls('joyride');
|
|
27
27
|
var _useStyle = useStyle("".concat(prefixCls, "-taskCard")),
|
|
28
28
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
29
29
|
wrapCSSVar = _useStyle2[0],
|
|
@@ -42,7 +42,7 @@ function List(_ref) {
|
|
|
42
42
|
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-taskCard"))
|
|
43
43
|
}, /*#__PURE__*/React.createElement("div", {
|
|
44
44
|
className: "".concat(prefixCls, "-taskCard-title")
|
|
45
|
-
}, intl.get(
|
|
45
|
+
}, intl.get('6b4daed5-34d2-4d1d-8a98-79b640f91259').d('我的新手任务')), /*#__PURE__*/React.createElement("div", {
|
|
46
46
|
className: "".concat(prefixCls, "-taskCard-top"),
|
|
47
47
|
style: {
|
|
48
48
|
marginBottom: 25
|
|
@@ -55,7 +55,7 @@ function List(_ref) {
|
|
|
55
55
|
style: {
|
|
56
56
|
marginLeft: 20
|
|
57
57
|
}
|
|
58
|
-
}, intl.get(
|
|
58
|
+
}, intl.get('8f6f919a-a750-4389-8960-b5fae8bf2638').d('共有'), data.nviceGuidanceLists ? data.nviceGuidanceLists.length : 0, intl.get('3e75c2d9-76e5-4cd2-945b-8ff58469c434').d('项任务'))), /*#__PURE__*/React.createElement("div", {
|
|
59
59
|
className: "".concat(prefixCls, "-taskCard-bottom")
|
|
60
60
|
}, /*#__PURE__*/React.createElement(_Carousel, {
|
|
61
61
|
className: "".concat(prefixCls, "-carousel")
|
|
@@ -75,7 +75,7 @@ function List(_ref) {
|
|
|
75
75
|
return onItemClick(item, index);
|
|
76
76
|
},
|
|
77
77
|
className: isFinish ? "".concat(prefixCls, "-carousel-finish") : "".concat(prefixCls, "-carousel-noFinish")
|
|
78
|
-
}, isFinish ? intl.get(
|
|
78
|
+
}, isFinish ? intl.get('c630708e-719b-434f-b0fd-2e619a9b2ff0').d('已完成') : intl.get('e7097c4f-4efd-4d51-82d3-b75544fb5994').d('去完成'), isFinish && /*#__PURE__*/React.createElement(CheckCircleOutlined, {
|
|
79
79
|
theme: "filled",
|
|
80
80
|
className: "".concat(prefixCls, "-car-icon")
|
|
81
81
|
})));
|