acud 1.0.3 → 1.0.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/CHANGELOG.md +92 -0
- package/dist/acud.css +27 -39
- package/dist/acud.css.map +1 -1
- package/dist/acud.js +323 -3679
- package/dist/acud.js.map +1 -1
- package/dist/acud.min.css +1 -1
- package/dist/acud.min.css.map +1 -1
- package/dist/acud.min.js +8 -8
- package/dist/acud.min.js.map +1 -1
- package/es/_util/createWorker.d.ts +1 -0
- package/es/_util/createWorker.js +9 -0
- package/es/_util/hooks/useCombinedRefs.d.ts +2 -0
- package/es/_util/hooks/useCombinedRefs.js +22 -0
- package/es/card/style/index.css +0 -1
- package/es/date-picker/style/index.css +22 -0
- package/es/date-picker/style/index.less +4 -0
- package/es/date-picker/style/panel.less +11 -0
- package/es/dialog-box/style/index.css +0 -1
- package/es/form/style/index.css +1 -2
- package/es/input/Input.js +1 -23
- package/es/input/TextArea.js +2 -4
- package/es/input-number/style/index.css +0 -7
- package/es/modal/style/index.css +0 -1
- package/es/pagination/style/index.css +0 -2
- package/es/popover/style/index.css +0 -1
- package/es/rate/style/index.css +0 -1
- package/es/search/Search.js +7 -5
- package/es/search/style/index.css +3 -0
- package/es/search/style/index.less +3 -0
- package/es/select/src/OptionList.js +6 -6
- package/es/select/style/index.css +0 -2
- package/es/slider/style/index.css +0 -1
- package/es/switch/style/index.css +0 -1
- package/es/tabs/style/index.css +0 -1
- package/es/tag/style/index.css +0 -1
- package/es/timeline/style/common.less +4 -4
- package/es/timeline/style/index.css +0 -10
- package/es/transfer/DataSource.js +43 -7
- package/es/transfer/index.d.ts +1 -0
- package/es/tree/style/index.css +0 -3
- package/es/tree-select/style/index.css +0 -3
- package/lib/_util/createWorker.d.ts +1 -0
- package/lib/_util/createWorker.js +16 -0
- package/lib/_util/hooks/useCombinedRefs.d.ts +2 -0
- package/lib/_util/hooks/useCombinedRefs.js +34 -0
- package/lib/card/style/index.css +0 -1
- package/lib/date-picker/style/index.css +22 -0
- package/lib/date-picker/style/index.less +4 -0
- package/lib/date-picker/style/panel.less +11 -0
- package/lib/dialog-box/style/index.css +0 -1
- package/lib/form/style/index.css +1 -2
- package/lib/input/Input.js +3 -25
- package/lib/input/TextArea.js +2 -4
- package/lib/input-number/style/index.css +0 -7
- package/lib/modal/style/index.css +0 -1
- package/lib/pagination/style/index.css +0 -2
- package/lib/popover/style/index.css +0 -1
- package/lib/rate/style/index.css +0 -1
- package/lib/search/Search.js +8 -5
- package/lib/search/style/index.css +3 -0
- package/lib/search/style/index.less +3 -0
- package/lib/select/src/OptionList.js +6 -6
- package/lib/select/style/index.css +0 -2
- package/lib/slider/style/index.css +0 -1
- package/lib/switch/style/index.css +0 -1
- package/lib/tabs/style/index.css +0 -1
- package/lib/tag/style/index.css +0 -1
- package/lib/timeline/style/common.less +4 -4
- package/lib/timeline/style/index.css +0 -10
- package/lib/transfer/DataSource.js +45 -7
- package/lib/transfer/index.d.ts +1 -0
- package/lib/tree/style/index.css +0 -3
- package/lib/tree-select/style/index.css +0 -3
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createWorker(f: (e: any) => void): Worker;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function useCombinedRefs() {
|
|
3
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4
|
+
refs[_key] = arguments[_key];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
var targetRef = React.useRef();
|
|
8
|
+
React.useEffect(function () {
|
|
9
|
+
refs.forEach(function (ref) {
|
|
10
|
+
if (!ref) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (typeof ref === 'function') {
|
|
15
|
+
ref(targetRef.current);
|
|
16
|
+
} else {
|
|
17
|
+
ref.current = targetRef.current;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}, [refs]);
|
|
21
|
+
return targetRef;
|
|
22
|
+
}
|
package/es/card/style/index.css
CHANGED
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
border-radius: 4px;
|
|
25
25
|
transition: border 0.3s, box-shadow 0.3s;
|
|
26
26
|
}
|
|
27
|
+
.acud-picker input {
|
|
28
|
+
font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "Helvetica Neue", Helvetica, "PingFang SC", Roboto, 'Arial', 'microsoft yahei ui', "Microsoft YaHei", SimSun, sans-serif;
|
|
29
|
+
}
|
|
27
30
|
.acud-picker:hover {
|
|
28
31
|
background-color: #FFFFFF;
|
|
29
32
|
}
|
|
@@ -1055,6 +1058,7 @@ tr > .acud-picker-cell-in-view.acud-picker-cell-range-hover-start:last-child::af
|
|
|
1055
1058
|
.acud-picker-date-panel .acud-picker-content thead th {
|
|
1056
1059
|
width: 24px;
|
|
1057
1060
|
line-height: 24px;
|
|
1061
|
+
color: #151B26;
|
|
1058
1062
|
}
|
|
1059
1063
|
.acud-picker-date-panel .acud-picker-content tbody tr {
|
|
1060
1064
|
margin-top: 8px;
|
|
@@ -1198,6 +1202,24 @@ tr > .acud-picker-cell-in-view.acud-picker-cell-range-hover-start:last-child::af
|
|
|
1198
1202
|
.acud-picker-year-panel tr td.acud-picker-cell-range-hover:last-child {
|
|
1199
1203
|
border-radius: 0 2px 2px 0;
|
|
1200
1204
|
}
|
|
1205
|
+
.acud-picker-date-panel tr td.acud-picker-cell-in-view.acud-picker-cell-in-range.acud-picker-cell-end,
|
|
1206
|
+
.acud-picker-month-panel tr td.acud-picker-cell-in-view.acud-picker-cell-in-range.acud-picker-cell-end,
|
|
1207
|
+
.acud-picker-year-panel tr td.acud-picker-cell-in-view.acud-picker-cell-in-range.acud-picker-cell-end,
|
|
1208
|
+
.acud-picker-date-panel tr td.acud-picker-cell-range-hover.acud-picker-cell-end,
|
|
1209
|
+
.acud-picker-month-panel tr td.acud-picker-cell-range-hover.acud-picker-cell-end,
|
|
1210
|
+
.acud-picker-year-panel tr td.acud-picker-cell-range-hover.acud-picker-cell-end {
|
|
1211
|
+
border-top-right-radius: 2px;
|
|
1212
|
+
border-bottom-right-radius: 2px;
|
|
1213
|
+
}
|
|
1214
|
+
.acud-picker-date-panel tr td.acud-picker-cell-in-view.acud-picker-cell-in-range.acud-picker-cell-start,
|
|
1215
|
+
.acud-picker-month-panel tr td.acud-picker-cell-in-view.acud-picker-cell-in-range.acud-picker-cell-start,
|
|
1216
|
+
.acud-picker-year-panel tr td.acud-picker-cell-in-view.acud-picker-cell-in-range.acud-picker-cell-start,
|
|
1217
|
+
.acud-picker-date-panel tr td.acud-picker-cell-range-hover.acud-picker-cell-start,
|
|
1218
|
+
.acud-picker-month-panel tr td.acud-picker-cell-range-hover.acud-picker-cell-start,
|
|
1219
|
+
.acud-picker-year-panel tr td.acud-picker-cell-range-hover.acud-picker-cell-start {
|
|
1220
|
+
border-top-left-radius: 2px;
|
|
1221
|
+
border-bottom-left-radius: 2px;
|
|
1222
|
+
}
|
|
1201
1223
|
.acud-picker-date-panel tr td.acud-picker-cell-range-hover-end:not(.acud-picker-cell-range-end):not(.acud-picker-cell-in-range) .acud-picker-cell-inner,
|
|
1202
1224
|
.acud-picker-month-panel tr td.acud-picker-cell-range-hover-end:not(.acud-picker-cell-range-end):not(.acud-picker-cell-in-range) .acud-picker-cell-inner,
|
|
1203
1225
|
.acud-picker-year-panel tr td.acud-picker-cell-range-hover-end:not(.acud-picker-cell-range-end):not(.acud-picker-cell-in-range) .acud-picker-cell-inner {
|
|
@@ -570,6 +570,7 @@
|
|
|
570
570
|
th {
|
|
571
571
|
width: 6*@P;
|
|
572
572
|
line-height: 6*@P;
|
|
573
|
+
color: @G2;
|
|
573
574
|
}
|
|
574
575
|
}
|
|
575
576
|
|
|
@@ -796,6 +797,16 @@
|
|
|
796
797
|
&:last-child {
|
|
797
798
|
border-radius: 0 @R2 @R2 0;
|
|
798
799
|
}
|
|
800
|
+
|
|
801
|
+
&.@{picker-prefix-cls}-cell-end {
|
|
802
|
+
border-top-right-radius: @R2;
|
|
803
|
+
border-bottom-right-radius: @R2;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
&.@{picker-prefix-cls}-cell-start {
|
|
807
|
+
border-top-left-radius: @R2;
|
|
808
|
+
border-bottom-left-radius: @R2;
|
|
809
|
+
}
|
|
799
810
|
}
|
|
800
811
|
|
|
801
812
|
td.@{picker-prefix-cls}-cell-range-hover-end:not(.@{picker-prefix-cls}-cell-range-end):not(.@{picker-prefix-cls}-cell-in-range) {
|
package/es/form/style/index.css
CHANGED
|
@@ -742,8 +742,7 @@
|
|
|
742
742
|
.acud-form-item-label > label .acud-form-item-tooltip {
|
|
743
743
|
color: #B8BABF;
|
|
744
744
|
cursor: help;
|
|
745
|
-
|
|
746
|
-
writing-mode: horizontal-tb;
|
|
745
|
+
writing-mode: horizontal-tb;
|
|
747
746
|
-webkit-margin-start: 4px;
|
|
748
747
|
margin-inline-start: 4px;
|
|
749
748
|
}
|
package/es/input/Input.js
CHANGED
|
@@ -24,35 +24,13 @@ import React, { useImperativeHandle, Fragment, useEffect, useState } from 'react
|
|
|
24
24
|
import classNames from 'classnames';
|
|
25
25
|
import { MultiToneClear } from 'acud-icon';
|
|
26
26
|
import SizeContext from '../config-provider/SizeContext';
|
|
27
|
+
import useCombinedRefs from '../_util/hooks/useCombinedRefs';
|
|
27
28
|
import Popover from '../popover';
|
|
28
29
|
export var resolveTargetValue = function resolveTargetValue(event, value) {
|
|
29
30
|
var newEvent = Object.create(event);
|
|
30
31
|
newEvent.target.value = value;
|
|
31
32
|
return newEvent;
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
-
function useCombinedRefs() {
|
|
35
|
-
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36
|
-
refs[_key] = arguments[_key];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
var targetRef = React.useRef();
|
|
40
|
-
React.useEffect(function () {
|
|
41
|
-
refs.forEach(function (ref) {
|
|
42
|
-
if (!ref) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (typeof ref === 'function') {
|
|
47
|
-
ref(targetRef.current);
|
|
48
|
-
} else {
|
|
49
|
-
ref.current = targetRef.current;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}, [refs]);
|
|
53
|
-
return targetRef;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
34
|
var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
57
35
|
var _classNames3;
|
|
58
36
|
|
package/es/input/TextArea.js
CHANGED
|
@@ -42,10 +42,9 @@ var TextArea = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
42
42
|
onKeyDown = props.onKeyDown,
|
|
43
43
|
onFocus = props.onFocus,
|
|
44
44
|
onBlur = props.onBlur,
|
|
45
|
-
style = props.style,
|
|
46
45
|
_props$allowClear = props.allowClear,
|
|
47
46
|
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
|
48
|
-
rest = __rest(props, ["prefixCls", "placeholder", "className", "limitLength", "readonly", "autoSize", "onPressEnter", "onKeyDown", "onFocus", "onBlur", "
|
|
47
|
+
rest = __rest(props, ["prefixCls", "placeholder", "className", "limitLength", "readonly", "autoSize", "onPressEnter", "onKeyDown", "onFocus", "onBlur", "allowClear"]);
|
|
49
48
|
|
|
50
49
|
var _useMergedState = useMergedState(props.defaultValue, {
|
|
51
50
|
value: props.value
|
|
@@ -132,8 +131,7 @@ var TextArea = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
132
131
|
};
|
|
133
132
|
|
|
134
133
|
return /*#__PURE__*/React.createElement("div", {
|
|
135
|
-
className: "".concat(prefixCls, "-outer")
|
|
136
|
-
style: style
|
|
134
|
+
className: "".concat(prefixCls, "-outer")
|
|
137
135
|
}, /*#__PURE__*/React.createElement(RcTextArea, _extends({}, rest, {
|
|
138
136
|
ref: ref,
|
|
139
137
|
placeholder: placeholder,
|
|
@@ -249,7 +249,6 @@
|
|
|
249
249
|
transition: all 0.1s linear;
|
|
250
250
|
-webkit-user-select: none;
|
|
251
251
|
-moz-user-select: none;
|
|
252
|
-
-ms-user-select: none;
|
|
253
252
|
user-select: none;
|
|
254
253
|
}
|
|
255
254
|
.acud-input-number-handler-up-inner > *,
|
|
@@ -314,18 +313,12 @@
|
|
|
314
313
|
.acud-input-number-input::-moz-placeholder {
|
|
315
314
|
opacity: 1;
|
|
316
315
|
}
|
|
317
|
-
.acud-input-number-input:-ms-input-placeholder {
|
|
318
|
-
color: #D4D6D9;
|
|
319
|
-
}
|
|
320
316
|
.acud-input-number-input::placeholder {
|
|
321
317
|
color: #D4D6D9;
|
|
322
318
|
}
|
|
323
319
|
.acud-input-number-input:-moz-placeholder-shown {
|
|
324
320
|
text-overflow: ellipsis;
|
|
325
321
|
}
|
|
326
|
-
.acud-input-number-input:-ms-input-placeholder {
|
|
327
|
-
text-overflow: ellipsis;
|
|
328
|
-
}
|
|
329
322
|
.acud-input-number-input:placeholder-shown {
|
|
330
323
|
text-overflow: ellipsis;
|
|
331
324
|
}
|
package/es/modal/style/index.css
CHANGED
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
cursor: pointer;
|
|
68
68
|
-webkit-user-select: none;
|
|
69
69
|
-moz-user-select: none;
|
|
70
|
-
-ms-user-select: none;
|
|
71
70
|
user-select: none;
|
|
72
71
|
box-sizing: border-box;
|
|
73
72
|
font-weight: 400;
|
|
@@ -251,7 +250,6 @@
|
|
|
251
250
|
cursor: pointer;
|
|
252
251
|
-webkit-user-select: none;
|
|
253
252
|
-moz-user-select: none;
|
|
254
|
-
-ms-user-select: none;
|
|
255
253
|
user-select: none;
|
|
256
254
|
}
|
|
257
255
|
.acud-pagination-prev.acud-pagination-disabled button,
|
package/es/rate/style/index.css
CHANGED
package/es/search/Search.js
CHANGED
|
@@ -22,6 +22,7 @@ import { OutlinedSearch, OutlinedLoading } from 'acud-icon';
|
|
|
22
22
|
import useMergedState from "rc-util/es/hooks/useMergedState";
|
|
23
23
|
import { ConfigContext } from '../config-provider';
|
|
24
24
|
import Select from '../select';
|
|
25
|
+
import useCombinedRefs from '../_util/hooks/useCombinedRefs';
|
|
25
26
|
import Input from '../input';
|
|
26
27
|
import Button from '../button';
|
|
27
28
|
var Option = Select.Option;
|
|
@@ -69,7 +70,8 @@ var Search = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
69
70
|
var searchIconClass = "".concat(prefixCls, "-icon");
|
|
70
71
|
var searchLoadingIconClass = "".concat(prefixCls, "-loading-icon"); // ref
|
|
71
72
|
|
|
72
|
-
var inputRef = React.useRef(
|
|
73
|
+
var inputRef = React.useRef(null);
|
|
74
|
+
var combinedRef = useCombinedRefs(ref, inputRef); // 函数
|
|
73
75
|
|
|
74
76
|
var onChange = useCallback(function (e) {
|
|
75
77
|
if (e && e.target && e.type === 'click' && customSearch) {
|
|
@@ -81,13 +83,13 @@ var Search = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
81
83
|
var onSearch = useCallback(function (e) {
|
|
82
84
|
var _a;
|
|
83
85
|
|
|
84
|
-
var value = (_a =
|
|
86
|
+
var value = (_a = combinedRef.current) === null || _a === void 0 ? void 0 : _a.value;
|
|
85
87
|
var realValue = ifMultiple ? {
|
|
86
88
|
type: multipleMergeValue,
|
|
87
89
|
value: value
|
|
88
90
|
} : value;
|
|
89
91
|
customSearch && customSearch(realValue, e);
|
|
90
|
-
}, [ifMultiple,
|
|
92
|
+
}, [combinedRef, ifMultiple, multipleMergeValue, customSearch]);
|
|
91
93
|
var onChangeMultiple = useCallback(function (value) {
|
|
92
94
|
// 如果是不受控,就自己调用set
|
|
93
95
|
if (!ifControlMutipleValue) {
|
|
@@ -134,7 +136,7 @@ var Search = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
134
136
|
|
|
135
137
|
var baseProps = _extends(_extends({}, otherProps), {
|
|
136
138
|
size: size,
|
|
137
|
-
ref:
|
|
139
|
+
ref: combinedRef,
|
|
138
140
|
onChange: onChange,
|
|
139
141
|
disabled: disabled,
|
|
140
142
|
onPressEnter: onSearch,
|
|
@@ -158,7 +160,7 @@ var Search = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
158
160
|
return /*#__PURE__*/React.createElement("span", {
|
|
159
161
|
className: classes
|
|
160
162
|
}, /*#__PURE__*/React.createElement(Input, _extends({}, realProps, {
|
|
161
|
-
ref:
|
|
163
|
+
ref: combinedRef
|
|
162
164
|
})), enterButton && button);
|
|
163
165
|
});
|
|
164
166
|
export default Search;
|
|
@@ -467,8 +467,13 @@ var OptionList = function OptionList(_ref, ref) {
|
|
|
467
467
|
}), /*#__PURE__*/React.createElement("div", {
|
|
468
468
|
className: "".concat(optionPrefixCls, "-content")
|
|
469
469
|
}, fContent), extra);
|
|
470
|
-
};
|
|
470
|
+
};
|
|
471
471
|
|
|
472
|
+
var disabledVirtual = React.useMemo(function () {
|
|
473
|
+
return !virtual || (mode === 'multiple' || mode !== 'multiple' && !keepExpand) && memoFlattenOptions.some(function (option) {
|
|
474
|
+
return option.group;
|
|
475
|
+
});
|
|
476
|
+
}, [virtual, mode, keepExpand, memoFlattenOptions]); // ========================== Render ==========================
|
|
472
477
|
|
|
473
478
|
if (memoFlattenOptions.length === 0) {
|
|
474
479
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -479,11 +484,6 @@ var OptionList = function OptionList(_ref, ref) {
|
|
|
479
484
|
}, mergedNotFound);
|
|
480
485
|
}
|
|
481
486
|
|
|
482
|
-
var disabledVirtual = React.useMemo(function () {
|
|
483
|
-
return !virtual || (mode === 'multiple' || mode !== 'multiple' && !keepExpand) && memoFlattenOptions.some(function (option) {
|
|
484
|
-
return option.group;
|
|
485
|
-
});
|
|
486
|
-
}, [virtual, mode, keepExpand, memoFlattenOptions]);
|
|
487
487
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
488
488
|
role: "listbox",
|
|
489
489
|
id: "".concat(id, "_list"),
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
position: relative;
|
|
39
39
|
-webkit-user-select: none;
|
|
40
40
|
-moz-user-select: none;
|
|
41
|
-
-ms-user-select: none;
|
|
42
41
|
user-select: none;
|
|
43
42
|
color: #151B26;
|
|
44
43
|
}
|
|
@@ -191,7 +190,6 @@
|
|
|
191
190
|
transition: font-size 0.3s, line-height 0.3s, height 0.3s;
|
|
192
191
|
-webkit-user-select: none;
|
|
193
192
|
-moz-user-select: none;
|
|
194
|
-
-ms-user-select: none;
|
|
195
193
|
user-select: none;
|
|
196
194
|
-webkit-margin-end: 5px;
|
|
197
195
|
margin-inline-end: 5px;
|
package/es/tabs/style/index.css
CHANGED
package/es/tag/style/index.css
CHANGED
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
margin-top: @timeline-common-content-link-margin;
|
|
62
62
|
transition: opacity .2s linear;
|
|
63
63
|
|
|
64
|
-
svg {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
64
|
+
// svg {
|
|
65
|
+
// position: relative;
|
|
66
|
+
// top: @timeline-common-content-link-margin - 1.5px;
|
|
67
|
+
// }
|
|
68
68
|
|
|
69
69
|
&-label {
|
|
70
70
|
flex-shrink: 0;
|
|
@@ -166,7 +166,6 @@
|
|
|
166
166
|
cursor: pointer;
|
|
167
167
|
-webkit-user-select: none;
|
|
168
168
|
-moz-user-select: none;
|
|
169
|
-
-ms-user-select: none;
|
|
170
169
|
user-select: none;
|
|
171
170
|
}
|
|
172
171
|
.common-content-link {
|
|
@@ -177,10 +176,6 @@
|
|
|
177
176
|
margin-top: 4px;
|
|
178
177
|
transition: opacity 0.2s linear;
|
|
179
178
|
}
|
|
180
|
-
.common-content-link svg {
|
|
181
|
-
position: relative;
|
|
182
|
-
top: 2.5px;
|
|
183
|
-
}
|
|
184
179
|
.common-content-link-label {
|
|
185
180
|
flex-shrink: 0;
|
|
186
181
|
margin-right: 4px;
|
|
@@ -583,7 +578,6 @@
|
|
|
583
578
|
cursor: pointer;
|
|
584
579
|
-webkit-user-select: none;
|
|
585
580
|
-moz-user-select: none;
|
|
586
|
-
-ms-user-select: none;
|
|
587
581
|
user-select: none;
|
|
588
582
|
}
|
|
589
583
|
.acud-timeline-item-content-link {
|
|
@@ -594,10 +588,6 @@
|
|
|
594
588
|
margin-top: 4px;
|
|
595
589
|
transition: opacity 0.2s linear;
|
|
596
590
|
}
|
|
597
|
-
.acud-timeline-item-content-link svg {
|
|
598
|
-
position: relative;
|
|
599
|
-
top: 2.5px;
|
|
600
|
-
}
|
|
601
591
|
.acud-timeline-item-content-link-label {
|
|
602
592
|
flex-shrink: 0;
|
|
603
593
|
margin-right: 4px;
|
|
@@ -8,6 +8,8 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
8
8
|
*/
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
import cloneDeep from 'lodash/cloneDeep';
|
|
11
|
+
import { createWorker } from '../_util/createWorker';
|
|
12
|
+
import Loading from '../loading';
|
|
11
13
|
import Checkbox from '../checkbox';
|
|
12
14
|
import Table from '../table';
|
|
13
15
|
import Search from '../search';
|
|
@@ -32,6 +34,8 @@ export default function dataSource(props) {
|
|
|
32
34
|
showSearch = props.showSearch,
|
|
33
35
|
_props$showSearchClea = props.showSearchClear,
|
|
34
36
|
showSearchClear = _props$showSearchClea === void 0 ? true : _props$showSearchClea,
|
|
37
|
+
_props$useWorker = props.useWorker,
|
|
38
|
+
useWorker = _props$useWorker === void 0 ? false : _props$useWorker,
|
|
35
39
|
tKeys = props.tKeys,
|
|
36
40
|
setTKeys = props.setTKeys,
|
|
37
41
|
leftStyle = props.leftStyle,
|
|
@@ -47,6 +51,11 @@ export default function dataSource(props) {
|
|
|
47
51
|
searchValue = _React$useState2[0],
|
|
48
52
|
setSearchValue = _React$useState2[1];
|
|
49
53
|
|
|
54
|
+
var _React$useState3 = React.useState(false),
|
|
55
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
56
|
+
loading = _React$useState4[0],
|
|
57
|
+
setLoading = _React$useState4[1];
|
|
58
|
+
|
|
50
59
|
var filterSource = React.useMemo(function () {
|
|
51
60
|
if (searchValue === '') {
|
|
52
61
|
return expansionSource;
|
|
@@ -103,17 +112,40 @@ export default function dataSource(props) {
|
|
|
103
112
|
var allChecked = totalUndisabledKeys.length === totalSelectedUndisabledKeys.length;
|
|
104
113
|
var indeterminate = totalSelectedUndisabledKeys.length && totalUndisabledKeys.length > totalSelectedUndisabledKeys.length;
|
|
105
114
|
var selectAll = React.useCallback(function () {
|
|
106
|
-
var newTKeys = [];
|
|
115
|
+
var newTKeys = []; // 取消全选
|
|
107
116
|
|
|
108
117
|
if (allChecked) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
if (useWorker) {
|
|
119
|
+
setLoading(true);
|
|
120
|
+
var cancelAllWorker = createWorker(function (e) {
|
|
121
|
+
var _e$data = e.data,
|
|
122
|
+
tKeys = _e$data.tKeys,
|
|
123
|
+
totalUndisabledKeys = _e$data.totalUndisabledKeys;
|
|
124
|
+
var nKeys = tKeys.filter(function (key) {
|
|
125
|
+
return !totalUndisabledKeys.includes(key);
|
|
126
|
+
});
|
|
127
|
+
self.postMessage(nKeys);
|
|
128
|
+
}); // 主线程监听worker线程返回的数据
|
|
129
|
+
|
|
130
|
+
cancelAllWorker.addEventListener('message', function (event) {
|
|
131
|
+
setTKeys(event.data);
|
|
132
|
+
cancelAllWorker.terminate();
|
|
133
|
+
setLoading(false);
|
|
134
|
+
});
|
|
135
|
+
cancelAllWorker.postMessage({
|
|
136
|
+
tKeys: tKeys,
|
|
137
|
+
totalUndisabledKeys: totalUndisabledKeys
|
|
138
|
+
});
|
|
139
|
+
} else {
|
|
140
|
+
newTKeys = tKeys.filter(function (key) {
|
|
141
|
+
return !totalUndisabledKeys.includes(key);
|
|
142
|
+
});
|
|
143
|
+
setTKeys(newTKeys);
|
|
144
|
+
}
|
|
112
145
|
} else {
|
|
113
146
|
newTKeys = _toConsumableArray(new Set([].concat(_toConsumableArray(tKeys), _toConsumableArray(totalUndisabledKeys))));
|
|
147
|
+
setTKeys(newTKeys);
|
|
114
148
|
}
|
|
115
|
-
|
|
116
|
-
setTKeys(newTKeys);
|
|
117
149
|
}, [totalSelectedUndisabledKeys, totalUndisabledKeys, allChecked, tKeys]);
|
|
118
150
|
var searchChange = React.useCallback(function (e) {
|
|
119
151
|
var searchValue = e.target.value;
|
|
@@ -138,6 +170,10 @@ export default function dataSource(props) {
|
|
|
138
170
|
return /*#__PURE__*/React.createElement("div", {
|
|
139
171
|
className: dataSourceCls,
|
|
140
172
|
style: leftStyle
|
|
173
|
+
}, /*#__PURE__*/React.createElement(Loading, {
|
|
174
|
+
loading: loading,
|
|
175
|
+
tip: "\u52A0\u8F7D\u4E2D...",
|
|
176
|
+
size: "small"
|
|
141
177
|
}, /*#__PURE__*/React.createElement("div", {
|
|
142
178
|
className: "".concat(dataSourceCls, "-header")
|
|
143
179
|
}, showSelectAll && displayType === 'single' && /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -166,5 +202,5 @@ export default function dataSource(props) {
|
|
|
166
202
|
filterSource: filterSource
|
|
167
203
|
})), filterSource.length === 0 && /*#__PURE__*/React.createElement("p", {
|
|
168
204
|
className: "".concat(dataSourceCls, "-nodata")
|
|
169
|
-
}, /*#__PURE__*/React.createElement("span", null, sourceNoData))));
|
|
205
|
+
}, /*#__PURE__*/React.createElement("span", null, sourceNoData)))));
|
|
170
206
|
}
|
package/es/transfer/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export interface TransferProps<RecordType> {
|
|
|
44
44
|
selectAllLabels?: SelectAllLabel[];
|
|
45
45
|
defaultExpandGroupKey?: string[] | string | number[] | number | boolean;
|
|
46
46
|
virtual?: boolean;
|
|
47
|
+
useWorker?: boolean;
|
|
47
48
|
columns?: ColumnsType<RecordType>;
|
|
48
49
|
}
|
|
49
50
|
export default function transfer<RecordType extends TransferItem = TransferItem>(props: TransferProps<RecordType>): JSX.Element;
|
package/es/tree/style/index.css
CHANGED
|
@@ -277,7 +277,6 @@
|
|
|
277
277
|
white-space: nowrap;
|
|
278
278
|
-webkit-user-select: none;
|
|
279
279
|
-moz-user-select: none;
|
|
280
|
-
-ms-user-select: none;
|
|
281
280
|
user-select: none;
|
|
282
281
|
}
|
|
283
282
|
.acud-tree-indent-unit {
|
|
@@ -295,7 +294,6 @@
|
|
|
295
294
|
cursor: pointer;
|
|
296
295
|
-webkit-user-select: none;
|
|
297
296
|
-moz-user-select: none;
|
|
298
|
-
-ms-user-select: none;
|
|
299
297
|
user-select: none;
|
|
300
298
|
}
|
|
301
299
|
.acud-tree-switcher .acud-tree-switcher-icon,
|
|
@@ -437,7 +435,6 @@
|
|
|
437
435
|
line-height: 24px;
|
|
438
436
|
-webkit-user-select: none;
|
|
439
437
|
-moz-user-select: none;
|
|
440
|
-
-ms-user-select: none;
|
|
441
438
|
user-select: none;
|
|
442
439
|
}
|
|
443
440
|
.acud-tree-node-content-wrapper .acud-tree-drop-indicator {
|
|
@@ -292,7 +292,6 @@
|
|
|
292
292
|
white-space: nowrap;
|
|
293
293
|
-webkit-user-select: none;
|
|
294
294
|
-moz-user-select: none;
|
|
295
|
-
-ms-user-select: none;
|
|
296
295
|
user-select: none;
|
|
297
296
|
}
|
|
298
297
|
.acud-select-tree-indent-unit {
|
|
@@ -310,7 +309,6 @@
|
|
|
310
309
|
cursor: pointer;
|
|
311
310
|
-webkit-user-select: none;
|
|
312
311
|
-moz-user-select: none;
|
|
313
|
-
-ms-user-select: none;
|
|
314
312
|
user-select: none;
|
|
315
313
|
}
|
|
316
314
|
.acud-select-tree-switcher .acud-tree-switcher-icon,
|
|
@@ -452,7 +450,6 @@
|
|
|
452
450
|
line-height: 24px;
|
|
453
451
|
-webkit-user-select: none;
|
|
454
452
|
-moz-user-select: none;
|
|
455
|
-
-ms-user-select: none;
|
|
456
453
|
user-select: none;
|
|
457
454
|
}
|
|
458
455
|
.acud-select-tree-node-content-wrapper .acud-tree-drop-indicator {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createWorker(f: (e: any) => void): Worker;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createWorker = createWorker;
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* 创建webworker
|
|
10
|
+
*/
|
|
11
|
+
function createWorker(f) {
|
|
12
|
+
var blob = new Blob(["\n self.addEventListener('message', ".concat(f.toString(), ", false);\n ")]);
|
|
13
|
+
var url = window.URL.createObjectURL(blob);
|
|
14
|
+
var worker = new Worker(url);
|
|
15
|
+
return worker;
|
|
16
|
+
}
|