acud 1.0.4 → 1.0.7
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/dist/acud.css +23 -9
- package/dist/acud.css.map +1 -1
- package/dist/acud.js +426 -748
- 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 +9 -9
- 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/date-picker/src/PickerPanel.js +1 -0
- package/es/date-picker/src/RangePicker.js +1 -0
- 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/input-number/src/hooks/useFrame.d.ts +1 -1
- package/es/select/src/OptionList.js +6 -6
- package/es/timeline/style/common.less +4 -4
- package/es/timeline/style/index.css +0 -8
- package/es/toast/style/index.less +1 -1
- package/es/transfer/DataSource.js +43 -7
- package/es/transfer/index.d.ts +1 -0
- package/es/virtual-list/List.js +7 -0
- package/lib/_util/createWorker.d.ts +1 -0
- package/lib/_util/createWorker.js +16 -0
- package/lib/date-picker/src/PickerPanel.js +1 -0
- package/lib/date-picker/src/RangePicker.js +1 -0
- 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/input-number/src/hooks/useFrame.d.ts +1 -1
- package/lib/select/src/OptionList.js +6 -6
- package/lib/timeline/style/common.less +4 -4
- package/lib/timeline/style/index.css +0 -8
- package/lib/toast/style/index.less +1 -1
- package/lib/transfer/DataSource.js +45 -7
- package/lib/transfer/index.d.ts +1 -0
- package/lib/virtual-list/List.js +7 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createWorker(f: (e: any) => void): Worker;
|
|
@@ -122,6 +122,7 @@ function PickerPanel(props) {
|
|
|
122
122
|
var now = generateConfig.getNow();
|
|
123
123
|
if (!date) return now; // When value is null and set showTime
|
|
124
124
|
|
|
125
|
+
// When value is null and set showTime
|
|
125
126
|
if (!mergedValue && showTime) {
|
|
126
127
|
if (_typeof(showTime) === 'object') {
|
|
127
128
|
return setDateTime(generateConfig, date, showTime.defaultValue || now);
|
|
@@ -172,6 +172,7 @@ function InnerRangePicker(props) {
|
|
|
172
172
|
} // Fill disabled unit
|
|
173
173
|
|
|
174
174
|
|
|
175
|
+
// Fill disabled unit
|
|
175
176
|
for (var i = 0; i < 2; i += 1) {
|
|
176
177
|
if (mergedDisabled[i] && !getValue(postValues, i) && !getValue(allowEmpty, i)) {
|
|
177
178
|
postValues = updateValues(postValues, generateConfig.getNow(), i);
|
|
@@ -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) {
|
|
@@ -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"),
|
|
@@ -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;
|
|
@@ -177,10 +177,6 @@
|
|
|
177
177
|
margin-top: 4px;
|
|
178
178
|
transition: opacity 0.2s linear;
|
|
179
179
|
}
|
|
180
|
-
.common-content-link svg {
|
|
181
|
-
position: relative;
|
|
182
|
-
top: 2.5px;
|
|
183
|
-
}
|
|
184
180
|
.common-content-link-label {
|
|
185
181
|
flex-shrink: 0;
|
|
186
182
|
margin-right: 4px;
|
|
@@ -594,10 +590,6 @@
|
|
|
594
590
|
margin-top: 4px;
|
|
595
591
|
transition: opacity 0.2s linear;
|
|
596
592
|
}
|
|
597
|
-
.acud-timeline-item-content-link svg {
|
|
598
|
-
position: relative;
|
|
599
|
-
top: 2.5px;
|
|
600
|
-
}
|
|
601
593
|
.acud-timeline-item-content-link-label {
|
|
602
594
|
flex-shrink: 0;
|
|
603
595
|
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/virtual-list/List.js
CHANGED
|
@@ -135,6 +135,7 @@ export function RawList(props, ref) {
|
|
|
135
135
|
} // Always use virtual scroll bar in avoid shaking
|
|
136
136
|
|
|
137
137
|
|
|
138
|
+
// Always use virtual scroll bar in avoid shaking
|
|
138
139
|
if (!inVirtual) {
|
|
139
140
|
return {
|
|
140
141
|
scrollHeight: ((_a = fillerInnerRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0,
|
|
@@ -156,12 +157,14 @@ export function RawList(props, ref) {
|
|
|
156
157
|
var cacheHeight = heights.get(key);
|
|
157
158
|
var currentItemBottom = itemTop + (cacheHeight === undefined ? itemHeight : cacheHeight); // Check item top in the range
|
|
158
159
|
|
|
160
|
+
// Check item top in the range
|
|
159
161
|
if (currentItemBottom >= scrollTop && startIndex === undefined) {
|
|
160
162
|
startIndex = i;
|
|
161
163
|
startOffset = itemTop;
|
|
162
164
|
} // Check item bottom in the range. We will render additional one item for motion usage
|
|
163
165
|
|
|
164
166
|
|
|
167
|
+
// Check item bottom in the range. We will render additional one item for motion usage
|
|
165
168
|
if (currentItemBottom > scrollTop + height && endIndex === undefined) {
|
|
166
169
|
endIndex = i;
|
|
167
170
|
}
|
|
@@ -172,6 +175,9 @@ export function RawList(props, ref) {
|
|
|
172
175
|
/* istanbul ignore next */
|
|
173
176
|
|
|
174
177
|
|
|
178
|
+
// Fallback to normal if not match. This code should never reach
|
|
179
|
+
|
|
180
|
+
/* istanbul ignore next */
|
|
175
181
|
if (startIndex === undefined) {
|
|
176
182
|
startIndex = 0;
|
|
177
183
|
startOffset = 0;
|
|
@@ -182,6 +188,7 @@ export function RawList(props, ref) {
|
|
|
182
188
|
} // Give cache to improve scroll experience
|
|
183
189
|
|
|
184
190
|
|
|
191
|
+
// Give cache to improve scroll experience
|
|
185
192
|
endIndex = Math.min(endIndex + 1, mergedData.length);
|
|
186
193
|
return {
|
|
187
194
|
scrollHeight: itemTop,
|
|
@@ -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
|
+
}
|
|
@@ -159,6 +159,7 @@ function PickerPanel(props) {
|
|
|
159
159
|
var now = generateConfig.getNow();
|
|
160
160
|
if (!date) return now; // When value is null and set showTime
|
|
161
161
|
|
|
162
|
+
// When value is null and set showTime
|
|
162
163
|
if (!mergedValue && showTime) {
|
|
163
164
|
if ((0, _typeof2["default"])(showTime) === 'object') {
|
|
164
165
|
return (0, _timeUtil.setDateTime)(generateConfig, date, showTime.defaultValue || now);
|
|
@@ -212,6 +212,7 @@ function InnerRangePicker(props) {
|
|
|
212
212
|
} // Fill disabled unit
|
|
213
213
|
|
|
214
214
|
|
|
215
|
+
// Fill disabled unit
|
|
215
216
|
for (var i = 0; i < 2; i += 1) {
|
|
216
217
|
if (mergedDisabled[i] && !(0, _miscUtil.getValue)(postValues, i) && !(0, _miscUtil.getValue)(allowEmpty, i)) {
|
|
217
218
|
postValues = (0, _miscUtil.updateValues)(postValues, generateConfig.getNow(), i);
|
|
@@ -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) {
|
|
@@ -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"),
|
|
@@ -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;
|
|
@@ -177,10 +177,6 @@
|
|
|
177
177
|
margin-top: 4px;
|
|
178
178
|
transition: opacity 0.2s linear;
|
|
179
179
|
}
|
|
180
|
-
.common-content-link svg {
|
|
181
|
-
position: relative;
|
|
182
|
-
top: 2.5px;
|
|
183
|
-
}
|
|
184
180
|
.common-content-link-label {
|
|
185
181
|
flex-shrink: 0;
|
|
186
182
|
margin-right: 4px;
|
|
@@ -594,10 +590,6 @@
|
|
|
594
590
|
margin-top: 4px;
|
|
595
591
|
transition: opacity 0.2s linear;
|
|
596
592
|
}
|
|
597
|
-
.acud-timeline-item-content-link svg {
|
|
598
|
-
position: relative;
|
|
599
|
-
top: 2.5px;
|
|
600
|
-
}
|
|
601
593
|
.acud-timeline-item-content-link-label {
|
|
602
594
|
flex-shrink: 0;
|
|
603
595
|
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;
|