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,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = useCombinedRefs;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
function useCombinedRefs() {
|
|
13
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
|
+
refs[_key] = arguments[_key];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var targetRef = _react["default"].useRef();
|
|
18
|
+
|
|
19
|
+
_react["default"].useEffect(function () {
|
|
20
|
+
refs.forEach(function (ref) {
|
|
21
|
+
if (!ref) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (typeof ref === 'function') {
|
|
26
|
+
ref(targetRef.current);
|
|
27
|
+
} else {
|
|
28
|
+
ref.current = targetRef.current;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}, [refs]);
|
|
32
|
+
|
|
33
|
+
return targetRef;
|
|
34
|
+
}
|
package/lib/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/lib/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/lib/input/Input.js
CHANGED
|
@@ -23,6 +23,8 @@ var _acudIcon = require("acud-icon");
|
|
|
23
23
|
|
|
24
24
|
var _SizeContext = _interopRequireDefault(require("../config-provider/SizeContext"));
|
|
25
25
|
|
|
26
|
+
var _useCombinedRefs = _interopRequireDefault(require("../_util/hooks/useCombinedRefs"));
|
|
27
|
+
|
|
26
28
|
var _popover = _interopRequireDefault(require("../popover"));
|
|
27
29
|
|
|
28
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -55,30 +57,6 @@ var resolveTargetValue = function resolveTargetValue(event, value) {
|
|
|
55
57
|
|
|
56
58
|
exports.resolveTargetValue = resolveTargetValue;
|
|
57
59
|
|
|
58
|
-
function useCombinedRefs() {
|
|
59
|
-
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
60
|
-
refs[_key] = arguments[_key];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
var targetRef = _react["default"].useRef();
|
|
64
|
-
|
|
65
|
-
_react["default"].useEffect(function () {
|
|
66
|
-
refs.forEach(function (ref) {
|
|
67
|
-
if (!ref) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (typeof ref === 'function') {
|
|
72
|
-
ref(targetRef.current);
|
|
73
|
-
} else {
|
|
74
|
-
ref.current = targetRef.current;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
}, [refs]);
|
|
78
|
-
|
|
79
|
-
return targetRef;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
60
|
var Input = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
83
61
|
var _classNames3;
|
|
84
62
|
|
|
@@ -133,7 +111,7 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
133
111
|
|
|
134
112
|
var innerRef = _react["default"].useRef(null);
|
|
135
113
|
|
|
136
|
-
var combinedRef =
|
|
114
|
+
var combinedRef = (0, _useCombinedRefs["default"])(ref, innerRef);
|
|
137
115
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
138
116
|
return {
|
|
139
117
|
blur: function blur() {
|
package/lib/input/TextArea.js
CHANGED
|
@@ -65,10 +65,9 @@ var TextArea = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
65
65
|
onKeyDown = props.onKeyDown,
|
|
66
66
|
onFocus = props.onFocus,
|
|
67
67
|
onBlur = props.onBlur,
|
|
68
|
-
style = props.style,
|
|
69
68
|
_props$allowClear = props.allowClear,
|
|
70
69
|
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
|
71
|
-
rest = __rest(props, ["prefixCls", "placeholder", "className", "limitLength", "readonly", "autoSize", "onPressEnter", "onKeyDown", "onFocus", "onBlur", "
|
|
70
|
+
rest = __rest(props, ["prefixCls", "placeholder", "className", "limitLength", "readonly", "autoSize", "onPressEnter", "onKeyDown", "onFocus", "onBlur", "allowClear"]);
|
|
72
71
|
|
|
73
72
|
var _useMergedState = (0, _useMergedState3["default"])(props.defaultValue, {
|
|
74
73
|
value: props.value
|
|
@@ -155,8 +154,7 @@ var TextArea = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
155
154
|
};
|
|
156
155
|
|
|
157
156
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
158
|
-
className: "".concat(prefixCls, "-outer")
|
|
159
|
-
style: style
|
|
157
|
+
className: "".concat(prefixCls, "-outer")
|
|
160
158
|
}, /*#__PURE__*/_react["default"].createElement(_rcTextarea["default"], (0, _extends2["default"])({}, rest, {
|
|
161
159
|
ref: ref,
|
|
162
160
|
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
|
}
|
|
@@ -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/lib/rate/style/index.css
CHANGED
package/lib/search/Search.js
CHANGED
|
@@ -29,6 +29,8 @@ var _configProvider = require("../config-provider");
|
|
|
29
29
|
|
|
30
30
|
var _select = _interopRequireDefault(require("../select"));
|
|
31
31
|
|
|
32
|
+
var _useCombinedRefs = _interopRequireDefault(require("../_util/hooks/useCombinedRefs"));
|
|
33
|
+
|
|
32
34
|
var _input = _interopRequireDefault(require("../input"));
|
|
33
35
|
|
|
34
36
|
var _button = _interopRequireDefault(require("../button"));
|
|
@@ -96,8 +98,9 @@ var Search = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
96
98
|
var searchIconClass = "".concat(prefixCls, "-icon");
|
|
97
99
|
var searchLoadingIconClass = "".concat(prefixCls, "-loading-icon"); // ref
|
|
98
100
|
|
|
99
|
-
var inputRef = _react["default"].useRef(
|
|
101
|
+
var inputRef = _react["default"].useRef(null);
|
|
100
102
|
|
|
103
|
+
var combinedRef = (0, _useCombinedRefs["default"])(ref, inputRef); // 函数
|
|
101
104
|
|
|
102
105
|
var onChange = (0, _react.useCallback)(function (e) {
|
|
103
106
|
if (e && e.target && e.type === 'click' && customSearch) {
|
|
@@ -109,13 +112,13 @@ var Search = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
109
112
|
var onSearch = (0, _react.useCallback)(function (e) {
|
|
110
113
|
var _a;
|
|
111
114
|
|
|
112
|
-
var value = (_a =
|
|
115
|
+
var value = (_a = combinedRef.current) === null || _a === void 0 ? void 0 : _a.value;
|
|
113
116
|
var realValue = ifMultiple ? {
|
|
114
117
|
type: multipleMergeValue,
|
|
115
118
|
value: value
|
|
116
119
|
} : value;
|
|
117
120
|
customSearch && customSearch(realValue, e);
|
|
118
|
-
}, [ifMultiple,
|
|
121
|
+
}, [combinedRef, ifMultiple, multipleMergeValue, customSearch]);
|
|
119
122
|
var onChangeMultiple = (0, _react.useCallback)(function (value) {
|
|
120
123
|
// 如果是不受控,就自己调用set
|
|
121
124
|
if (!ifControlMutipleValue) {
|
|
@@ -162,7 +165,7 @@ var Search = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
162
165
|
|
|
163
166
|
var baseProps = (0, _extends2["default"])((0, _extends2["default"])({}, otherProps), {
|
|
164
167
|
size: size,
|
|
165
|
-
ref:
|
|
168
|
+
ref: combinedRef,
|
|
166
169
|
onChange: onChange,
|
|
167
170
|
disabled: disabled,
|
|
168
171
|
onPressEnter: onSearch,
|
|
@@ -185,7 +188,7 @@ var Search = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
185
188
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
186
189
|
className: classes
|
|
187
190
|
}, /*#__PURE__*/_react["default"].createElement(_input["default"], (0, _extends2["default"])({}, realProps, {
|
|
188
|
-
ref:
|
|
191
|
+
ref: combinedRef
|
|
189
192
|
})), enterButton && button);
|
|
190
193
|
});
|
|
191
194
|
|
|
@@ -493,8 +493,13 @@ var OptionList = function OptionList(_ref, ref) {
|
|
|
493
493
|
}), /*#__PURE__*/React.createElement("div", {
|
|
494
494
|
className: "".concat(optionPrefixCls, "-content")
|
|
495
495
|
}, fContent), extra);
|
|
496
|
-
};
|
|
496
|
+
};
|
|
497
497
|
|
|
498
|
+
var disabledVirtual = React.useMemo(function () {
|
|
499
|
+
return !virtual || (mode === 'multiple' || mode !== 'multiple' && !keepExpand) && memoFlattenOptions.some(function (option) {
|
|
500
|
+
return option.group;
|
|
501
|
+
});
|
|
502
|
+
}, [virtual, mode, keepExpand, memoFlattenOptions]); // ========================== Render ==========================
|
|
498
503
|
|
|
499
504
|
if (memoFlattenOptions.length === 0) {
|
|
500
505
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -505,11 +510,6 @@ var OptionList = function OptionList(_ref, ref) {
|
|
|
505
510
|
}, mergedNotFound);
|
|
506
511
|
}
|
|
507
512
|
|
|
508
|
-
var disabledVirtual = React.useMemo(function () {
|
|
509
|
-
return !virtual || (mode === 'multiple' || mode !== 'multiple' && !keepExpand) && memoFlattenOptions.some(function (option) {
|
|
510
|
-
return option.group;
|
|
511
|
-
});
|
|
512
|
-
}, [virtual, mode, keepExpand, memoFlattenOptions]);
|
|
513
513
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
514
514
|
role: "listbox",
|
|
515
515
|
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/lib/tabs/style/index.css
CHANGED
package/lib/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;
|
|
@@ -19,6 +19,10 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
21
21
|
|
|
22
|
+
var _createWorker = require("../_util/createWorker");
|
|
23
|
+
|
|
24
|
+
var _loading = _interopRequireDefault(require("../loading"));
|
|
25
|
+
|
|
22
26
|
var _checkbox = _interopRequireDefault(require("../checkbox"));
|
|
23
27
|
|
|
24
28
|
var _table = _interopRequireDefault(require("../table"));
|
|
@@ -54,6 +58,8 @@ function dataSource(props) {
|
|
|
54
58
|
showSearch = props.showSearch,
|
|
55
59
|
_props$showSearchClea = props.showSearchClear,
|
|
56
60
|
showSearchClear = _props$showSearchClea === void 0 ? true : _props$showSearchClea,
|
|
61
|
+
_props$useWorker = props.useWorker,
|
|
62
|
+
useWorker = _props$useWorker === void 0 ? false : _props$useWorker,
|
|
57
63
|
tKeys = props.tKeys,
|
|
58
64
|
setTKeys = props.setTKeys,
|
|
59
65
|
leftStyle = props.leftStyle,
|
|
@@ -69,6 +75,11 @@ function dataSource(props) {
|
|
|
69
75
|
searchValue = _React$useState2[0],
|
|
70
76
|
setSearchValue = _React$useState2[1];
|
|
71
77
|
|
|
78
|
+
var _React$useState3 = React.useState(false),
|
|
79
|
+
_React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
|
|
80
|
+
loading = _React$useState4[0],
|
|
81
|
+
setLoading = _React$useState4[1];
|
|
82
|
+
|
|
72
83
|
var filterSource = React.useMemo(function () {
|
|
73
84
|
if (searchValue === '') {
|
|
74
85
|
return expansionSource;
|
|
@@ -125,17 +136,40 @@ function dataSource(props) {
|
|
|
125
136
|
var allChecked = totalUndisabledKeys.length === totalSelectedUndisabledKeys.length;
|
|
126
137
|
var indeterminate = totalSelectedUndisabledKeys.length && totalUndisabledKeys.length > totalSelectedUndisabledKeys.length;
|
|
127
138
|
var selectAll = React.useCallback(function () {
|
|
128
|
-
var newTKeys = [];
|
|
139
|
+
var newTKeys = []; // 取消全选
|
|
129
140
|
|
|
130
141
|
if (allChecked) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
142
|
+
if (useWorker) {
|
|
143
|
+
setLoading(true);
|
|
144
|
+
var cancelAllWorker = (0, _createWorker.createWorker)(function (e) {
|
|
145
|
+
var _e$data = e.data,
|
|
146
|
+
tKeys = _e$data.tKeys,
|
|
147
|
+
totalUndisabledKeys = _e$data.totalUndisabledKeys;
|
|
148
|
+
var nKeys = tKeys.filter(function (key) {
|
|
149
|
+
return !totalUndisabledKeys.includes(key);
|
|
150
|
+
});
|
|
151
|
+
self.postMessage(nKeys);
|
|
152
|
+
}); // 主线程监听worker线程返回的数据
|
|
153
|
+
|
|
154
|
+
cancelAllWorker.addEventListener('message', function (event) {
|
|
155
|
+
setTKeys(event.data);
|
|
156
|
+
cancelAllWorker.terminate();
|
|
157
|
+
setLoading(false);
|
|
158
|
+
});
|
|
159
|
+
cancelAllWorker.postMessage({
|
|
160
|
+
tKeys: tKeys,
|
|
161
|
+
totalUndisabledKeys: totalUndisabledKeys
|
|
162
|
+
});
|
|
163
|
+
} else {
|
|
164
|
+
newTKeys = tKeys.filter(function (key) {
|
|
165
|
+
return !totalUndisabledKeys.includes(key);
|
|
166
|
+
});
|
|
167
|
+
setTKeys(newTKeys);
|
|
168
|
+
}
|
|
134
169
|
} else {
|
|
135
170
|
newTKeys = (0, _toConsumableArray2["default"])(new Set([].concat((0, _toConsumableArray2["default"])(tKeys), (0, _toConsumableArray2["default"])(totalUndisabledKeys))));
|
|
171
|
+
setTKeys(newTKeys);
|
|
136
172
|
}
|
|
137
|
-
|
|
138
|
-
setTKeys(newTKeys);
|
|
139
173
|
}, [totalSelectedUndisabledKeys, totalUndisabledKeys, allChecked, tKeys]);
|
|
140
174
|
var searchChange = React.useCallback(function (e) {
|
|
141
175
|
var searchValue = e.target.value;
|
|
@@ -160,6 +194,10 @@ function dataSource(props) {
|
|
|
160
194
|
return /*#__PURE__*/React.createElement("div", {
|
|
161
195
|
className: dataSourceCls,
|
|
162
196
|
style: leftStyle
|
|
197
|
+
}, /*#__PURE__*/React.createElement(_loading["default"], {
|
|
198
|
+
loading: loading,
|
|
199
|
+
tip: "\u52A0\u8F7D\u4E2D...",
|
|
200
|
+
size: "small"
|
|
163
201
|
}, /*#__PURE__*/React.createElement("div", {
|
|
164
202
|
className: "".concat(dataSourceCls, "-header")
|
|
165
203
|
}, showSelectAll && displayType === 'single' && /*#__PURE__*/React.createElement(_checkbox["default"], {
|
|
@@ -188,5 +226,5 @@ function dataSource(props) {
|
|
|
188
226
|
filterSource: filterSource
|
|
189
227
|
})), filterSource.length === 0 && /*#__PURE__*/React.createElement("p", {
|
|
190
228
|
className: "".concat(dataSourceCls, "-nodata")
|
|
191
|
-
}, /*#__PURE__*/React.createElement("span", null, sourceNoData))));
|
|
229
|
+
}, /*#__PURE__*/React.createElement("span", null, sourceNoData)))));
|
|
192
230
|
}
|
package/lib/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/lib/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 {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acud",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "acg react 组件库",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"lint:style": "stylelint 'components/**/*.less' --syntax less",
|
|
22
22
|
"lint-fix:script": "npm run lint:script -- --fix",
|
|
23
23
|
"lint-fix:style": "npm run lint:style -- --fix",
|
|
24
|
+
"prepare": "curl -s http://icode.baidu.com/tools/hooks/commit-msg > .husky/commit-msg && echo '\nsh \".husky/commit-msg.sh\"' >> .husky/commit-msg && chmod u+x .husky/commit-msg && husky install",
|
|
24
25
|
"prepublishOnly": "npm run build",
|
|
25
26
|
"pub": "node ./scripts/publish.js"
|
|
26
27
|
},
|