@chaoswise/ui 2.3.4 → 2.3.6
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/AbreastLayout/index.js +2 -2
- package/lib/CWCascader/rc-cascader/OptionList/index.js +2 -2
- package/lib/CWCascader/rc-cascader/hooks/useDisplayValues.js +2 -2
- package/lib/CWMessage/index.js +11 -7
- package/lib/CWRangePicker/DropdownMenu/index.js +6 -3
- package/lib/CWRangePicker/Refresh/index.js +9 -16
- package/lib/CWRangePicker/TimeSpan/index.js +16 -35
- package/lib/CWRangePicker/index.js +53 -50
- package/lib/CWRangePicker/locale/en_US.js +3 -2
- package/lib/CWRangePicker/locale/zh_CN.js +3 -2
- package/lib/CWRangePicker/utils/index.js +69 -34
- package/lib/CWSelect/DragTag/index.js +52 -0
- package/lib/CWSelect/Tag.js +3 -11
- package/lib/CWSelect/index.js +8 -45
- package/lib/CWTable/EditLine.js +1 -1
- package/lib/CWTree/index.js +11 -6
- package/lib/ErrorBoundary/index.js +4 -0
- package/lib/Input/InputComponent.js +2 -2
- package/lib/Pagination/index.js +9 -3
- package/lib/QuickTransfer/CheckList.js +1 -1
- package/lib/QuickTransfer/NoDrag.js +1 -1
- package/lib/QuickTransfer/NotDragList.js +4 -5
- package/lib/QuickTransfer/TopicList.js +3 -3
- package/lib/QuickTransfer/index.js +10 -5
- package/lib/QuickTransfer/utils.js +75 -7
- package/lib/SearchBar/index.js +2 -2
- package/lib/SingleSpa/index.js +2 -2
- package/lib/ThemeProvider/utils.js +1 -1
- package/lib/WangEditor/wangEditor.js +2 -2
- package/package.json +2 -2
|
@@ -35,7 +35,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
35
35
|
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; }
|
|
36
36
|
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; }
|
|
37
37
|
import React, { useState, useEffect, Fragment, forwardRef, useMemo } from "react";
|
|
38
|
-
import { filterTreeByName, filterTreeByNameTable, filterObj, getNotSelectKeys, getKeysAndTitle, getBottomKey, renderLeafNodetree, renderRelationNode } from "./utils";
|
|
38
|
+
import { filterTreeByName, filterTree, filterTreeByNameTable, filterObj, getNotSelectKeys, getKeysAndTitle, getBottomKey, renderLeafNodetree, renderRelationNode } from "./utils";
|
|
39
39
|
import classnames from "classnames";
|
|
40
40
|
import CheckList from "./CheckList";
|
|
41
41
|
import PropTypes from "prop-types";
|
|
@@ -251,6 +251,11 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
251
251
|
});
|
|
252
252
|
findValue && finalCheckValue.push(findValue);
|
|
253
253
|
});
|
|
254
|
+
finalCheckValue = finalCheckValue.filter(function (i) {
|
|
255
|
+
return i.disabled;
|
|
256
|
+
}).concat(finalCheckValue.filter(function (i) {
|
|
257
|
+
return !i.disabled;
|
|
258
|
+
}));
|
|
254
259
|
setCheckValue(finalCheckValue);
|
|
255
260
|
}
|
|
256
261
|
//回显table
|
|
@@ -297,7 +302,7 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
297
302
|
});
|
|
298
303
|
}
|
|
299
304
|
if (type === "tree") {
|
|
300
|
-
newCheckedValue =
|
|
305
|
+
newCheckedValue = filterTree(checkValue, searchValue);
|
|
301
306
|
}
|
|
302
307
|
if (type === "table") {
|
|
303
308
|
newCheckedValue = filterTreeByNameTable(checkValue, searchValue, renderColumns ? renderColumns : newRenderColumns);
|
|
@@ -336,7 +341,7 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
336
341
|
setListCheckedStyle(listCheckedKeys_, newData);
|
|
337
342
|
}
|
|
338
343
|
if (type === "tree") {
|
|
339
|
-
newData =
|
|
344
|
+
newData = filterTree(dataSource, searchValue);
|
|
340
345
|
setData(newData);
|
|
341
346
|
}
|
|
342
347
|
if (type === "table") {
|
|
@@ -684,7 +689,7 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
684
689
|
}, treeRest));
|
|
685
690
|
}
|
|
686
691
|
};
|
|
687
|
-
var
|
|
692
|
+
var renderRightList = searchCheckedValue.length === 0 ? /*#__PURE__*/React.createElement(_Empty, {
|
|
688
693
|
description: localeObj["pleaseSelectFromLeft"]
|
|
689
694
|
}) : useDndProvider ? /*#__PURE__*/React.createElement(CheckList, {
|
|
690
695
|
checkValue: searchCheckedValue,
|
|
@@ -754,7 +759,7 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
754
759
|
className: "cw-transfer-right-header-clear"
|
|
755
760
|
}, localeObj.clear)) : /*#__PURE__*/React.createElement(Fragment, null, rightHeader)), /*#__PURE__*/React.createElement("div", {
|
|
756
761
|
className: "cw-transfer-right-main-wrapper"
|
|
757
|
-
},
|
|
762
|
+
}, renderRightList)), rightFooter && /*#__PURE__*/React.createElement("div", {
|
|
758
763
|
className: "cw-transfer-footer"
|
|
759
764
|
}, rightFooter))));
|
|
760
765
|
});
|
|
@@ -27,7 +27,7 @@ export var isShowByloopChidren = function isShowByloopChidren(list, searchInfo)
|
|
|
27
27
|
};
|
|
28
28
|
//搜索树
|
|
29
29
|
export var filterTreeByName = function filterTreeByName(organizationList, searchValue) {
|
|
30
|
-
if (searchValue
|
|
30
|
+
if (!searchValue) {
|
|
31
31
|
return organizationList;
|
|
32
32
|
}
|
|
33
33
|
//先过滤最顶层树
|
|
@@ -48,6 +48,55 @@ export var filterTreeByName = function filterTreeByName(organizationList, search
|
|
|
48
48
|
return item;
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
|
+
export var KMPMatch = function KMPMatch(str, pattern) {
|
|
52
|
+
var next = generateNextArr(pattern);
|
|
53
|
+
var i = 0; // str 指针
|
|
54
|
+
var j = 0; // pattern指针
|
|
55
|
+
while (i < str.length && j < pattern.length) {
|
|
56
|
+
if (str[i] === pattern[j] || j === -1) {
|
|
57
|
+
i++;
|
|
58
|
+
j++;
|
|
59
|
+
} else {
|
|
60
|
+
j = next[j]; // 右移
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (j === pattern.length) {
|
|
65
|
+
return i - j;
|
|
66
|
+
} else {
|
|
67
|
+
return -1;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
function generateNextArr(pattern) {
|
|
71
|
+
var i = 0;
|
|
72
|
+
var j = -1;
|
|
73
|
+
var next = [];
|
|
74
|
+
next[0] = -1;
|
|
75
|
+
while (i < pattern.length) {
|
|
76
|
+
if (j === -1 || pattern[i] === pattern[j]) {
|
|
77
|
+
i++;
|
|
78
|
+
j++;
|
|
79
|
+
next[i] = j;
|
|
80
|
+
} else {
|
|
81
|
+
j = next[j];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return next;
|
|
85
|
+
}
|
|
86
|
+
export var filterTree = function filterTree(list, searchValue) {
|
|
87
|
+
return list.reduce(function (t, c) {
|
|
88
|
+
if (!searchValue) {
|
|
89
|
+
return t.concat(c);
|
|
90
|
+
} else {
|
|
91
|
+
var title = c.title,
|
|
92
|
+
children = c.children;
|
|
93
|
+
var res = children ? filterTree(children, searchValue) : undefined;
|
|
94
|
+
return KMPMatch(title.toLowerCase(), searchValue.toLowerCase()) > -1 || res && res.length > 0 ? t.concat(children ? _objectSpread(_objectSpread({}, c), {}, {
|
|
95
|
+
children: res
|
|
96
|
+
}) : c) : t;
|
|
97
|
+
}
|
|
98
|
+
}, []);
|
|
99
|
+
};
|
|
51
100
|
export var isShowByloopChidrenTable = function isShowByloopChidrenTable(list, searchInfo, searchColumns) {
|
|
52
101
|
var isTrue = false;
|
|
53
102
|
var _loop = function _loop() {
|
|
@@ -115,7 +164,9 @@ export var filterObj = function filterObj(arr) {
|
|
|
115
164
|
export var getNotSelectKeys = function getNotSelectKeys(arr) {
|
|
116
165
|
var keys = [];
|
|
117
166
|
arr.map(function (item) {
|
|
118
|
-
|
|
167
|
+
var _ref = item.props || {},
|
|
168
|
+
disabled = _ref.disabled;
|
|
169
|
+
!disabled && keys.push(item.key);
|
|
119
170
|
if (item.props.children && item.props.children.length > 0) {
|
|
120
171
|
keys = keys.concat(getNotSelectKeys(item.props.children));
|
|
121
172
|
}
|
|
@@ -125,10 +176,13 @@ export var getNotSelectKeys = function getNotSelectKeys(arr) {
|
|
|
125
176
|
export var getKeysAndTitle = function getKeysAndTitle(arr) {
|
|
126
177
|
var keys = [];
|
|
127
178
|
arr.map(function (item) {
|
|
128
|
-
|
|
179
|
+
var _ref2 = item.props || {},
|
|
180
|
+
disabled = _ref2.disabled;
|
|
181
|
+
!disabled && keys.push({
|
|
129
182
|
key: item.key,
|
|
130
|
-
title: item.props.title
|
|
183
|
+
title: item.props.originTitle // 不能用item.props.title(节点形式)
|
|
131
184
|
});
|
|
185
|
+
|
|
132
186
|
if (item.props.children && item.props.children.length > 0) {
|
|
133
187
|
keys = keys.concat(getKeysAndTitle(item.props.children));
|
|
134
188
|
}
|
|
@@ -141,9 +195,12 @@ export var getBottomKey = function getBottomKey(arr) {
|
|
|
141
195
|
if (item.props.children && item.props.children.length > 0) {
|
|
142
196
|
keys = keys.concat(getBottomKey(item.props.children));
|
|
143
197
|
} else {
|
|
144
|
-
|
|
198
|
+
var _ref3 = item.props || {},
|
|
199
|
+
disabled = _ref3.disabled;
|
|
200
|
+
!disabled && keys.push({
|
|
145
201
|
key: item.key,
|
|
146
|
-
title: item.props.
|
|
202
|
+
title: item.props.originTitle,
|
|
203
|
+
// 不能用item.props.title(节点形式)
|
|
147
204
|
children: item.props.children
|
|
148
205
|
});
|
|
149
206
|
}
|
|
@@ -159,7 +216,8 @@ export var renderLeafNodetree = function renderLeafNodetree(targetKeys, dataSour
|
|
|
159
216
|
} else {
|
|
160
217
|
newArr.push({
|
|
161
218
|
key: item.key,
|
|
162
|
-
title: item.title
|
|
219
|
+
title: item.title,
|
|
220
|
+
disabled: item.disabled
|
|
163
221
|
});
|
|
164
222
|
}
|
|
165
223
|
});
|
|
@@ -169,6 +227,11 @@ export var renderLeafNodetree = function renderLeafNodetree(targetKeys, dataSour
|
|
|
169
227
|
});
|
|
170
228
|
findValue && finalCheckValue.push(findValue);
|
|
171
229
|
});
|
|
230
|
+
finalCheckValue = finalCheckValue.filter(function (i) {
|
|
231
|
+
return i.disabled;
|
|
232
|
+
}).concat(finalCheckValue.filter(function (i) {
|
|
233
|
+
return !i.disabled;
|
|
234
|
+
}));
|
|
172
235
|
// return newArr.filter(item=>targetKeys.includes(item.key))
|
|
173
236
|
return finalCheckValue;
|
|
174
237
|
};
|
|
@@ -189,6 +252,11 @@ export var renderRelationNode = function renderRelationNode(targetKeys, dataSour
|
|
|
189
252
|
});
|
|
190
253
|
findValue && finalCheckValue.push(findValue);
|
|
191
254
|
});
|
|
255
|
+
finalCheckValue = finalCheckValue.filter(function (i) {
|
|
256
|
+
return i.disabled;
|
|
257
|
+
}).concat(finalCheckValue.filter(function (i) {
|
|
258
|
+
return !i.disabled;
|
|
259
|
+
}));
|
|
192
260
|
// return flatdata.filter(item=>targetKeys.includes(item.key));
|
|
193
261
|
return finalCheckValue;
|
|
194
262
|
};
|
package/lib/SearchBar/index.js
CHANGED
|
@@ -108,13 +108,13 @@ var SearchBar = function SearchBar(props) {
|
|
|
108
108
|
showTooltipIcon = _tipTooltipOption$sho === void 0 ? false : _tipTooltipOption$sho,
|
|
109
109
|
tipTooltipOptionRest = _objectWithoutProperties(tipTooltipOption, _excluded);
|
|
110
110
|
useEffect(function () {
|
|
111
|
-
var _formItemContainer$cu
|
|
111
|
+
var _formItemContainer$cu;
|
|
112
112
|
if (!Number.isInteger(maxLine) || maxLine < 1) return;
|
|
113
113
|
// 只设置一次容器的maxHeight
|
|
114
114
|
if (maxHeight) return;
|
|
115
115
|
|
|
116
116
|
// 获取最大行数的一个节点的高度。来设置外层容器的maxHeight
|
|
117
|
-
var children = (_formItemContainer$cu = formItemContainer.current) === null || _formItemContainer$cu === void 0
|
|
117
|
+
var children = (_formItemContainer$cu = formItemContainer.current) === null || _formItemContainer$cu === void 0 || (_formItemContainer$cu = _formItemContainer$cu.children) === null || _formItemContainer$cu === void 0 || (_formItemContainer$cu = _formItemContainer$cu[0]) === null || _formItemContainer$cu === void 0 ? void 0 : _formItemContainer$cu.children;
|
|
118
118
|
if (!(children !== null && children !== void 0 && children.length)) return;
|
|
119
119
|
var containerTop = formItemContainer.current.children[0].getBoundingClientRect().top;
|
|
120
120
|
if (expandSearchArrange === "inline") {
|
package/lib/SingleSpa/index.js
CHANGED
|
@@ -80,9 +80,9 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
80
80
|
_context.prev = 9;
|
|
81
81
|
_context.next = 12;
|
|
82
82
|
return importScripts(script).then(function (result) {
|
|
83
|
-
var _result$default
|
|
83
|
+
var _result$default;
|
|
84
84
|
// 子应用umount周期卸载相关样式(防止样式冲突)
|
|
85
|
-
(_result$default = result["default"]) === null || _result$default === void 0
|
|
85
|
+
(_result$default = result["default"]) === null || _result$default === void 0 || (_result$default = _result$default.unmount) === null || _result$default === void 0 ? void 0 : _result$default.push(function () {
|
|
86
86
|
unloadApplication(project.id, {
|
|
87
87
|
waitForUnmount: true
|
|
88
88
|
}).then(function () {
|
|
@@ -10,7 +10,7 @@ export function findCommentNode(comment) {
|
|
|
10
10
|
for (var i = 0; i < head.childNodes.length; i++) {
|
|
11
11
|
var _node$nodeValue;
|
|
12
12
|
var node = head.childNodes[i];
|
|
13
|
-
if (node.nodeType === 8 && (node === null || node === void 0
|
|
13
|
+
if (node.nodeType === 8 && (node === null || node === void 0 || (_node$nodeValue = node.nodeValue) === null || _node$nodeValue === void 0 ? void 0 : _node$nodeValue.trim()) === comment) {
|
|
14
14
|
return node;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -4340,8 +4340,8 @@ function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function"
|
|
|
4340
4340
|
}
|
|
4341
4341
|
});
|
|
4342
4342
|
$(document).on('click focusin', function (e) {
|
|
4343
|
-
var _e$target
|
|
4344
|
-
if (tab$focus && e.type == 'focusin' && !(e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && (_e$target
|
|
4343
|
+
var _e$target;
|
|
4344
|
+
if (tab$focus && e.type == 'focusin' && !(e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && (_e$target = _e$target.className) !== null && _e$target !== void 0 && _e$target.includes('w-e-text'))) {
|
|
4345
4345
|
tab$focus = false;
|
|
4346
4346
|
return;
|
|
4347
4347
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaoswise/ui",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6",
|
|
4
4
|
"description": "公共UI库",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -140,5 +140,5 @@
|
|
|
140
140
|
"access": "public"
|
|
141
141
|
},
|
|
142
142
|
"license": "MIT",
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "6c8d75666cf9208346704fc975f2aa9bbe148e11"
|
|
144
144
|
}
|