@chaoswise/ui 2.3.17 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/BasicLayout/index.js +8 -3
- package/lib/BasicLayout/locale/index.js +9 -4
- package/lib/BasicLayout/locale/zh_TW.js +4 -0
- package/lib/CWCascader/Cascader/index.js +1 -2
- package/lib/CWCascader/rc-cascader/OptionList/Checkbox.js +1 -2
- package/lib/CWCascader/rc-cascader/OptionList/Column.js +1 -2
- package/lib/CWCascader/rc-cascader/OptionList/index.js +3 -3
- package/lib/CWCascader/rc-cascader/hooks/useSearchOptions.js +1 -2
- package/lib/CWMessage/MessageContent/TabList/index.js +6 -15
- package/lib/CWMessage/MessageContent/index.js +13 -9
- package/lib/CWMessage/locale/en_US.js +4 -1
- package/lib/CWMessage/locale/index.js +10 -11
- package/lib/CWMessage/locale/zh_CN.js +4 -1
- package/lib/CWMessage/locale/zh_TW.js +6 -0
- package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +7 -8
- package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +6 -15
- package/lib/CWRangePicker/DropdownMenu/index.js +10 -9
- package/lib/CWRangePicker/Refresh/index.js +7 -8
- package/lib/CWRangePicker/TimeSpan/index.js +10 -17
- package/lib/CWRangePicker/index.js +26 -16
- package/lib/CWRangePicker/locale/en_US.js +2 -9
- package/lib/CWRangePicker/locale/index.js +10 -11
- package/lib/CWRangePicker/locale/zh_CN.js +2 -9
- package/lib/CWRangePicker/locale/zh_TW.js +29 -0
- package/lib/CWRangePicker/utils/index.js +7 -4
- package/lib/CWSelect/antd-select.js +1 -2
- package/lib/CWSelect/index.js +7 -9
- package/lib/CWSelect/locale/index.js +10 -11
- package/lib/CWSelect/locale/zh_TW.js +4 -0
- package/lib/CWTable/EditLine.js +8 -9
- package/lib/CWTable/Filter.js +6 -7
- package/lib/CWTable/locale/index.js +10 -11
- package/lib/CWTable/locale/zh_TW.js +6 -0
- package/lib/CWTree/index.js +6 -7
- package/lib/CWTree/index.less +5 -0
- package/lib/CWTree/locale/index.js +10 -11
- package/lib/CWTree/locale/zh_TW.js +3 -0
- package/lib/CWUpload/locale/en_US.js +0 -8
- package/lib/CWUpload/locale/index.js +10 -11
- package/lib/CWUpload/locale/zh_TW.js +6 -0
- package/lib/CWUpload/upload/Dragger.js +6 -7
- package/lib/CWUpload/upload/Upload.js +4 -6
- package/lib/CWUpload/upload/UploadList.js +15 -18
- package/lib/Checkbox/Checkbox.js +1 -2
- package/lib/ColorPicker/index.js +7 -10
- package/lib/ColorPicker/locale/index.js +10 -11
- package/lib/ColorPicker/locale/zh_TW.js +4 -0
- package/lib/ConfigProvider/ConfigProvider.js +14 -7
- package/lib/ConfigProvider/Switch.js +29 -11
- package/lib/DateRangePicker/components/ExtraQuickFooter.js +24 -20
- package/lib/DateRangePicker/locale/index.js +10 -11
- package/lib/DateRangePicker/locale/zh_TW.js +5 -0
- package/lib/DropdownDatePicker/DropdownMenu/MoreTimeList/index.js +6 -7
- package/lib/DropdownDatePicker/DropdownMenu/index.js +7 -8
- package/lib/DropdownDatePicker/index.js +8 -7
- package/lib/DropdownDatePicker/locale/index.js +10 -11
- package/lib/DropdownDatePicker/locale/zh_TW.js +21 -0
- package/lib/DropdownDatePicker/utils/index.js +4 -2
- package/lib/Empty/index.js +6 -7
- package/lib/Empty/locale/index.js +10 -11
- package/lib/Empty/locale/zh_TW.js +3 -0
- package/lib/Exception/index.js +12 -13
- package/lib/Exception/locale/en_US.js +3 -1
- package/lib/Exception/locale/index.js +10 -11
- package/lib/Exception/locale/zh_CN.js +3 -1
- package/lib/Exception/locale/zh_TW.js +9 -0
- package/lib/FilterDropDown/DragList.js +33 -37
- package/lib/FilterDropDown/assets/DragSvg.js +33 -0
- package/lib/FilterDropDown/index.js +21 -15
- package/lib/FilterDropDown/index.less +8 -0
- package/lib/FilterDropDown/locale/index.js +10 -11
- package/lib/FilterDropDown/locale/zh_TW.js +3 -0
- package/lib/Header/UserSetting/index.js +14 -2
- package/lib/IconSelect/components/CustomImg/index.js +11 -12
- package/lib/IconSelect/components/SearchIcon/index.js +10 -8
- package/lib/IconSelect/index.js +7 -8
- package/lib/IconSelect/locale/index.js +10 -11
- package/lib/IconSelect/locale/zh_TW.js +11 -0
- package/lib/Input/InputComponent.js +1 -2
- package/lib/Joyride/List.js +8 -9
- package/lib/Joyride/index.js +21 -22
- package/lib/Joyride/locale/index.js +10 -11
- package/lib/Joyride/locale/zh_TW.js +25 -0
- package/lib/Pagination/index.js +21 -18
- package/lib/Pagination/locale/en_US.js +4 -10
- package/lib/Pagination/locale/index.js +10 -11
- package/lib/Pagination/locale/zh_CN.js +6 -13
- package/lib/Pagination/locale/zh_TW.js +8 -0
- package/lib/Progress/index.js +6 -15
- package/lib/Progress/locale/en_US.js +1 -1
- package/lib/Progress/locale/index.js +10 -11
- package/lib/Progress/locale/zh_CN.js +1 -1
- package/lib/Progress/locale/zh_TW.js +3 -0
- package/lib/QuickTransfer/DragList.js +6 -7
- package/lib/QuickTransfer/index.js +9 -10
- package/lib/QuickTransfer/locale/index.js +10 -11
- package/lib/QuickTransfer/locale/zh_TW.js +8 -0
- package/lib/Radio/Group.js +1 -2
- package/lib/Radio/Radio.js +1 -2
- package/lib/RangePicker/components/ExtraTimeFooter.js +6 -13
- package/lib/RangePicker/locale/index.js +10 -11
- package/lib/RangePicker/locale/zh_TW.js +5 -0
- package/lib/SearchBar/index.js +9 -10
- package/lib/SearchBar/locale/index.js +10 -11
- package/lib/SearchBar/locale/zh_CN.js +0 -8
- package/lib/SearchBar/locale/zh_TW.js +6 -0
- package/lib/SingleSpa/singleSpa/single-spa.dev.js +1 -2
- package/lib/TreeList/index.js +1 -2
- package/lib/TreeSelect111/index.js +6 -15
- package/lib/TreeSelect111/locale/index.js +10 -11
- package/lib/TreeSelect111/locale/zh_TW.js +3 -0
- package/lib/WangEditor/index.js +13 -7
- package/lib/WangEditor/locale/index.js +60 -29
- package/lib/Watermark/index.js +0 -2
- package/lib/message/index.js +2 -3
- package/lib/utils/index.js +11 -0
- package/package.json +2 -2
- package/lib/FilterDropDown/drag.svg +0 -17
- package/lib/QuickTransfer/CheckList.js +0 -54
- package/lib/QuickTransfer/TopicList.js +0 -153
|
@@ -11,6 +11,13 @@ import React, { useEffect, useState } from 'react';
|
|
|
11
11
|
import TenantList from './TenantList';
|
|
12
12
|
import TenantTree from './TenantTree';
|
|
13
13
|
import axios from 'axios';
|
|
14
|
+
var localOptionsMap = {
|
|
15
|
+
zh: "title",
|
|
16
|
+
zh_CN: "title",
|
|
17
|
+
zh_TW: "zh_TW_Title",
|
|
18
|
+
en: "enTitle",
|
|
19
|
+
en_US: "enTitle"
|
|
20
|
+
};
|
|
14
21
|
function UserSetting(_ref) {
|
|
15
22
|
var option = _ref.option;
|
|
16
23
|
if (!option) {
|
|
@@ -18,7 +25,7 @@ function UserSetting(_ref) {
|
|
|
18
25
|
}
|
|
19
26
|
var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
|
|
20
27
|
_ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
|
|
21
|
-
locale = _ConfigProvider$useLo2 === void 0 ? '
|
|
28
|
+
locale = _ConfigProvider$useLo2 === void 0 ? 'zh_CN' : _ConfigProvider$useLo2;
|
|
22
29
|
var _useState = useState([]),
|
|
23
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
24
31
|
myTenantList = _useState2[0],
|
|
@@ -87,16 +94,19 @@ function UserSetting(_ref) {
|
|
|
87
94
|
key: 'user-setting',
|
|
88
95
|
title: '个人设置',
|
|
89
96
|
enTitle: 'Personal settings',
|
|
97
|
+
zh_TW_Title: "個人設置",
|
|
90
98
|
icon: 'setting'
|
|
91
99
|
}, {
|
|
92
100
|
key: 'lock-screen',
|
|
93
101
|
title: '开启锁屏',
|
|
94
102
|
enTitle: 'Enable screen lock',
|
|
103
|
+
zh_TW_Title: "開啓鎖屏",
|
|
95
104
|
icon: 'lock'
|
|
96
105
|
}, {
|
|
97
106
|
key: 'switch-tenant',
|
|
98
107
|
title: '切换租户',
|
|
99
108
|
enTitle: 'Switch tenant',
|
|
109
|
+
zh_TW_Title: "切換租戶",
|
|
100
110
|
icon: 'swap',
|
|
101
111
|
showRight: true,
|
|
102
112
|
noEvent: true,
|
|
@@ -112,6 +122,7 @@ function UserSetting(_ref) {
|
|
|
112
122
|
key: 'sub-tenant',
|
|
113
123
|
title: '子租户',
|
|
114
124
|
enTitle: 'Go to subtenant',
|
|
125
|
+
zh_TW_Title: "子租戶",
|
|
115
126
|
icon: 'login',
|
|
116
127
|
showRight: true,
|
|
117
128
|
noEvent: true,
|
|
@@ -127,6 +138,7 @@ function UserSetting(_ref) {
|
|
|
127
138
|
key: 'logout',
|
|
128
139
|
title: '退出',
|
|
129
140
|
enTitle: 'Logout',
|
|
141
|
+
zh_TW_Title: "退出",
|
|
130
142
|
icon: 'poweroff'
|
|
131
143
|
}];
|
|
132
144
|
return /*#__PURE__*/React.createElement(_Popover, {
|
|
@@ -155,7 +167,7 @@ function UserSetting(_ref) {
|
|
|
155
167
|
type: item.icon
|
|
156
168
|
}), /*#__PURE__*/React.createElement("span", {
|
|
157
169
|
className: "cw-user-setting-item"
|
|
158
|
-
}, locale
|
|
170
|
+
}, item[localOptionsMap[locale]]), item.showRight && /*#__PURE__*/React.createElement(_Icon, {
|
|
159
171
|
type: "right",
|
|
160
172
|
style: {
|
|
161
173
|
marginLeft: 4,
|
|
@@ -4,19 +4,18 @@ import "@chaoswise/ui/lib/Button/index.less";
|
|
|
4
4
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
5
5
|
import "@chaoswise/ui/lib/message/index.less";
|
|
6
6
|
import _message from "@chaoswise/ui/lib/message";
|
|
7
|
-
import
|
|
7
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
8
8
|
import React from "react";
|
|
9
|
-
import
|
|
9
|
+
import langConfig from '../../locale';
|
|
10
|
+
import { formatMessage } from "../../../utils";
|
|
10
11
|
import "./index.less";
|
|
11
12
|
var CustomImg = function CustomImg(_ref) {
|
|
12
13
|
var onChange = _ref.onChange,
|
|
13
14
|
iconInfo = _ref.iconInfo,
|
|
14
15
|
setCustomFileInfo = _ref.setCustomFileInfo,
|
|
15
16
|
customFileInfo = _ref.customFileInfo;
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
19
|
-
var localeObj = getLocale(locale);
|
|
17
|
+
var _useLocale = _useLocale2(langConfig),
|
|
18
|
+
localeObj = _useLocale.langObj;
|
|
20
19
|
var beforeUpload = function beforeUpload(file) {
|
|
21
20
|
var type = file.type,
|
|
22
21
|
size = file.size;
|
|
@@ -30,15 +29,15 @@ var CustomImg = function CustomImg(_ref) {
|
|
|
30
29
|
return size > 2 * 1024 * 1024;
|
|
31
30
|
};
|
|
32
31
|
if (checkTypeIsImage()) {
|
|
33
|
-
_message.error(localeObj["icon-select-custom-type"]);
|
|
32
|
+
_message.error(formatMessage(localeObj["icon-select-custom-type"]));
|
|
34
33
|
return false;
|
|
35
34
|
}
|
|
36
35
|
if (checkSizeIsNull()) {
|
|
37
|
-
_message.error(localeObj["icon-select-custom-null"]);
|
|
36
|
+
_message.error(formatMessage(localeObj["icon-select-custom-null"]));
|
|
38
37
|
return false;
|
|
39
38
|
}
|
|
40
39
|
if (checkSizeIsBig()) {
|
|
41
|
-
_message.error(localeObj["icon-select-custom-length"]);
|
|
40
|
+
_message.error(formatMessage(localeObj["icon-select-custom-length"]));
|
|
42
41
|
return false;
|
|
43
42
|
}
|
|
44
43
|
var reader = new FileReader();
|
|
@@ -59,7 +58,7 @@ var CustomImg = function CustomImg(_ref) {
|
|
|
59
58
|
};
|
|
60
59
|
|
|
61
60
|
reader.onerror = function () {
|
|
62
|
-
_message.error(localeObj["icon-select-custom-fail"]);
|
|
61
|
+
_message.error(formatMessage(localeObj["icon-select-custom-fail"]));
|
|
63
62
|
};
|
|
64
63
|
return false;
|
|
65
64
|
};
|
|
@@ -86,8 +85,8 @@ var CustomImg = function CustomImg(_ref) {
|
|
|
86
85
|
className: "custom-img"
|
|
87
86
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
88
87
|
icon: "upload"
|
|
89
|
-
}, localeObj["icon-select-custom-upload"]), /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
}, formatMessage(localeObj["icon-select-custom-upload"])), /*#__PURE__*/React.createElement("div", {
|
|
90
89
|
className: "custom-img-tip"
|
|
91
|
-
}, localeObj["icon-select-custom-img-tip"])))));
|
|
90
|
+
}, formatMessage(localeObj["icon-select-custom-img-tip"]))))));
|
|
92
91
|
};
|
|
93
92
|
export default CustomImg;
|
|
@@ -4,7 +4,7 @@ import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
|
4
4
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
5
5
|
import "@chaoswise/ui/lib/Input/index.less";
|
|
6
6
|
import _Input from "@chaoswise/ui/lib/Input";
|
|
7
|
-
import
|
|
7
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
8
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -13,9 +13,10 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
import React, { useEffect, useState, useMemo } from "react";
|
|
15
15
|
import Icon from "@icon-park/react/es/all";
|
|
16
|
-
import { getLocale } from "../../locale";
|
|
17
16
|
import { iconData } from "../../constants/icon";
|
|
18
17
|
import classnames from "classnames";
|
|
18
|
+
import langConfig from '../../locale';
|
|
19
|
+
import { formatMessage } from "../../../utils";
|
|
19
20
|
import "./index.less";
|
|
20
21
|
var SearchIcon = function SearchIcon(_ref) {
|
|
21
22
|
var iconInfo = _ref.iconInfo,
|
|
@@ -28,10 +29,10 @@ var SearchIcon = function SearchIcon(_ref) {
|
|
|
28
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
30
|
iconList = _useState2[0],
|
|
30
31
|
setIconList = _useState2[1];
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
locale =
|
|
34
|
-
|
|
32
|
+
var _useLocale = _useLocale2(langConfig),
|
|
33
|
+
localeObj = _useLocale.langObj,
|
|
34
|
+
_useLocale$locale = _useLocale.locale,
|
|
35
|
+
locale = _useLocale$locale === void 0 ? "zh_CN" : _useLocale$locale;
|
|
35
36
|
var iconSelectList = useMemo(function () {
|
|
36
37
|
return iconData.filter(function (item) {
|
|
37
38
|
return category.includes(item.category);
|
|
@@ -69,14 +70,15 @@ var SearchIcon = function SearchIcon(_ref) {
|
|
|
69
70
|
}, /*#__PURE__*/React.createElement("div", {
|
|
70
71
|
className: "icon-selsect-search"
|
|
71
72
|
}, /*#__PURE__*/React.createElement(_Input.Search, {
|
|
72
|
-
placeholder: localeObj["icon-select-store-icon-search"],
|
|
73
|
+
placeholder: formatMessage(localeObj["icon-select-store-icon-search"]),
|
|
73
74
|
onChange: onSearch,
|
|
74
75
|
allowClear: true
|
|
75
76
|
})), /*#__PURE__*/React.createElement("div", {
|
|
76
77
|
className: "icon-selsect-content"
|
|
77
78
|
}, iconList.length > 0 ? iconList.map(function (item) {
|
|
78
79
|
return /*#__PURE__*/React.createElement(_Tooltip, {
|
|
79
|
-
title: locale === "zh" ? item.title : item.name
|
|
80
|
+
title: locale === "zh" || locale === "zh_CN" || locale === "zh_TW" ? item.title : item.name // todo 繁体未做
|
|
81
|
+
,
|
|
80
82
|
key: item.name
|
|
81
83
|
}, /*#__PURE__*/React.createElement("div", {
|
|
82
84
|
key: item.name,
|
package/lib/IconSelect/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import _Dropdown from "@chaoswise/ui/lib/Antd/Dropdown";
|
|
|
2
2
|
import "@chaoswise/ui/lib/Button/index.less";
|
|
3
3
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
4
4
|
import _Space from "@chaoswise/ui/lib/Space";
|
|
5
|
-
import
|
|
5
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
6
6
|
import "@chaoswise/ui/lib/Tabs/index.less";
|
|
7
7
|
import _Tabs from "@chaoswise/ui/lib/Tabs";
|
|
8
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -15,7 +15,8 @@ import React, { useEffect, useState } from "react";
|
|
|
15
15
|
import Icon from "@icon-park/react/es/all";
|
|
16
16
|
import CustomImg from "./components/CustomImg";
|
|
17
17
|
import SearchIcon from "./components/SearchIcon";
|
|
18
|
-
import
|
|
18
|
+
import langConfig from './locale';
|
|
19
|
+
import { formatMessage } from "../utils";
|
|
19
20
|
import "./index.less";
|
|
20
21
|
import PropTypes from "prop-types";
|
|
21
22
|
var TabPane = _Tabs.TabPane;
|
|
@@ -40,10 +41,8 @@ function IconSelect(_ref) {
|
|
|
40
41
|
customFileInfo = _useState6[0],
|
|
41
42
|
setCustomFileInfo = _useState6[1]; //组件图标数据集合
|
|
42
43
|
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
46
|
-
var localeObj = getLocale(locale);
|
|
44
|
+
var _useLocale = _useLocale2(langConfig),
|
|
45
|
+
localeObj = _useLocale.langObj;
|
|
47
46
|
var _value = value || defaultValue;
|
|
48
47
|
|
|
49
48
|
//切换tab
|
|
@@ -75,7 +74,7 @@ function IconSelect(_ref) {
|
|
|
75
74
|
className: "icon-select-dropdown-tabs"
|
|
76
75
|
}, /*#__PURE__*/React.createElement(TabPane, {
|
|
77
76
|
key: "icon",
|
|
78
|
-
tab: localeObj["icon-select-store-icon"]
|
|
77
|
+
tab: formatMessage(localeObj["icon-select-store-icon"])
|
|
79
78
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SearchIcon, {
|
|
80
79
|
category: category,
|
|
81
80
|
iconInfo: iconInfo,
|
|
@@ -84,7 +83,7 @@ function IconSelect(_ref) {
|
|
|
84
83
|
onChange: onChange
|
|
85
84
|
}))), /*#__PURE__*/React.createElement(TabPane, {
|
|
86
85
|
key: "customImg",
|
|
87
|
-
tab: localeObj["icon-select-custom-img"]
|
|
86
|
+
tab: formatMessage(localeObj["icon-select-custom-img"])
|
|
88
87
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CustomImg, {
|
|
89
88
|
iconInfo: iconInfo,
|
|
90
89
|
customFileInfo: customFileInfo,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import zh_CN from './zh_CN.js';
|
|
2
|
+
import en_US from './en_US.js';
|
|
3
|
+
import zh_TW from './zh_TW.js';
|
|
4
|
+
export default {
|
|
5
|
+
zh_CN: zh_CN,
|
|
6
|
+
en_US: en_US,
|
|
7
|
+
zh_TW: zh_TW,
|
|
8
|
+
// 兼容
|
|
9
|
+
zh: zh_CN,
|
|
10
|
+
en: en_US
|
|
12
11
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"icon-select-custom-type": "暫不支持該格式文件",
|
|
3
|
+
"icon-select-custom-null": "不能上傳空文件",
|
|
4
|
+
"icon-select-custom-length": "圖片大小不超過2M",
|
|
5
|
+
"icon-select-custom-fail": "讀取文件失敗",
|
|
6
|
+
"icon-select-custom-upload": "上傳本地圖片",
|
|
7
|
+
"icon-select-store-icon": "圖標庫",
|
|
8
|
+
"icon-select-store-icon-search": "請輸入搜索關鍵字",
|
|
9
|
+
"icon-select-custom-img": "自定義圖片",
|
|
10
|
+
"icon-select-custom-img-tip": "推薦上傳40*40的PNG、SVG、JPG、JGPG,⼤⼩不超過2M"
|
|
11
|
+
};
|
|
@@ -35,7 +35,6 @@ var getDefaultPaddingLeft = function getDefaultPaddingLeft(size) {
|
|
|
35
35
|
return 9;
|
|
36
36
|
};
|
|
37
37
|
var InputComponent = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
38
|
-
var _classnames;
|
|
39
38
|
var _props$showCount = props.showCount,
|
|
40
39
|
showCount = _props$showCount === void 0 ? false : _props$showCount,
|
|
41
40
|
maxLength = props.maxLength,
|
|
@@ -141,7 +140,7 @@ var InputComponent = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
|
141
140
|
"cw-input-num-wrapper-disabled": resProps.disabled
|
|
142
141
|
})
|
|
143
142
|
}, /*#__PURE__*/React.createElement("span", {
|
|
144
|
-
className: classnames((
|
|
143
|
+
className: classnames(_defineProperty(_defineProperty(_defineProperty({}, "cw-input-num-init", valueLength == 0), "cw-input-num", valueLength > 0), "cw-input-num-error", dataCount && valueLength > dataCount))
|
|
145
144
|
}, valueLength), dataCount && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
146
145
|
className: "cw-input-line"
|
|
147
146
|
}, "/"), dataCount));
|
package/lib/Joyride/List.js
CHANGED
|
@@ -2,9 +2,10 @@ import _Carousel from "@chaoswise/ui/lib/Antd/Carousel";
|
|
|
2
2
|
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
3
3
|
import "@chaoswise/ui/lib/Progress/index.less";
|
|
4
4
|
import _Progress from "@chaoswise/ui/lib/Progress";
|
|
5
|
-
import
|
|
5
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
6
6
|
import React from "react";
|
|
7
|
-
import
|
|
7
|
+
import langConfig from './locale';
|
|
8
|
+
import { formatMessage } from "../utils";
|
|
8
9
|
var _ = require("lodash-es");
|
|
9
10
|
function List(_ref) {
|
|
10
11
|
var _ref$pageSize = _ref.pageSize,
|
|
@@ -13,10 +14,8 @@ function List(_ref) {
|
|
|
13
14
|
data = _ref$data === void 0 ? {} : _ref$data,
|
|
14
15
|
_ref$onItemClick = _ref.onItemClick,
|
|
15
16
|
onItemClick = _ref$onItemClick === void 0 ? function () {} : _ref$onItemClick;
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
locale = _ConfigProvider$useLo2 === void 0 ? 'zh' : _ConfigProvider$useLo2;
|
|
19
|
-
var localeObj = getLocale(locale);
|
|
17
|
+
var _useLocale = _useLocale2(langConfig),
|
|
18
|
+
localeObj = _useLocale.langObj;
|
|
20
19
|
var getPercent = function getPercent() {
|
|
21
20
|
if (data && data.nviceGuidanceLists) {
|
|
22
21
|
var finiedNum = data.nviceGuidanceLists.filter(function (item) {
|
|
@@ -30,7 +29,7 @@ function List(_ref) {
|
|
|
30
29
|
className: "cw-joyride-taskCard"
|
|
31
30
|
}, /*#__PURE__*/React.createElement("div", {
|
|
32
31
|
className: "cw-joyride-taskCard-title"
|
|
33
|
-
}, localeObj['newTask']), /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
}, formatMessage(localeObj['newTask'])), /*#__PURE__*/React.createElement("div", {
|
|
34
33
|
className: "cw-joyride-taskCard-top",
|
|
35
34
|
style: {
|
|
36
35
|
marginBottom: 25
|
|
@@ -43,7 +42,7 @@ function List(_ref) {
|
|
|
43
42
|
style: {
|
|
44
43
|
marginLeft: 20
|
|
45
44
|
}
|
|
46
|
-
}, localeObj['total'], " ", data.nviceGuidanceLists ? data.nviceGuidanceLists.length : 0, " ", localeObj['term'], localeObj['task'])), /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
}, formatMessage(localeObj['total']), " ", data.nviceGuidanceLists ? data.nviceGuidanceLists.length : 0, " ", formatMessage(localeObj['term']), formatMessage(localeObj['task']))), /*#__PURE__*/React.createElement("div", {
|
|
47
46
|
className: "cw-joyride-taskCard-bottom"
|
|
48
47
|
}, /*#__PURE__*/React.createElement(_Carousel, {
|
|
49
48
|
className: "joyride-carousel"
|
|
@@ -63,7 +62,7 @@ function List(_ref) {
|
|
|
63
62
|
return onItemClick(item, index);
|
|
64
63
|
},
|
|
65
64
|
className: isFinish ? "cw-joyride-carousel-finish" : "cw-joyride-carousel-noFinish"
|
|
66
|
-
}, isFinish ? localeObj['completed'] : localeObj['notCompleted'], isFinish && /*#__PURE__*/React.createElement(_Icon, {
|
|
65
|
+
}, isFinish ? formatMessage(localeObj['completed']) : formatMessage(localeObj['notCompleted']), isFinish && /*#__PURE__*/React.createElement(_Icon, {
|
|
67
66
|
type: "check-circle",
|
|
68
67
|
theme: "filled",
|
|
69
68
|
className: "cw-joyride-car-icon"
|
package/lib/Joyride/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@chaoswise/ui/lib/Modal/index.less";
|
|
2
2
|
import _Modal from "@chaoswise/ui/lib/Modal";
|
|
3
3
|
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
4
|
-
import
|
|
4
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
5
5
|
var _excluded = ["run", "steps", "beginCallback", "finishCallback", "nextCallback", "callback", "onClose", "isShowHomeModal", "isShowNextModal", "isShowFinishedModal", "onFinished", "onNextCancel", "onFinishCancel", "onWelecomCancel"];
|
|
6
6
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
7
|
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); }
|
|
@@ -25,7 +25,8 @@ import "./index.less";
|
|
|
25
25
|
import welcomeImg from "./img/welcomeImg.png";
|
|
26
26
|
import finishImg from "./img/finishImg.png";
|
|
27
27
|
import List from './List';
|
|
28
|
-
import
|
|
28
|
+
import langConfig from './locale';
|
|
29
|
+
import { formatMessage } from "../utils";
|
|
29
30
|
import _ from 'lodash-es';
|
|
30
31
|
|
|
31
32
|
/**
|
|
@@ -61,9 +62,6 @@ function CWJoyride(_ref) {
|
|
|
61
62
|
_ref$onWelecomCancel = _ref.onWelecomCancel,
|
|
62
63
|
onWelecomCancel = _ref$onWelecomCancel === void 0 ? function () {} : _ref$onWelecomCancel,
|
|
63
64
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
64
|
-
var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
|
|
65
|
-
_ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
|
|
66
|
-
locale = _ConfigProvider$useLo2 === void 0 ? 'zh' : _ConfigProvider$useLo2;
|
|
67
65
|
var _useState = useState(false),
|
|
68
66
|
_useState2 = _slicedToArray(_useState, 2),
|
|
69
67
|
welcomeVisible = _useState2[0],
|
|
@@ -85,7 +83,8 @@ function CWJoyride(_ref) {
|
|
|
85
83
|
isClose = _useState10[0],
|
|
86
84
|
setIsClose = _useState10[1]; // 是否点击了关闭 关闭后停止指引但是不算完成
|
|
87
85
|
|
|
88
|
-
var
|
|
86
|
+
var _useLocale = _useLocale2(langConfig),
|
|
87
|
+
localeObj = _useLocale.langObj;
|
|
89
88
|
|
|
90
89
|
// 根据受控状态控制state状态
|
|
91
90
|
useEffect(function () {
|
|
@@ -157,22 +156,22 @@ function CWJoyride(_ref) {
|
|
|
157
156
|
style: {
|
|
158
157
|
color: "#8C8C8C"
|
|
159
158
|
}
|
|
160
|
-
}, localeObj['skip']),
|
|
159
|
+
}, formatMessage(localeObj['skip'])),
|
|
161
160
|
next: /*#__PURE__*/React.createElement("span", {
|
|
162
161
|
style: {
|
|
163
162
|
color: "#1890FF"
|
|
164
163
|
}
|
|
165
|
-
}, localeObj['next']),
|
|
164
|
+
}, formatMessage(localeObj['next'])),
|
|
166
165
|
last: /*#__PURE__*/React.createElement("span", {
|
|
167
166
|
style: {
|
|
168
167
|
color: "#1890FF"
|
|
169
168
|
}
|
|
170
|
-
}, localeObj['last']),
|
|
169
|
+
}, formatMessage(localeObj['last'])),
|
|
171
170
|
back: /*#__PURE__*/React.createElement("span", {
|
|
172
171
|
style: {
|
|
173
172
|
color: "#5D5D5D"
|
|
174
173
|
}
|
|
175
|
-
}, localeObj['back'])
|
|
174
|
+
}, formatMessage(localeObj['back']))
|
|
176
175
|
}, item.locale || {})
|
|
177
176
|
});
|
|
178
177
|
});
|
|
@@ -302,20 +301,20 @@ function CWJoyride(_ref) {
|
|
|
302
301
|
color: "#000",
|
|
303
302
|
fontWeight: 500
|
|
304
303
|
}
|
|
305
|
-
}, localeObj['welcome']), /*#__PURE__*/React.createElement("div", {
|
|
304
|
+
}, formatMessage(localeObj['welcome'])), /*#__PURE__*/React.createElement("div", {
|
|
306
305
|
style: {
|
|
307
306
|
fontSize: 26,
|
|
308
307
|
color: "#000",
|
|
309
308
|
fontWeight: 600,
|
|
310
309
|
marginBottom: 24
|
|
311
310
|
}
|
|
312
|
-
}, localeObj['welcomeSystem']), /*#__PURE__*/React.createElement("span", {
|
|
311
|
+
}, formatMessage(localeObj['welcomeSystem'])), /*#__PURE__*/React.createElement("span", {
|
|
313
312
|
className: "cw-joyride-back",
|
|
314
313
|
onClick: welcomeHandleCancel
|
|
315
|
-
}, localeObj['notCome']), /*#__PURE__*/React.createElement("span", {
|
|
314
|
+
}, formatMessage(localeObj['notCome'])), /*#__PURE__*/React.createElement("span", {
|
|
316
315
|
className: "cw-joyride-enter",
|
|
317
316
|
onClick: welcomeHandleOk
|
|
318
|
-
}, localeObj['letGoBegin'], /*#__PURE__*/React.createElement(_Icon, {
|
|
317
|
+
}, formatMessage(localeObj['letGoBegin']), /*#__PURE__*/React.createElement(_Icon, {
|
|
319
318
|
type: "arrow-right",
|
|
320
319
|
className: "cw-joyride-icon"
|
|
321
320
|
})))), /*#__PURE__*/React.createElement(_Modal, {
|
|
@@ -338,21 +337,21 @@ function CWJoyride(_ref) {
|
|
|
338
337
|
}
|
|
339
338
|
}, /*#__PURE__*/React.createElement("div", {
|
|
340
339
|
className: "cw-joyride-finish-title"
|
|
341
|
-
}, localeObj['greatComplete']), /*#__PURE__*/React.createElement("div", {
|
|
340
|
+
}, formatMessage(localeObj['greatComplete'])), /*#__PURE__*/React.createElement("div", {
|
|
342
341
|
style: {
|
|
343
342
|
fontSize: 16,
|
|
344
343
|
marginBottom: 24
|
|
345
344
|
},
|
|
346
345
|
className: "cw-joyride-finish-title"
|
|
347
|
-
}, localeObj['needNextTask']), /*#__PURE__*/React.createElement("div", {
|
|
346
|
+
}, formatMessage(localeObj['needNextTask'])), /*#__PURE__*/React.createElement("div", {
|
|
348
347
|
className: "cw-joyride-bottom"
|
|
349
348
|
}, /*#__PURE__*/React.createElement("span", {
|
|
350
349
|
className: "cw-joyride-back",
|
|
351
350
|
onClick: taskHandleCancel
|
|
352
|
-
}, localeObj['notContinue']), /*#__PURE__*/React.createElement("span", {
|
|
351
|
+
}, formatMessage(localeObj['notContinue'])), /*#__PURE__*/React.createElement("span", {
|
|
353
352
|
className: "cw-joyride-enter",
|
|
354
353
|
onClick: taskHandleOk
|
|
355
|
-
}, localeObj['continueNextTask'], /*#__PURE__*/React.createElement(_Icon, {
|
|
354
|
+
}, formatMessage(localeObj['continueNextTask']), /*#__PURE__*/React.createElement(_Icon, {
|
|
356
355
|
type: "arrow-right",
|
|
357
356
|
className: "cw-joyride-icon"
|
|
358
357
|
}))))), /*#__PURE__*/React.createElement(_Modal, {
|
|
@@ -375,21 +374,21 @@ function CWJoyride(_ref) {
|
|
|
375
374
|
}
|
|
376
375
|
}, /*#__PURE__*/React.createElement("div", {
|
|
377
376
|
className: "cw-joyride-finish-title"
|
|
378
|
-
}, localeObj['congratulations']), /*#__PURE__*/React.createElement("div", {
|
|
377
|
+
}, formatMessage(localeObj['congratulations'])), /*#__PURE__*/React.createElement("div", {
|
|
379
378
|
style: {
|
|
380
379
|
fontSize: 16,
|
|
381
380
|
marginBottom: 24
|
|
382
381
|
},
|
|
383
382
|
className: "cw-joyride-finish-title"
|
|
384
|
-
}, localeObj['watchTaskAgain']), /*#__PURE__*/React.createElement("div", {
|
|
383
|
+
}, formatMessage(localeObj['watchTaskAgain'])), /*#__PURE__*/React.createElement("div", {
|
|
385
384
|
className: "cw-joyride-bottom"
|
|
386
385
|
}, /*#__PURE__*/React.createElement("span", {
|
|
387
386
|
className: "cw-joyride-back",
|
|
388
387
|
onClick: finishHandleCancel
|
|
389
|
-
}, localeObj['no']), /*#__PURE__*/React.createElement("span", {
|
|
388
|
+
}, formatMessage(localeObj['no'])), /*#__PURE__*/React.createElement("span", {
|
|
390
389
|
className: "cw-joyride-enter",
|
|
391
390
|
onClick: finishHandleOk
|
|
392
|
-
}, localeObj['lookAgain'], /*#__PURE__*/React.createElement(_Icon, {
|
|
391
|
+
}, formatMessage(localeObj['lookAgain']), /*#__PURE__*/React.createElement(_Icon, {
|
|
393
392
|
type: "arrow-right",
|
|
394
393
|
className: "cw-joyride-icon"
|
|
395
394
|
}))))));
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import zh_CN from './zh_CN.js';
|
|
2
|
+
import en_US from './en_US.js';
|
|
3
|
+
import zh_TW from './zh_TW.js';
|
|
4
|
+
export default {
|
|
5
|
+
zh_CN: zh_CN,
|
|
6
|
+
en_US: en_US,
|
|
7
|
+
zh_TW: zh_TW,
|
|
8
|
+
// 兼容
|
|
9
|
+
zh: zh_CN,
|
|
10
|
+
en: en_US
|
|
12
11
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'newTask': '我的新手任務',
|
|
3
|
+
'total': '共有',
|
|
4
|
+
'term': '項',
|
|
5
|
+
'task': '任務',
|
|
6
|
+
'subtasks': '子任務',
|
|
7
|
+
'completed': '已完成',
|
|
8
|
+
'notCompleted': '去完成',
|
|
9
|
+
'skip': '跳過',
|
|
10
|
+
'next': '下一步',
|
|
11
|
+
'last': '完成',
|
|
12
|
+
'back': '上一步',
|
|
13
|
+
'welcome': '歡迎來到~',
|
|
14
|
+
'welcomeSystem': '雲智慧IT服務管理系統',
|
|
15
|
+
'notCome': '我不想進入',
|
|
16
|
+
'letGoBegin': '讓我們開始新手指引吧',
|
|
17
|
+
'greatComplete': '非常好!您已經完成此任務!',
|
|
18
|
+
'needNextTask': '需要繼續下一個任務嗎?',
|
|
19
|
+
'notContinue': '不想繼續了',
|
|
20
|
+
'continueNextTask': '繼續下一個任務',
|
|
21
|
+
'congratulations': '恭喜您已經完成所有任務!',
|
|
22
|
+
'watchTaskAgain': '再看一次新手引導嗎?',
|
|
23
|
+
'no': '不了',
|
|
24
|
+
'lookAgain': '再看一次新手指引'
|
|
25
|
+
};
|