@chaoswise/ui 2.3.13 → 2.3.14
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/config/theme/default.less +4 -2
- package/lib/Ace/ace.js +52 -47
- package/lib/Button/index.less +2 -2
- package/lib/Cascader/index.less +14 -10
- package/lib/ColorPicker/index.js +300 -0
- package/lib/ColorPicker/index.less +94 -0
- package/lib/ColorPicker/locale/en_US.js +4 -0
- package/lib/ColorPicker/locale/index.js +12 -0
- package/lib/ColorPicker/locale/zh_CN.js +4 -0
- package/lib/ColorPicker/utils.js +15 -0
- package/lib/IconSelect/components/CustomImg/index.js +93 -0
- package/lib/IconSelect/components/CustomImg/index.less +17 -0
- package/lib/IconSelect/components/SearchIcon/index.js +98 -0
- package/lib/IconSelect/components/SearchIcon/index.less +35 -0
- package/lib/IconSelect/constants/icon.js +13291 -0
- package/lib/IconSelect/index.js +138 -0
- package/lib/IconSelect/index.less +59 -0
- package/lib/IconSelect/locale/en_US.js +11 -0
- package/lib/IconSelect/locale/index.js +12 -0
- package/lib/IconSelect/locale/zh_CN.js +11 -0
- package/lib/QuickTransfer/CheckList.js +1 -1
- package/lib/QuickTransfer/TopicList.js +3 -3
- package/lib/SiderMenu/index.less +2 -1
- package/lib/SiderMenu/utils.js +29 -0
- package/lib/Tooltip/index.less +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import _Dropdown from "@chaoswise/ui/lib/Antd/Dropdown";
|
|
2
|
+
import "@chaoswise/ui/lib/Button/index.less";
|
|
3
|
+
import _Button from "@chaoswise/ui/lib/Button";
|
|
4
|
+
import _Space from "@chaoswise/ui/lib/Space";
|
|
5
|
+
import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
|
|
6
|
+
import "@chaoswise/ui/lib/Tabs/index.less";
|
|
7
|
+
import _Tabs from "@chaoswise/ui/lib/Tabs";
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
import React, { useEffect, useState } from "react";
|
|
15
|
+
import Icon from "@icon-park/react/es/all";
|
|
16
|
+
import CustomImg from "./components/CustomImg";
|
|
17
|
+
import SearchIcon from "./components/SearchIcon";
|
|
18
|
+
import { getLocale } from "./locale";
|
|
19
|
+
import "./index.less";
|
|
20
|
+
import PropTypes from "prop-types";
|
|
21
|
+
var TabPane = _Tabs.TabPane;
|
|
22
|
+
function IconSelect(_ref) {
|
|
23
|
+
var value = _ref.value,
|
|
24
|
+
defaultValue = _ref.defaultValue,
|
|
25
|
+
_ref$onChange = _ref.onChange,
|
|
26
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
27
|
+
_ref$category = _ref.category,
|
|
28
|
+
category = _ref$category === void 0 ? [] : _ref$category,
|
|
29
|
+
iconSelectRender = _ref.iconSelectRender;
|
|
30
|
+
var _useState = useState("icon"),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
iconType = _useState2[0],
|
|
33
|
+
setIconType = _useState2[1]; //选中key 图标库 icon 自定义图片 customImg
|
|
34
|
+
var _useState3 = useState(null),
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
iconInfo = _useState4[0],
|
|
37
|
+
setIconInfo = _useState4[1]; //组件图标数据集合
|
|
38
|
+
var _useState5 = useState(null),
|
|
39
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
40
|
+
customFileInfo = _useState6[0],
|
|
41
|
+
setCustomFileInfo = _useState6[1]; //组件图标数据集合
|
|
42
|
+
|
|
43
|
+
var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
|
|
44
|
+
_ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
|
|
45
|
+
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
46
|
+
var localeObj = getLocale(locale);
|
|
47
|
+
var _value = value || defaultValue;
|
|
48
|
+
|
|
49
|
+
//切换tab
|
|
50
|
+
var changeTab = function changeTab(activeKey) {
|
|
51
|
+
setIconType(activeKey);
|
|
52
|
+
onChange({
|
|
53
|
+
iconInfo: iconInfo,
|
|
54
|
+
customFileInfo: customFileInfo,
|
|
55
|
+
iconType: activeKey
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
if (_value) {
|
|
60
|
+
var _iconInfo = _value.iconInfo,
|
|
61
|
+
_customFileInfo = _value.customFileInfo;
|
|
62
|
+
setIconInfo(_iconInfo);
|
|
63
|
+
setCustomFileInfo(_customFileInfo);
|
|
64
|
+
}
|
|
65
|
+
}, [_value]);
|
|
66
|
+
var menu = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: "icon-select-dropdown",
|
|
68
|
+
onClick: function onClick(e) {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
e.stopPropagation();
|
|
71
|
+
}
|
|
72
|
+
}, /*#__PURE__*/React.createElement(_Tabs, {
|
|
73
|
+
activeKey: iconType,
|
|
74
|
+
onChange: changeTab,
|
|
75
|
+
className: "icon-select-dropdown-tabs"
|
|
76
|
+
}, /*#__PURE__*/React.createElement(TabPane, {
|
|
77
|
+
key: "icon",
|
|
78
|
+
tab: localeObj["icon-select-store-icon"]
|
|
79
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SearchIcon, {
|
|
80
|
+
category: category,
|
|
81
|
+
iconInfo: iconInfo,
|
|
82
|
+
customFileInfo: customFileInfo,
|
|
83
|
+
setIconInfo: setIconInfo,
|
|
84
|
+
onChange: onChange
|
|
85
|
+
}))), /*#__PURE__*/React.createElement(TabPane, {
|
|
86
|
+
key: "customImg",
|
|
87
|
+
tab: localeObj["icon-select-custom-img"]
|
|
88
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CustomImg, {
|
|
89
|
+
iconInfo: iconInfo,
|
|
90
|
+
customFileInfo: customFileInfo,
|
|
91
|
+
setCustomFileInfo: setCustomFileInfo,
|
|
92
|
+
onChange: onChange
|
|
93
|
+
}))))));
|
|
94
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: "img-setting-box"
|
|
96
|
+
}, /*#__PURE__*/React.createElement(_Dropdown, {
|
|
97
|
+
trigger: ["click"],
|
|
98
|
+
overlay: menu
|
|
99
|
+
}, iconSelectRender ? iconSelectRender({
|
|
100
|
+
customFileInfo: customFileInfo,
|
|
101
|
+
iconInfo: iconInfo
|
|
102
|
+
}) : /*#__PURE__*/React.createElement(_Button, null, /*#__PURE__*/React.createElement(_Space, null, /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
className: "img-setting-box-content"
|
|
104
|
+
}, customFileInfo !== null && customFileInfo !== void 0 && customFileInfo.baseCode ? /*#__PURE__*/React.createElement("img", {
|
|
105
|
+
src: customFileInfo === null || customFileInfo === void 0 ? void 0 : customFileInfo.baseCode,
|
|
106
|
+
className: "img-setting-box-content-custom"
|
|
107
|
+
}) : (iconInfo === null || iconInfo === void 0 ? void 0 : iconInfo.name) && /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
className: "img-setting-box-content-icon"
|
|
109
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
110
|
+
type: iconInfo === null || iconInfo === void 0 ? void 0 : iconInfo.name,
|
|
111
|
+
theme: "filled",
|
|
112
|
+
size: "14"
|
|
113
|
+
}))), /*#__PURE__*/React.createElement(Icon, {
|
|
114
|
+
type: "down"
|
|
115
|
+
})))));
|
|
116
|
+
}
|
|
117
|
+
IconSelect.propTypes = {
|
|
118
|
+
defaultValue: PropTypes.shape({
|
|
119
|
+
iconType: PropTypes.string,
|
|
120
|
+
iconInfo: PropTypes.object,
|
|
121
|
+
customFileInfo: PropTypes.object
|
|
122
|
+
}),
|
|
123
|
+
value: PropTypes.shape({
|
|
124
|
+
iconType: PropTypes.string,
|
|
125
|
+
iconInfo: PropTypes.object,
|
|
126
|
+
customFileInfo: PropTypes.object
|
|
127
|
+
}),
|
|
128
|
+
/**
|
|
129
|
+
* 选中项变化时,tab切换时的回调,(value)=>{}
|
|
130
|
+
*/
|
|
131
|
+
onChange: PropTypes.func,
|
|
132
|
+
category: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
133
|
+
/**
|
|
134
|
+
* 自定义Dropdown按钮内容
|
|
135
|
+
*/
|
|
136
|
+
iconSelectRender: PropTypes.func
|
|
137
|
+
};
|
|
138
|
+
export default IconSelect;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
.img-setting-box {
|
|
2
|
+
.img-setting-box-content {
|
|
3
|
+
width: 40px;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
margin-top: 5px;
|
|
7
|
+
|
|
8
|
+
.img-setting-box-content-custom {
|
|
9
|
+
width: 40px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.img-setting-box-content-icon {
|
|
13
|
+
padding-top: 5px;
|
|
14
|
+
text-align: left;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.icon-select-dropdown {
|
|
20
|
+
background: @form-back-font;
|
|
21
|
+
width: 240px;
|
|
22
|
+
border-radius: 4px;
|
|
23
|
+
outline: none;
|
|
24
|
+
-webkit-box-shadow: @box-shadow-base;
|
|
25
|
+
box-shadow: @box-shadow-base;
|
|
26
|
+
|
|
27
|
+
.@{ant-prefix}-tabs-nav {
|
|
28
|
+
margin: 0;
|
|
29
|
+
padding: 0 10px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.img-setting-tabs {
|
|
34
|
+
.@{ant-prefix}-tabs-nav {
|
|
35
|
+
margin: 0;
|
|
36
|
+
padding: 0 5px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.iconInput {
|
|
41
|
+
.@{ant-prefix}-select-selection-selected-value {
|
|
42
|
+
svg {
|
|
43
|
+
width: 16px;
|
|
44
|
+
height: 16px;
|
|
45
|
+
margin-top: 4px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.iconSelect {
|
|
51
|
+
width: 40px;
|
|
52
|
+
// height: 40px;
|
|
53
|
+
display: inline-block;
|
|
54
|
+
|
|
55
|
+
svg {
|
|
56
|
+
width: 16px;
|
|
57
|
+
height: 16px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"icon-select-custom-type": "Files in this format are not supported",
|
|
3
|
+
"icon-select-custom-null": "Cannot upload empty files",
|
|
4
|
+
"icon-select-custom-length": "Img size does not exceed 2M",
|
|
5
|
+
"icon-select-custom-fail": "File reading failure",
|
|
6
|
+
"icon-select-custom-upload": "Upload image",
|
|
7
|
+
"icon-select-store-icon": "Icon library",
|
|
8
|
+
"icon-select-store-search": "Please enter search keywords",
|
|
9
|
+
"icon-select-custom-img": "Customized image",
|
|
10
|
+
"icon-select-custom-img-tip": "Recommend uploading 40*40 image in PNG, SVG, JPG, or JGPG format. Image size can not exceed 2 MB"
|
|
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
|
+
};
|
|
@@ -25,7 +25,7 @@ var CheckList = function CheckList(props) {
|
|
|
25
25
|
handlePreviewList(_toConsumableArray(checkValue)); //更新修改后的列表
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
var isLockSort = checkValue.filter(function (item) {
|
|
28
|
+
var isLockSort = type === "list" && checkValue.filter(function (item) {
|
|
29
29
|
return item.disabled;
|
|
30
30
|
}).length;
|
|
31
31
|
var renderList = function renderList(item, index) {
|
|
@@ -120,7 +120,7 @@ var TopicList = function TopicList(_ref) {
|
|
|
120
120
|
cursor: "move"
|
|
121
121
|
}
|
|
122
122
|
} : {};
|
|
123
|
-
var
|
|
123
|
+
var listLockSortContent = /*#__PURE__*/React.createElement("div", {
|
|
124
124
|
className: "cw-transfer-right-content-item"
|
|
125
125
|
}, /*#__PURE__*/React.createElement("div", {
|
|
126
126
|
className: "cw-transfer-right-content-item-drag-wrapper"
|
|
@@ -128,14 +128,14 @@ var TopicList = function TopicList(_ref) {
|
|
|
128
128
|
title: localeObj["dragAndDrop"]
|
|
129
129
|
}, /*#__PURE__*/React.createElement(DragSvg, null))), /*#__PURE__*/React.createElement("div", {
|
|
130
130
|
className: "cw-transfer-right-content-item-text-wrapper"
|
|
131
|
-
},
|
|
131
|
+
}, render(value)), !disabled && /*#__PURE__*/React.createElement(_Icon, {
|
|
132
132
|
type: "close",
|
|
133
133
|
className: "cw-transfer-right-content-del",
|
|
134
134
|
onClick: function onClick() {
|
|
135
135
|
return handleDeleted(labelValue);
|
|
136
136
|
}
|
|
137
137
|
}));
|
|
138
|
-
var renderItemContent = isLockSort ?
|
|
138
|
+
var renderItemContent = type == "list" && isLockSort ? listLockSortContent : /*#__PURE__*/React.createElement(Fragment, null, dragList && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
139
139
|
title: localeObj["dragAndDrop"]
|
|
140
140
|
}, /*#__PURE__*/React.createElement(DragSvg, {
|
|
141
141
|
className: "cw-transfer-right-content-drag"
|
package/lib/SiderMenu/index.less
CHANGED
|
@@ -559,7 +559,7 @@
|
|
|
559
559
|
width: 12px;
|
|
560
560
|
font-size: 12px;
|
|
561
561
|
line-height: 40px;
|
|
562
|
-
color: @
|
|
562
|
+
color: @menu-dark-arrow-color; // 符合ui规范
|
|
563
563
|
.@{iconfont-css-prefix}{
|
|
564
564
|
min-width: 12px;
|
|
565
565
|
margin-right: 0;
|
|
@@ -567,6 +567,7 @@
|
|
|
567
567
|
transition: transform 0.3s;
|
|
568
568
|
}
|
|
569
569
|
&.cw-expand-arrow-open{
|
|
570
|
+
color: @menu-dark-highlight-color !important;
|
|
570
571
|
.@{iconfont-css-prefix}{
|
|
571
572
|
transform:rotate(180deg);
|
|
572
573
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {*} tree
|
|
10
|
+
* @param {*} pathName
|
|
11
|
+
* @param {*} path
|
|
12
|
+
* @returns 根据pathName遍历树节点将匹配到的pathName和父节点的pathName放入数组中返回
|
|
13
|
+
*/
|
|
14
|
+
export function findPathbyPathName(tree, pathName) {
|
|
15
|
+
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
16
|
+
for (var i = 0; i < tree.length; i++) {
|
|
17
|
+
var tempPath = _toConsumableArray(path);
|
|
18
|
+
tempPath.push(tree[i].pathName);
|
|
19
|
+
if (tree[i].pathName === pathName) {
|
|
20
|
+
return tempPath;
|
|
21
|
+
}
|
|
22
|
+
if (tree[i].children) {
|
|
23
|
+
var reuslt = findPathbyPathName(tree[i].children, pathName, tempPath);
|
|
24
|
+
if (reuslt) {
|
|
25
|
+
return reuslt;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
package/lib/Tooltip/index.less
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaoswise/ui",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.14",
|
|
4
4
|
"description": "公共UI库",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"@chaoswise/utils": "^0.0.30",
|
|
76
76
|
"@formily/antd": "^1.3.17",
|
|
77
77
|
"@formily/antd-components": "^1.3.17",
|
|
78
|
+
"@icon-park/react": "^1.4.2",
|
|
78
79
|
"ant-design-draggable-modal": "0.0.16",
|
|
79
80
|
"antd": "^3.26.19",
|
|
80
81
|
"axios": "^0.21.1",
|
|
@@ -96,6 +97,7 @@
|
|
|
96
97
|
"rc-tabs": "^11.10.0",
|
|
97
98
|
"rc-util": "^5.20.0",
|
|
98
99
|
"re-resizable": "^6.9.0",
|
|
100
|
+
"react-color": "^2.19.3",
|
|
99
101
|
"react-custom-scrollbars": "^4.2.1",
|
|
100
102
|
"react-dnd": "^13.1.1",
|
|
101
103
|
"react-dnd-html5-backend": "^12.1.1",
|
|
@@ -140,5 +142,5 @@
|
|
|
140
142
|
"access": "public"
|
|
141
143
|
},
|
|
142
144
|
"license": "MIT",
|
|
143
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "54815aa55f3cd3e2cbcdc42f09afba456b484d07"
|
|
144
146
|
}
|