@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
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import zh_CN from './zh_CN.js';
|
|
2
|
+
import en_US from './en_US.js';
|
|
3
|
+
import zh_TW from './zh_TW.js';
|
|
4
|
+
export default {
|
|
5
|
+
zh_CN: zh_CN,
|
|
6
|
+
en_US: en_US,
|
|
7
|
+
zh_TW: zh_TW,
|
|
8
|
+
// 兼容
|
|
9
|
+
zh: zh_CN,
|
|
10
|
+
en: en_US
|
|
12
11
|
};
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
3
|
-
* @Date: 2022-05-19 18:52:13
|
|
4
|
-
* @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
|
|
5
|
-
* @LastEditTime: 2022-06-22 15:41:00
|
|
6
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/SearchBar/locale/zh_CN.js
|
|
7
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
-
*/
|
|
9
1
|
export default {
|
|
10
2
|
addCondition: '添加筛选条件',
|
|
11
3
|
advancedFilter: '高级筛选',
|
|
@@ -1416,10 +1416,9 @@ function reroute() {
|
|
|
1416
1416
|
callCapturedEventListeners(eventArguments);
|
|
1417
1417
|
}
|
|
1418
1418
|
function getCustomEventDetail() {
|
|
1419
|
-
var _appsByNewStatus;
|
|
1420
1419
|
var isBeforeChanges = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
1421
1420
|
var newAppStatuses = {};
|
|
1422
|
-
var appsByNewStatus = (
|
|
1421
|
+
var appsByNewStatus = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, MOUNTED, []), NOT_MOUNTED, []), NOT_LOADED, []), SKIP_BECAUSE_BROKEN, []);
|
|
1423
1422
|
if (isBeforeChanges) {
|
|
1424
1423
|
appsToLoad.concat(appsToMount).forEach(function (app, index) {
|
|
1425
1424
|
addApp(app, MOUNTED);
|
package/lib/TreeList/index.js
CHANGED
|
@@ -23,7 +23,6 @@ import './index.less';
|
|
|
23
23
|
* 树形结构列表,自定义列表样式和内容,异步加载交互等
|
|
24
24
|
*/
|
|
25
25
|
var TreeList = function TreeList(_ref) {
|
|
26
|
-
var _classNames;
|
|
27
26
|
var renderNode = _ref.renderNode,
|
|
28
27
|
loadData = _ref.loadData,
|
|
29
28
|
treeData = _ref.treeData,
|
|
@@ -135,7 +134,7 @@ var TreeList = function TreeList(_ref) {
|
|
|
135
134
|
}
|
|
136
135
|
updateExpandedKeys(key);
|
|
137
136
|
};
|
|
138
|
-
var wrapperClassName = classNames((
|
|
137
|
+
var wrapperClassName = classNames(_defineProperty(_defineProperty({}, 'cw-data-auth-tree', true), 'cw-data-auth-tree-no-data', treeData.length === 0));
|
|
139
138
|
if (_loading) {
|
|
140
139
|
return /*#__PURE__*/React.createElement("div", {
|
|
141
140
|
className: wrapperClassName
|
|
@@ -5,7 +5,7 @@ import "@chaoswise/ui/lib/CWTree/index.less";
|
|
|
5
5
|
import _CWTree from "@chaoswise/ui/lib/CWTree";
|
|
6
6
|
import "@chaoswise/ui/lib/Checkbox/index.less";
|
|
7
7
|
import _Checkbox from "@chaoswise/ui/lib/Checkbox";
|
|
8
|
-
import
|
|
8
|
+
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
9
9
|
var _excluded = ["dropdownRender", "treeData", "showCheckAll", "children", "defaultValue", "value", "treeCheckable", "showCheckedStrategy"];
|
|
10
10
|
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); }
|
|
11
11
|
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; }
|
|
@@ -21,20 +21,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
21
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
22
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
23
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
24
|
-
/*
|
|
25
|
-
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
26
|
-
* @Date: 2023-02-13 16:15:13
|
|
27
|
-
* @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
|
|
28
|
-
* @LastEditTime: 2023-02-17 15:26:27
|
|
29
|
-
* @FilePath: /change_01/aops_web_commons/packages/ui/components/TreeSelect/index.js
|
|
30
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
31
|
-
*/
|
|
32
24
|
import React, { useState, useEffect, useMemo, forwardRef, Fragment, useRef } from "react";
|
|
33
25
|
import CWTreeSelect from "../Antd4/tree-select";
|
|
34
26
|
import PropTypes from "prop-types";
|
|
35
27
|
import { getTreeData, flatTree, changeTreeData, getChild, getFilterPidKey } from "./utils";
|
|
36
|
-
import { getLocale } from "./locale";
|
|
37
28
|
import _ from "lodash";
|
|
29
|
+
import langConfig from './locale';
|
|
30
|
+
import { formatMessage } from "../utils";
|
|
38
31
|
import "../Antd4/tree-select/style/index.less";
|
|
39
32
|
import "./index.less";
|
|
40
33
|
var TreeSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -49,10 +42,8 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
49
42
|
treeCheckable = props.treeCheckable,
|
|
50
43
|
showCheckedStrategy = props.showCheckedStrategy,
|
|
51
44
|
rest = _objectWithoutProperties(props, _excluded);
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
55
|
-
var localeObj = getLocale(locale);
|
|
45
|
+
var _useLocale = _useLocale2(langConfig),
|
|
46
|
+
localeObj = _useLocale.langObj;
|
|
56
47
|
var treeRef = useRef(null);
|
|
57
48
|
// 全选模式选中项
|
|
58
49
|
var _useState = useState([]),
|
|
@@ -125,7 +116,7 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
125
116
|
style: {
|
|
126
117
|
width: "100%"
|
|
127
118
|
}
|
|
128
|
-
}, localeObj["checkAll"], "(", treeSelectedKeys.length, "/", flatTreeData.length, ")")), /*#__PURE__*/React.createElement(_CWTree, {
|
|
119
|
+
}, formatMessage(localeObj["checkAll"]), "(", treeSelectedKeys.length, "/", flatTreeData.length, ")")), /*#__PURE__*/React.createElement(_CWTree, {
|
|
129
120
|
ref: treeRef,
|
|
130
121
|
treeData: _treeData,
|
|
131
122
|
checkable: true,
|
|
@@ -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
|
};
|
package/lib/WangEditor/index.js
CHANGED
|
@@ -6,9 +6,16 @@ import React, { useEffect, Fragment, useRef, forwardRef } from "react";
|
|
|
6
6
|
import E from "./wangEditor";
|
|
7
7
|
import PropTypes from "prop-types";
|
|
8
8
|
import "./index.less";
|
|
9
|
-
import { localeObj } from "./locale/index";
|
|
9
|
+
import { localeObj, localObjTW } from "./locale/index";
|
|
10
10
|
import usePreview from "../usePreview";
|
|
11
11
|
import resizeable from "./resizeable";
|
|
12
|
+
var localOptionsMap = {
|
|
13
|
+
en: localeObj,
|
|
14
|
+
en_US: localeObj,
|
|
15
|
+
zh_TW: localObjTW,
|
|
16
|
+
zh: {},
|
|
17
|
+
zh_CN: {}
|
|
18
|
+
};
|
|
12
19
|
/**
|
|
13
20
|
* 基于wangEditor封装 支持value受控 ref获取editor实例;
|
|
14
21
|
* 如当前API无法满足使用,请查阅官方文档,使用ref获取editor实例来进行操作
|
|
@@ -46,7 +53,8 @@ var WangEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
46
53
|
var separaBotRef = useRef(null);
|
|
47
54
|
var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
|
|
48
55
|
_ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
|
|
49
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "
|
|
56
|
+
locale = _ConfigProvider$useLo2 === void 0 ? "zh_CN" : _ConfigProvider$useLo2;
|
|
57
|
+
|
|
50
58
|
// 初始化编辑器
|
|
51
59
|
useEffect(function () {
|
|
52
60
|
var notSepaDom = notSeparationRef.current;
|
|
@@ -83,7 +91,7 @@ var WangEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
83
91
|
});
|
|
84
92
|
imgList.push({
|
|
85
93
|
src: img === null || img === void 0 ? void 0 : img.getAttribute("src"),
|
|
86
|
-
alt:
|
|
94
|
+
alt: ""
|
|
87
95
|
});
|
|
88
96
|
if (isUsePreview) {
|
|
89
97
|
img.ondblclick = function (e) {
|
|
@@ -94,7 +102,7 @@ var WangEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
94
102
|
});
|
|
95
103
|
useEffect(function () {
|
|
96
104
|
// 切换语言
|
|
97
|
-
editor.current.customConfig.lang = locale
|
|
105
|
+
editor.current.customConfig.lang = localOptionsMap[locale];
|
|
98
106
|
editor.current._initConfig();
|
|
99
107
|
editor.current.$toolbarElem.html("");
|
|
100
108
|
editor.current._initMenus();
|
|
@@ -125,9 +133,7 @@ var WangEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
125
133
|
editor.customConfig.onblur = onBlur;
|
|
126
134
|
editor.customConfig.onfocus = onFocus;
|
|
127
135
|
editor.customConfig.pasteTextHandle = pasteTextHandle;
|
|
128
|
-
|
|
129
|
-
editor.customConfig.lang = localeObj;
|
|
130
|
-
}
|
|
136
|
+
editor.customConfig.lang = localOptionsMap[locale];
|
|
131
137
|
for (var i in rest) {
|
|
132
138
|
editor.customConfig[i] = rest[i];
|
|
133
139
|
}
|
|
@@ -1,31 +1,62 @@
|
|
|
1
1
|
export var localeObj = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
设置标题: "Heading",
|
|
3
|
+
正文: "Normal",
|
|
4
|
+
链接文字: "Link text",
|
|
5
|
+
链接: "Link",
|
|
6
|
+
上传图片: "Local",
|
|
7
|
+
上传: "Upload",
|
|
8
|
+
有序列表: "Ordered list",
|
|
9
|
+
无序列表: "Unordered list",
|
|
10
|
+
靠左: "Left",
|
|
11
|
+
居中: "Center",
|
|
12
|
+
靠右: "Right",
|
|
13
|
+
字号: "Font size",
|
|
14
|
+
字体: "Font",
|
|
15
|
+
文字颜色: "Font color",
|
|
16
|
+
背景色: "Background color",
|
|
17
|
+
设置列表: "List",
|
|
18
|
+
插入代码: "Code",
|
|
19
|
+
插入视频: "Video",
|
|
20
|
+
格式如: "Format example",
|
|
21
|
+
插入表格: "Table",
|
|
22
|
+
列的表格: "columns",
|
|
23
|
+
行: "rows",
|
|
24
|
+
默认: "Default",
|
|
25
|
+
新浪: "Sina",
|
|
26
|
+
对齐方式: "Alignment",
|
|
27
|
+
网络图片: "Web",
|
|
28
|
+
插入: "Insert",
|
|
29
|
+
创建: "Create",
|
|
30
|
+
图片: "Image "
|
|
31
|
+
};
|
|
32
|
+
export var localObjTW = {
|
|
33
|
+
设置标题: "設置標題",
|
|
34
|
+
正文: "正文",
|
|
35
|
+
链接文字: "鏈接文字",
|
|
36
|
+
链接: "鏈接",
|
|
37
|
+
上传图片: "上傳圖片",
|
|
38
|
+
上传: "上傳",
|
|
39
|
+
有序列表: "有序列表",
|
|
40
|
+
无序列表: "無序列表",
|
|
41
|
+
靠左: "靠左",
|
|
42
|
+
居中: "居中",
|
|
43
|
+
靠右: "靠右",
|
|
44
|
+
字号: "字號",
|
|
45
|
+
字体: "字體",
|
|
46
|
+
文字颜色: "文字顏色",
|
|
47
|
+
背景色: "背景色",
|
|
48
|
+
设置列表: "設置列表",
|
|
49
|
+
插入代码: "插入代碼",
|
|
50
|
+
插入视频: "插入視頻",
|
|
51
|
+
格式如: "格式如",
|
|
52
|
+
插入表格: "插入表格",
|
|
53
|
+
列的表格: "列的表格",
|
|
54
|
+
行: "行",
|
|
55
|
+
默认: "默認",
|
|
56
|
+
新浪: "新浪",
|
|
57
|
+
对齐方式: "對齊方式",
|
|
58
|
+
网络图片: "網絡圖片",
|
|
59
|
+
插入: "插入",
|
|
60
|
+
创建: "創建",
|
|
61
|
+
图片: "圖片"
|
|
31
62
|
};
|
package/lib/Watermark/index.js
CHANGED
package/lib/message/index.js
CHANGED
|
@@ -73,7 +73,6 @@ function notice(args) {
|
|
|
73
73
|
return resolve(true);
|
|
74
74
|
};
|
|
75
75
|
getMessageInstance(function (instance) {
|
|
76
|
-
var _classnames;
|
|
77
76
|
var iconNode = /*#__PURE__*/React.createElement(_Icon, {
|
|
78
77
|
type: iconType,
|
|
79
78
|
theme: iconType === "loading" ? "outlined" : "filled",
|
|
@@ -90,9 +89,9 @@ function notice(args) {
|
|
|
90
89
|
"cw-message-wrapper-has-dec": args.dec
|
|
91
90
|
})
|
|
92
91
|
}, /*#__PURE__*/React.createElement("div", {
|
|
93
|
-
className: classnames((
|
|
92
|
+
className: classnames(_defineProperty(_defineProperty({
|
|
94
93
|
"cw-message-title": true
|
|
95
|
-
},
|
|
94
|
+
}, "".concat(prefixCls, "-custom-content"), true), "".concat(prefixCls, "-").concat(args.type), args.type))
|
|
96
95
|
}, args.icon ? args.icon : switchIconNode, /*#__PURE__*/React.createElement("span", {
|
|
97
96
|
className: "cw-message-content"
|
|
98
97
|
}, args.content), closable && /*#__PURE__*/React.createElement("span", {
|
package/lib/utils/index.js
CHANGED
|
@@ -75,4 +75,15 @@ export var eventManager = {
|
|
|
75
75
|
}
|
|
76
76
|
return this;
|
|
77
77
|
}
|
|
78
|
+
};
|
|
79
|
+
export var formatMessage = function formatMessage(message) {
|
|
80
|
+
var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
81
|
+
if (message) {
|
|
82
|
+
// 替换消息中的占位符
|
|
83
|
+
return message.replace(/{([^}]+)}/g, function (match, p1) {
|
|
84
|
+
return values[p1] || "";
|
|
85
|
+
});
|
|
86
|
+
} else {
|
|
87
|
+
return "未找到对应的翻译信息";
|
|
88
|
+
}
|
|
78
89
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaoswise/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "公共UI库",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"access": "public"
|
|
144
144
|
},
|
|
145
145
|
"license": "MIT",
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "1ed8349a4b9153e90b072cc27cc5531ce6524e55"
|
|
147
147
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg width="7px" height="12px" viewBox="0 0 7 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
-
<title>形状</title>
|
|
4
|
-
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.65">
|
|
5
|
-
<g id="4.2请求列表下钻-—快照请求列表页" transform="translate(-1368.000000, -705.000000)" fill="#000000" fill-rule="nonzero">
|
|
6
|
-
<g id="编组-11" transform="translate(232.000000, 554.000000)">
|
|
7
|
-
<g id="默认" transform="translate(857.000000, 10.000000)">
|
|
8
|
-
<g id="源列表" transform="translate(143.000000, 34.000000)">
|
|
9
|
-
<g id="拖拽备份-3" transform="translate(132.000000, 105.000000)">
|
|
10
|
-
<path d="M9.91111111,2 C9.37777778,2 8.97777778,2.4 8.97777778,2.93333333 C8.97777778,3.46666666 9.42222222,3.86666667 9.91111111,3.86666667 C10.4444444,3.86666667 10.8444444,3.46666667 10.8444444,2.93333333 C10.8888889,2.4 10.4444444,2 9.91111111,2 Z M9.91111111,6.71111111 C9.37777778,6.71111111 8.97777778,7.11111111 8.97777778,7.64444444 C8.97777778,8.17777777 9.42222222,8.57777778 9.91111111,8.57777778 C10.4444444,8.57777778 10.8444444,8.17777778 10.8444444,7.64444444 C10.8888889,7.11111111 10.4444444,6.71111111 9.91111111,6.71111111 Z M9.91111111,11.4222222 C9.37777778,11.4222222 8.97777778,11.8222222 8.97777778,12.3555556 C8.97777778,12.8888889 9.42222222,13.2888889 9.91111111,13.2888889 C10.4444444,13.2888889 10.8444444,12.8888889 10.8444444,12.3555556 C10.8888889,11.8222222 10.4444444,11.4222222 9.91111111,11.4222222 C9.42222222,11.4222222 9.91111111,11.4222222 9.91111111,11.4222222 Z M5.82222222,2 C5.33333333,2 4.88888889,2.4 4.88888889,2.93333333 C4.88888889,3.46666666 5.33333333,3.86666667 5.82222222,3.86666667 C6.35555555,3.86666667 6.75555555,3.46666667 6.75555556,2.93333333 C6.8,2.4 6.35555556,2 5.82222222,2 Z M5.82222222,6.71111111 C5.28888889,6.71111111 4.88888889,7.11111111 4.88888889,7.64444444 C4.88888889,8.17777777 5.33333333,8.57777778 5.82222222,8.57777778 C6.35555555,8.57777778 6.75555555,8.17777778 6.75555556,7.64444444 C6.8,7.11111111 6.35555556,6.71111111 5.82222222,6.71111111 Z M5.82222222,11.4222222 C5.28888889,11.4222222 4.88888889,11.8222222 4.88888889,12.3555556 C4.88888889,12.8888889 5.33333333,13.2888889 5.82222222,13.2888889 C6.35555555,13.2888889 6.75555555,12.8888889 6.75555556,12.3555556 C6.8,11.8222222 6.35555556,11.4222222 5.82222222,11.4222222 Z" id="形状"></path>
|
|
11
|
-
</g>
|
|
12
|
-
</g>
|
|
13
|
-
</g>
|
|
14
|
-
</g>
|
|
15
|
-
</g>
|
|
16
|
-
</g>
|
|
17
|
-
</svg>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
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); }
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
-
import React, { Fragment } from 'react';
|
|
9
|
-
import TopicList from './TopicList';
|
|
10
|
-
import { DndProvider } from "react-dnd";
|
|
11
|
-
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
12
|
-
var CheckList = function CheckList(props) {
|
|
13
|
-
var checkValue = props.checkValue,
|
|
14
|
-
handleDelete = props.handleDelete,
|
|
15
|
-
handlePreviewList = props.handlePreviewList,
|
|
16
|
-
type = props.type,
|
|
17
|
-
render = props.render,
|
|
18
|
-
renderColumns = props.renderColumns,
|
|
19
|
-
dragList = props.dragList,
|
|
20
|
-
useDndProvider = props.useDndProvider;
|
|
21
|
-
var moveList = function moveList(dragIndex, hoverIndex) {
|
|
22
|
-
var tmp = checkValue[dragIndex]; //临时储存文件
|
|
23
|
-
checkValue.splice(dragIndex, 1); //移除拖拽项
|
|
24
|
-
checkValue.splice(hoverIndex, 0, tmp); //插入放置项
|
|
25
|
-
handlePreviewList(_toConsumableArray(checkValue)); //更新修改后的列表
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var isLockSort = type === "list" && checkValue.filter(function (item) {
|
|
29
|
-
return item.disabled;
|
|
30
|
-
}).length;
|
|
31
|
-
var renderList = function renderList(item, index) {
|
|
32
|
-
return /*#__PURE__*/React.createElement(TopicList, _extends({
|
|
33
|
-
labelValue: item,
|
|
34
|
-
type: type,
|
|
35
|
-
renderColumns: renderColumns,
|
|
36
|
-
label: item.key,
|
|
37
|
-
value: item.title && item.title,
|
|
38
|
-
index: index,
|
|
39
|
-
render: render,
|
|
40
|
-
key: item.key,
|
|
41
|
-
handleDelete: handleDelete,
|
|
42
|
-
moveList: moveList,
|
|
43
|
-
dragList: dragList,
|
|
44
|
-
useDndProvider: useDndProvider,
|
|
45
|
-
isLockSort: isLockSort
|
|
46
|
-
}, item));
|
|
47
|
-
};
|
|
48
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(DndProvider, {
|
|
49
|
-
backend: HTML5Backend
|
|
50
|
-
}, checkValue.map(function (item, index) {
|
|
51
|
-
return renderList(item, index);
|
|
52
|
-
})));
|
|
53
|
-
};
|
|
54
|
-
export default CheckList;
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
2
|
-
import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
3
|
-
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
4
|
-
import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
|
|
5
|
-
var _excluded = ["label", "value", "index", "handleDelete", "labelValue", "moveList", "type", "renderColumns", "render", "dragList", "disabled", "isLockSort"];
|
|
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
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
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."); }
|
|
9
|
-
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); }
|
|
10
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
-
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; } }
|
|
12
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
-
import React, { Fragment, useRef } from "react";
|
|
16
|
-
import { useDrag, useDrop } from "react-dnd";
|
|
17
|
-
import classnames from "classnames";
|
|
18
|
-
import { getLocale } from "./locale";
|
|
19
|
-
import LockSvg from "./assets/LockSvg";
|
|
20
|
-
import DragSvg from "./assets/DragSvg";
|
|
21
|
-
var TopicList = function TopicList(_ref) {
|
|
22
|
-
var label = _ref.label,
|
|
23
|
-
value = _ref.value,
|
|
24
|
-
index = _ref.index,
|
|
25
|
-
handleDelete = _ref.handleDelete,
|
|
26
|
-
labelValue = _ref.labelValue,
|
|
27
|
-
moveList = _ref.moveList,
|
|
28
|
-
type = _ref.type,
|
|
29
|
-
renderColumns = _ref.renderColumns,
|
|
30
|
-
render = _ref.render,
|
|
31
|
-
dragList = _ref.dragList,
|
|
32
|
-
disabled = _ref.disabled,
|
|
33
|
-
isLockSort = _ref.isLockSort,
|
|
34
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
-
// 获取当前语言
|
|
36
|
-
var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
|
|
37
|
-
_ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
|
|
38
|
-
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
39
|
-
var localeObj = getLocale(locale);
|
|
40
|
-
var dragRef = useRef(null);
|
|
41
|
-
var _useDrag = useDrag({
|
|
42
|
-
item: {
|
|
43
|
-
type: "child",
|
|
44
|
-
value: value,
|
|
45
|
-
index: index,
|
|
46
|
-
label: label,
|
|
47
|
-
labelValue: labelValue
|
|
48
|
-
}
|
|
49
|
-
}),
|
|
50
|
-
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
51
|
-
drag = _useDrag2[1];
|
|
52
|
-
var _useDrop = useDrop({
|
|
53
|
-
accept: "child",
|
|
54
|
-
hover: function hover(item, monitor) {
|
|
55
|
-
//拖拽目标的Index
|
|
56
|
-
var dragIndex = item.index;
|
|
57
|
-
//放置目标Index
|
|
58
|
-
var hoverIndex = index;
|
|
59
|
-
// 如果拖拽目标和放置目标相同的话,停止执行
|
|
60
|
-
if (dragIndex === hoverIndex) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
//如果不做以下处理,则卡片移动到另一个卡片上就会进行交换,下方处理使得卡片能够在跨过中心线后进行交换.
|
|
64
|
-
//获取卡片的边框矩形
|
|
65
|
-
// const hoverBoundingRect = dragRef.current.getBoundingClientRect();
|
|
66
|
-
// //获取X轴中点
|
|
67
|
-
// const hoverMiddleY =
|
|
68
|
-
// (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
|
69
|
-
// //获取拖拽目标偏移量
|
|
70
|
-
// const clientOffset = monitor.getClientOffset();
|
|
71
|
-
// const hoverClientY = clientOffset.y - hoverBoundingRect.top;
|
|
72
|
-
// 从上往下放置
|
|
73
|
-
// if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {
|
|
74
|
-
// return;
|
|
75
|
-
// }
|
|
76
|
-
// // 从下往上放置
|
|
77
|
-
// if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {
|
|
78
|
-
// return;
|
|
79
|
-
// }
|
|
80
|
-
moveList(dragIndex, hoverIndex); //调用方法完成交换
|
|
81
|
-
item.index = hoverIndex; //重新赋值index,否则会出现无限交换情况
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
collect: function collect(monitor) {
|
|
85
|
-
var _ref2 = monitor.getItem() || {},
|
|
86
|
-
dragIndex = _ref2.index;
|
|
87
|
-
if (dragIndex === index) {
|
|
88
|
-
return {};
|
|
89
|
-
}
|
|
90
|
-
return {
|
|
91
|
-
isOver: monitor.isOver(),
|
|
92
|
-
dropClassName: dragIndex < index ? "drop-over-downward" : "drop-over-upward"
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
// drop: (item) => {
|
|
96
|
-
// moveList(item.index, index);
|
|
97
|
-
// },
|
|
98
|
-
}),
|
|
99
|
-
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
100
|
-
_useDrop2$ = _useDrop2[0],
|
|
101
|
-
isOver = _useDrop2$.isOver,
|
|
102
|
-
dropClassName = _useDrop2$.dropClassName,
|
|
103
|
-
drop = _useDrop2[1];
|
|
104
|
-
var handleDeleted = function handleDeleted(labelValue) {
|
|
105
|
-
handleDelete(labelValue);
|
|
106
|
-
};
|
|
107
|
-
var renderTable = function renderTable(labelValue) {
|
|
108
|
-
return /*#__PURE__*/React.createElement("div", null, renderColumns.map(function (item, index) {
|
|
109
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
110
|
-
style: {
|
|
111
|
-
marginRight: "8px"
|
|
112
|
-
},
|
|
113
|
-
key: index
|
|
114
|
-
}, render(labelValue[item]));
|
|
115
|
-
}));
|
|
116
|
-
};
|
|
117
|
-
var dragProps = dragList && !disabled ? {
|
|
118
|
-
ref: drag(drop(dragRef)),
|
|
119
|
-
style: {
|
|
120
|
-
cursor: "move"
|
|
121
|
-
}
|
|
122
|
-
} : {};
|
|
123
|
-
var listLockSortContent = /*#__PURE__*/React.createElement("div", {
|
|
124
|
-
className: "cw-transfer-right-content-item"
|
|
125
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
126
|
-
className: "cw-transfer-right-content-item-drag-wrapper"
|
|
127
|
-
}, disabled ? /*#__PURE__*/React.createElement(LockSvg, null) : /*#__PURE__*/React.createElement(_Tooltip, {
|
|
128
|
-
title: localeObj["dragAndDrop"]
|
|
129
|
-
}, /*#__PURE__*/React.createElement(DragSvg, null))), /*#__PURE__*/React.createElement("div", {
|
|
130
|
-
className: "cw-transfer-right-content-item-text-wrapper"
|
|
131
|
-
}, render(value)), !disabled && /*#__PURE__*/React.createElement(_Icon, {
|
|
132
|
-
type: "close",
|
|
133
|
-
className: "cw-transfer-right-content-del",
|
|
134
|
-
onClick: function onClick() {
|
|
135
|
-
return handleDeleted(labelValue);
|
|
136
|
-
}
|
|
137
|
-
}));
|
|
138
|
-
var renderItemContent = type == "list" && isLockSort ? listLockSortContent : /*#__PURE__*/React.createElement(Fragment, null, dragList && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
139
|
-
title: localeObj["dragAndDrop"]
|
|
140
|
-
}, /*#__PURE__*/React.createElement(DragSvg, {
|
|
141
|
-
className: "cw-transfer-right-content-drag"
|
|
142
|
-
})), /*#__PURE__*/React.createElement("div", null, type === "table" ? renderTable(labelValue) : render(value)), /*#__PURE__*/React.createElement(_Icon, {
|
|
143
|
-
type: "close",
|
|
144
|
-
className: "cw-transfer-right-content-del",
|
|
145
|
-
onClick: function onClick() {
|
|
146
|
-
return handleDeleted(labelValue);
|
|
147
|
-
}
|
|
148
|
-
}));
|
|
149
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
150
|
-
className: classnames("cw-transfer-right-content-main")
|
|
151
|
-
}, dragProps), renderItemContent));
|
|
152
|
-
};
|
|
153
|
-
export default TopicList;
|