acud 0.0.65 → 0.0.68
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 +299 -147
- package/dist/acud.css.map +1 -1
- package/dist/acud.js +1512 -1078
- 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 +11 -5
- package/dist/acud.min.js.map +1 -1
- package/es/breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/es/breadcrumb/BreadcrumbItem.js +16 -4
- package/es/button/button.d.ts +1 -0
- package/es/button/button.js +1 -0
- package/es/cascader/index.js +20 -5
- package/es/cascader/style/index.css +2 -57
- package/es/cascader/style/index.less +2 -17
- package/es/clear/index.d.ts +12 -0
- package/es/clear/index.js +41 -0
- package/es/clear/style/css.js +2 -0
- package/es/clear/style/index.css +63 -0
- package/es/clear/style/index.d.ts +2 -0
- package/es/clear/style/index.js +2 -0
- package/es/clear/style/index.less +18 -0
- package/es/date-picker/generatePicker/generateRangePicker.js +2 -2
- package/es/date-picker/generatePicker/generateSinglePicker.js +2 -2
- package/es/date-picker/src/PickerPanel.js +4 -1
- package/es/date-picker/src/utils/uiUtil.js +4 -4
- package/es/date-picker/style/index.css +106 -53
- package/es/date-picker/style/panel.less +83 -18
- package/es/dialog-box/style/index.css +4 -4
- package/es/dropdown/dropdown-button.js +7 -1
- package/es/dropdown/rc-dropdown/Dropdown.js +1 -0
- package/es/dropdown/style/index.css +2 -1
- package/es/dropdown/style/index.less +2 -1
- package/es/form/style/horizontal.less +1 -0
- package/es/form/style/index.css +3 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/modal/DialogBox.d.ts +1 -1
- package/es/modal/Modal.d.ts +5 -2
- package/es/modal/Modal.js +6 -4
- package/es/modal/style/index.css +41 -11
- package/es/modal/style/index.less +35 -7
- package/es/modal/style/mixin.less +4 -4
- package/es/progress/CircleProgress.js +2 -2
- package/es/progress/LineProgress.js +4 -2
- package/es/progress/style/common.less +5 -3
- package/es/progress/style/index.css +2 -1
- package/es/radio/index.d.ts +3 -0
- package/es/style/themes/dark/components/modal.less +14 -9
- package/es/style/themes/default/components/cascader.less +0 -4
- package/es/style/themes/default/components/clear.less +2 -0
- package/es/style/themes/default/components/datePicker.less +1 -0
- package/es/style/themes/default/components/index.less +1 -0
- package/es/style/themes/default/components/modal.less +13 -13
- package/es/switch/index.d.ts +2 -3
- package/es/switch/index.js +11 -3
- package/es/switch/interface.d.ts +4 -0
- package/es/switch/style/index.css +31 -0
- package/es/switch/style/index.less +33 -1
- package/es/tabs/src/TabNavList/index.js +2 -2
- package/es/tabs/style/index.css +0 -1
- package/es/tabs/style/index.less +0 -1
- package/es/time-picker/style/index.css +1 -0
- package/es/time-picker/style/index.less +1 -0
- package/es/tooltip/index.js +1 -1
- package/es/transfer/{dataSource.d.ts → DataSource.d.ts} +1 -1
- package/es/transfer/{dataSource.js → DataSource.js} +37 -6
- package/{lib/transfer/sourceList.d.ts → es/transfer/SourceList.d.ts} +2 -2
- package/es/transfer/{sourceList.js → SourceList.js} +0 -0
- package/es/transfer/{target.d.ts → Target.d.ts} +1 -1
- package/es/transfer/{target.js → Target.js} +60 -4
- package/{lib/transfer/targetList.d.ts → es/transfer/TargetList.d.ts} +2 -2
- package/es/transfer/{targetList.js → TargetList.js} +0 -0
- package/es/transfer/index.d.ts +3 -0
- package/es/transfer/index.js +16 -7
- package/es/transfer/style/css.js +3 -1
- package/es/transfer/style/index.css +25 -5
- package/es/transfer/style/index.d.ts +1 -0
- package/es/transfer/style/index.js +3 -1
- package/es/transfer/style/index.less +30 -5
- package/es/upload/UploadList/ListItem.js +7 -2
- package/es/upload/UploadList/index.js +4 -7
- package/es/upload/style/index.css +17 -13
- package/es/upload/style/index.less +25 -20
- package/es/upload/utils.js +1 -1
- package/lib/breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/lib/breadcrumb/BreadcrumbItem.js +21 -8
- package/lib/button/button.d.ts +1 -0
- package/lib/button/button.js +1 -0
- package/lib/cascader/index.js +21 -6
- package/lib/cascader/style/index.css +2 -57
- package/lib/cascader/style/index.less +2 -17
- package/lib/clear/index.d.ts +12 -0
- package/lib/clear/index.js +55 -0
- package/lib/clear/style/css.js +5 -0
- package/lib/clear/style/index.css +63 -0
- package/lib/clear/style/index.d.ts +2 -0
- package/lib/clear/style/index.js +5 -0
- package/lib/clear/style/index.less +18 -0
- package/lib/date-picker/generatePicker/generateRangePicker.js +3 -3
- package/lib/date-picker/generatePicker/generateSinglePicker.js +3 -3
- package/lib/date-picker/src/PickerPanel.js +4 -1
- package/lib/date-picker/src/utils/uiUtil.js +4 -4
- package/lib/date-picker/style/index.css +106 -53
- package/lib/date-picker/style/panel.less +83 -18
- package/lib/dialog-box/style/index.css +4 -4
- package/lib/dropdown/dropdown-button.js +7 -1
- package/lib/dropdown/rc-dropdown/Dropdown.js +1 -0
- package/lib/dropdown/style/index.css +2 -1
- package/lib/dropdown/style/index.less +2 -1
- package/lib/form/style/horizontal.less +1 -0
- package/lib/form/style/index.css +3 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +8 -0
- package/lib/modal/DialogBox.d.ts +1 -1
- package/lib/modal/Modal.d.ts +5 -2
- package/lib/modal/Modal.js +6 -4
- package/lib/modal/style/index.css +41 -11
- package/lib/modal/style/index.less +35 -7
- package/lib/modal/style/mixin.less +4 -4
- package/lib/progress/CircleProgress.js +2 -2
- package/lib/progress/LineProgress.js +4 -2
- package/lib/progress/style/common.less +5 -3
- package/lib/progress/style/index.css +2 -1
- package/lib/radio/index.d.ts +3 -0
- package/lib/style/components.less +1 -0
- package/lib/style/themes/dark/components/modal.less +14 -9
- package/lib/style/themes/default/components/cascader.less +0 -4
- package/lib/style/themes/default/components/clear.less +2 -0
- package/lib/style/themes/default/components/datePicker.less +1 -0
- package/lib/style/themes/default/components/index.less +1 -0
- package/lib/style/themes/default/components/modal.less +13 -13
- package/lib/switch/index.d.ts +2 -3
- package/lib/switch/index.js +12 -3
- package/lib/switch/interface.d.ts +4 -0
- package/lib/switch/style/index.css +31 -0
- package/lib/switch/style/index.less +33 -1
- package/lib/tabs/src/TabNavList/index.js +2 -2
- package/lib/tabs/style/index.css +0 -1
- package/lib/tabs/style/index.less +0 -1
- package/lib/time-picker/style/index.css +1 -0
- package/lib/time-picker/style/index.less +1 -0
- package/lib/tooltip/index.js +1 -1
- package/lib/transfer/{dataSource.d.ts → DataSource.d.ts} +1 -1
- package/lib/transfer/{dataSource.js → DataSource.js} +38 -6
- package/{es/transfer/sourceList.d.ts → lib/transfer/SourceList.d.ts} +2 -2
- package/lib/transfer/{sourceList.js → SourceList.js} +0 -0
- package/lib/transfer/{target.d.ts → Target.d.ts} +1 -1
- package/lib/transfer/{target.js → Target.js} +63 -5
- package/{es/transfer/targetList.d.ts → lib/transfer/TargetList.d.ts} +2 -2
- package/lib/transfer/{targetList.js → TargetList.js} +0 -0
- package/lib/transfer/index.d.ts +3 -0
- package/lib/transfer/index.js +18 -10
- package/lib/transfer/style/css.js +3 -1
- package/lib/transfer/style/index.css +25 -5
- package/lib/transfer/style/index.d.ts +1 -0
- package/lib/transfer/style/index.js +3 -1
- package/lib/transfer/style/index.less +30 -5
- package/lib/upload/UploadList/ListItem.js +7 -2
- package/lib/upload/UploadList/index.js +4 -7
- package/lib/upload/style/index.css +17 -13
- package/lib/upload/style/index.less +25 -20
- package/lib/upload/utils.js +1 -1
- package/package.json +2 -2
|
@@ -21,9 +21,11 @@ var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
|
21
21
|
|
|
22
22
|
var _checkbox = _interopRequireDefault(require("../checkbox"));
|
|
23
23
|
|
|
24
|
+
var _table = _interopRequireDefault(require("../table"));
|
|
25
|
+
|
|
24
26
|
var _search = _interopRequireDefault(require("../search"));
|
|
25
27
|
|
|
26
|
-
var
|
|
28
|
+
var _SourceList = _interopRequireDefault(require("./SourceList"));
|
|
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); }
|
|
29
31
|
|
|
@@ -37,13 +39,18 @@ var defaultFilterOption = function defaultFilterOption(inputValue, option) {
|
|
|
37
39
|
return option.title.indexOf(inputValue) > -1;
|
|
38
40
|
};
|
|
39
41
|
|
|
42
|
+
var defaultTableFilterOption = function defaultTableFilterOption(inputValue, option) {
|
|
43
|
+
return option.key.indexOf(inputValue) > -1;
|
|
44
|
+
};
|
|
45
|
+
|
|
40
46
|
function dataSource(props) {
|
|
41
47
|
var prefixCls = props.prefixCls,
|
|
48
|
+
displayType = props.displayType,
|
|
49
|
+
columns = props.columns,
|
|
42
50
|
expansionSource = props.expansionSource,
|
|
43
51
|
_props$showSelectAll = props.showSelectAll,
|
|
44
52
|
showSelectAll = _props$showSelectAll === void 0 ? true : _props$showSelectAll,
|
|
45
|
-
|
|
46
|
-
filterOption = _props$filterOption === void 0 ? defaultFilterOption : _props$filterOption,
|
|
53
|
+
filterOptionProp = props.filterOption,
|
|
47
54
|
showSearch = props.showSearch,
|
|
48
55
|
_props$showSearchClea = props.showSearchClear,
|
|
49
56
|
showSearchClear = _props$showSearchClea === void 0 ? true : _props$showSearchClea,
|
|
@@ -51,6 +58,7 @@ function dataSource(props) {
|
|
|
51
58
|
setTKeys = props.setTKeys,
|
|
52
59
|
leftStyle = props.leftStyle,
|
|
53
60
|
locale = props.locale;
|
|
61
|
+
var filterOption = filterOptionProp || (displayType === 'table' ? defaultTableFilterOption : defaultFilterOption);
|
|
54
62
|
var dataSourceCls = "".concat(prefixCls, "-datasource");
|
|
55
63
|
var sourceTitle = locale.sourceTitle,
|
|
56
64
|
searchPlaceholder = locale.searchPlaceholder,
|
|
@@ -100,7 +108,7 @@ function dataSource(props) {
|
|
|
100
108
|
}
|
|
101
109
|
});
|
|
102
110
|
return fileterCloneSource;
|
|
103
|
-
}, [searchValue, expansionSource]);
|
|
111
|
+
}, [searchValue, expansionSource, displayType]);
|
|
104
112
|
var totalUndisabledKeys = React.useMemo(function () {
|
|
105
113
|
var unDisabledDataSource = filterSource.filter(function (data) {
|
|
106
114
|
return !data.group && !data.disabled;
|
|
@@ -133,14 +141,31 @@ function dataSource(props) {
|
|
|
133
141
|
var searchValue = e.target.value;
|
|
134
142
|
setSearchValue(searchValue);
|
|
135
143
|
}, []);
|
|
144
|
+
|
|
145
|
+
var onSelectChange = function onSelectChange(v) {
|
|
146
|
+
// 排除filter中包含的tKeys,记为noneFilterKeys
|
|
147
|
+
// 联合noneFilterKeys与filter中的选择项,记为最终keys
|
|
148
|
+
var noneFilterKeys = tKeys.filter(function (key) {
|
|
149
|
+
return !filterSource.some(function (item) {
|
|
150
|
+
return item.key === key;
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
setTKeys([].concat((0, _toConsumableArray2["default"])(noneFilterKeys), (0, _toConsumableArray2["default"])(v)));
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
var rowSelection = {
|
|
157
|
+
onChange: onSelectChange,
|
|
158
|
+
selectedRowKeys: tKeys
|
|
159
|
+
};
|
|
136
160
|
return /*#__PURE__*/React.createElement("div", {
|
|
137
161
|
className: dataSourceCls,
|
|
138
162
|
style: leftStyle
|
|
139
163
|
}, /*#__PURE__*/React.createElement("div", {
|
|
140
164
|
className: "".concat(dataSourceCls, "-header")
|
|
141
|
-
}, showSelectAll && /*#__PURE__*/React.createElement(_checkbox["default"], {
|
|
165
|
+
}, showSelectAll && displayType === 'single' && /*#__PURE__*/React.createElement(_checkbox["default"], {
|
|
142
166
|
checked: allChecked,
|
|
143
167
|
indeterminate: indeterminate,
|
|
168
|
+
className: "".concat(dataSourceCls, "-header-checkall"),
|
|
144
169
|
onClick: selectAll
|
|
145
170
|
}), /*#__PURE__*/React.createElement("span", {
|
|
146
171
|
className: "".concat(dataSourceCls, "-label")
|
|
@@ -152,7 +177,14 @@ function dataSource(props) {
|
|
|
152
177
|
allowClear: showSearchClear,
|
|
153
178
|
size: "small",
|
|
154
179
|
onChange: searchChange
|
|
155
|
-
}), !!filterSource.length && /*#__PURE__*/React.createElement(
|
|
180
|
+
}), !!filterSource.length && displayType === 'table' && /*#__PURE__*/React.createElement("div", {
|
|
181
|
+
className: "".concat(prefixCls, "-table-box")
|
|
182
|
+
}, /*#__PURE__*/React.createElement(_table["default"], {
|
|
183
|
+
pagination: false,
|
|
184
|
+
dataSource: filterSource,
|
|
185
|
+
columns: columns,
|
|
186
|
+
rowSelection: rowSelection
|
|
187
|
+
})), !!filterSource.length && displayType === 'single' && /*#__PURE__*/React.createElement(_SourceList["default"], (0, _extends2["default"])({}, props, {
|
|
156
188
|
filterSource: filterSource
|
|
157
189
|
})), filterSource.length === 0 && /*#__PURE__*/React.createElement("p", {
|
|
158
190
|
className: "".concat(dataSourceCls, "-nodata")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DataSourceProps } from './
|
|
3
|
-
import { TransferItem } from '
|
|
2
|
+
import { DataSourceProps } from './DataSource';
|
|
3
|
+
import { TransferItem } from '.';
|
|
4
4
|
export interface DataSourceListProps<RecordType> extends DataSourceProps<RecordType> {
|
|
5
5
|
filterSource: RecordType[];
|
|
6
6
|
}
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TransferItem, TransferProps } from '
|
|
2
|
+
import { TransferItem, TransferProps } from '.';
|
|
3
3
|
export interface DataSourceProps<RecordType> extends TransferProps<RecordType> {
|
|
4
4
|
tKeys: string[];
|
|
5
5
|
setTKeys: (t: string[]) => void;
|
|
@@ -13,13 +13,19 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
13
13
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
|
|
16
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
|
+
|
|
16
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
19
|
|
|
18
20
|
var React = _interopRequireWildcard(require("react"));
|
|
19
21
|
|
|
20
|
-
var
|
|
22
|
+
var _dedupe = _interopRequireDefault(require("classnames/dedupe"));
|
|
23
|
+
|
|
24
|
+
var _acudIcon = require("acud-icon");
|
|
21
25
|
|
|
22
|
-
var
|
|
26
|
+
var _table = _interopRequireDefault(require("../table"));
|
|
27
|
+
|
|
28
|
+
var _TargetList = _interopRequireDefault(require("./TargetList"));
|
|
23
29
|
|
|
24
30
|
var _search = _interopRequireDefault(require("../search"));
|
|
25
31
|
|
|
@@ -39,6 +45,7 @@ function target(props) {
|
|
|
39
45
|
var _classnames;
|
|
40
46
|
|
|
41
47
|
var prefixCls = props.prefixCls,
|
|
48
|
+
displayType = props.displayType,
|
|
42
49
|
_props$showClearAll = props.showClearAll,
|
|
43
50
|
showClearAll = _props$showClearAll === void 0 ? true : _props$showClearAll,
|
|
44
51
|
_props$filterOption = props.filterOption,
|
|
@@ -50,7 +57,8 @@ function target(props) {
|
|
|
50
57
|
setTKeys = props.setTKeys,
|
|
51
58
|
rightStyle = props.rightStyle,
|
|
52
59
|
locale = props.locale,
|
|
53
|
-
expansionSource = props.expansionSource
|
|
60
|
+
expansionSource = props.expansionSource,
|
|
61
|
+
columns = props.columns;
|
|
54
62
|
var targetCls = "".concat(prefixCls, "-target");
|
|
55
63
|
var targetTitle = locale.targetTitle,
|
|
56
64
|
searchPlaceholder = locale.searchPlaceholder,
|
|
@@ -125,7 +133,51 @@ function target(props) {
|
|
|
125
133
|
var searchValue = e.target.value;
|
|
126
134
|
setSearchValue(searchValue);
|
|
127
135
|
}, []);
|
|
128
|
-
var
|
|
136
|
+
var targetColumns = React.useMemo(function () {
|
|
137
|
+
if (!columns) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
var cancelItem = function cancelItem(data) {
|
|
142
|
+
if (data.disabled) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var curTKeys = (0, _toConsumableArray2["default"])(tKeys);
|
|
147
|
+
|
|
148
|
+
if (data.group) {
|
|
149
|
+
var deleteKeys = data.childrenKeys;
|
|
150
|
+
curTKeys = curTKeys.filter(function (tKey) {
|
|
151
|
+
return !deleteKeys.includes(tKey);
|
|
152
|
+
});
|
|
153
|
+
} else if (curTKeys.includes(data.key)) {
|
|
154
|
+
curTKeys.splice(curTKeys.indexOf(data.key), 1);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
setTKeys(curTKeys);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
var tColumns = (0, _toConsumableArray2["default"])(columns);
|
|
161
|
+
tColumns.push({
|
|
162
|
+
title: '',
|
|
163
|
+
key: 'action',
|
|
164
|
+
width: 40,
|
|
165
|
+
render: function render(_text, data) {
|
|
166
|
+
if (!data.disabled) {
|
|
167
|
+
return /*#__PURE__*/React.createElement(_acudIcon.OutlinedClose, {
|
|
168
|
+
className: "".concat(prefixCls, "-target-item-cancel"),
|
|
169
|
+
onClick: function onClick() {
|
|
170
|
+
return cancelItem(data);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
return tColumns;
|
|
179
|
+
}, [columns, tKeys]);
|
|
180
|
+
var clearCls = (0, _dedupe["default"])((_classnames = {}, (0, _defineProperty2["default"])(_classnames, "".concat(targetCls, "-clear-all"), true), (0, _defineProperty2["default"])(_classnames, "".concat(targetCls, "-clear-all-disabled"), filterSource.length === totalDisabledKeys.length), _classnames));
|
|
129
181
|
return /*#__PURE__*/React.createElement("div", {
|
|
130
182
|
className: targetCls,
|
|
131
183
|
style: rightStyle
|
|
@@ -145,7 +197,13 @@ function target(props) {
|
|
|
145
197
|
allowClear: showSearchClear,
|
|
146
198
|
size: "small",
|
|
147
199
|
onChange: searchChange
|
|
148
|
-
}), !!filterSource.length && /*#__PURE__*/React.createElement(
|
|
200
|
+
}), !!filterSource.length && displayType === 'table' && /*#__PURE__*/React.createElement("div", {
|
|
201
|
+
className: "".concat(prefixCls, "-table-box")
|
|
202
|
+
}, /*#__PURE__*/React.createElement(_table["default"], {
|
|
203
|
+
pagination: false,
|
|
204
|
+
dataSource: filterSource,
|
|
205
|
+
columns: targetColumns
|
|
206
|
+
})), !!filterSource.length && displayType === 'single' && /*#__PURE__*/React.createElement(_TargetList["default"], (0, _extends2["default"])({}, props, {
|
|
149
207
|
filterSource: filterSource
|
|
150
208
|
})), filterSource.length === 0 && /*#__PURE__*/React.createElement("p", {
|
|
151
209
|
className: "".concat(prefixCls, "-target-nodata")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DataSourceProps } from './
|
|
3
|
-
import { TransferItem } from '
|
|
2
|
+
import { DataSourceProps } from './DataSource';
|
|
3
|
+
import { TransferItem } from '.';
|
|
4
4
|
export interface DataSourceListProps<RecordType> extends DataSourceProps<RecordType> {
|
|
5
5
|
filterSource: RecordType[];
|
|
6
6
|
}
|
|
File without changes
|
package/lib/transfer/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ColumnsType } from '../table';
|
|
2
3
|
export declare type TransferDirection = 'left' | 'right';
|
|
3
4
|
export declare type SelectAllLabel = React.ReactNode | ((info: {
|
|
4
5
|
selectedCount: number;
|
|
@@ -24,6 +25,7 @@ export interface TransferItem {
|
|
|
24
25
|
export interface TransferProps<RecordType> {
|
|
25
26
|
prefixCls?: string;
|
|
26
27
|
className?: string;
|
|
28
|
+
displayType?: 'single' | 'table';
|
|
27
29
|
dataSource: RecordType[];
|
|
28
30
|
targetKeys?: string[];
|
|
29
31
|
render?: TransferRender<RecordType>;
|
|
@@ -42,5 +44,6 @@ export interface TransferProps<RecordType> {
|
|
|
42
44
|
selectAllLabels?: SelectAllLabel[];
|
|
43
45
|
defaultExpandGroupKey?: string[] | string | number[] | number | boolean;
|
|
44
46
|
virtual?: boolean;
|
|
47
|
+
columns?: ColumnsType<RecordType>;
|
|
45
48
|
}
|
|
46
49
|
export default function transfer<RecordType extends TransferItem = TransferItem>(props: TransferProps<RecordType>): JSX.Element;
|
package/lib/transfer/index.js
CHANGED
|
@@ -21,9 +21,9 @@ var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
|
21
21
|
|
|
22
22
|
var _default = _interopRequireDefault(require("../locale/default"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _DataSource = _interopRequireDefault(require("./DataSource"));
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _Target = _interopRequireDefault(require("./Target"));
|
|
27
27
|
|
|
28
28
|
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); }
|
|
29
29
|
|
|
@@ -33,13 +33,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
33
33
|
* transfer 穿梭框
|
|
34
34
|
* author zhousheng
|
|
35
35
|
*/
|
|
36
|
-
;
|
|
37
|
-
|
|
38
36
|
function transfer(props) {
|
|
37
|
+
var _classnames;
|
|
38
|
+
|
|
39
39
|
var _props$prefixCls = props.prefixCls,
|
|
40
40
|
prefixCls = _props$prefixCls === void 0 ? 'acud-transfer' : _props$prefixCls,
|
|
41
|
-
_props$
|
|
42
|
-
|
|
41
|
+
_props$displayType = props.displayType,
|
|
42
|
+
displayType = _props$displayType === void 0 ? 'single' : _props$displayType,
|
|
43
|
+
targetKeys = props.targetKeys,
|
|
43
44
|
onChange = props.onChange,
|
|
44
45
|
_props$locale = props.locale,
|
|
45
46
|
locale = _props$locale === void 0 ? {} : _props$locale,
|
|
@@ -74,24 +75,31 @@ function transfer(props) {
|
|
|
74
75
|
return expansionArr;
|
|
75
76
|
}, [dataSource]);
|
|
76
77
|
|
|
77
|
-
var _React$useState = React.useState(targetKeys),
|
|
78
|
+
var _React$useState = React.useState(targetKeys || []),
|
|
78
79
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
79
80
|
tKeys = _React$useState2[0],
|
|
80
81
|
setTKeys = _React$useState2[1];
|
|
81
82
|
|
|
83
|
+
React.useEffect(function () {
|
|
84
|
+
if (Array.isArray(targetKeys)) {
|
|
85
|
+
setTKeys(targetKeys);
|
|
86
|
+
}
|
|
87
|
+
}, [targetKeys]);
|
|
82
88
|
React.useEffect(function () {
|
|
83
89
|
onChange && onChange(tKeys);
|
|
84
90
|
}, [tKeys]);
|
|
85
|
-
var classNames = (0, _classnames2["default"])((0, _defineProperty2["default"])(
|
|
91
|
+
var classNames = (0, _classnames2["default"])((_classnames = {}, (0, _defineProperty2["default"])(_classnames, prefixCls, true), (0, _defineProperty2["default"])(_classnames, "".concat(prefixCls, "-table"), displayType === 'table'), _classnames));
|
|
86
92
|
return /*#__PURE__*/React.createElement("div", {
|
|
87
93
|
className: classNames
|
|
88
|
-
}, /*#__PURE__*/React.createElement(
|
|
94
|
+
}, /*#__PURE__*/React.createElement(_DataSource["default"], (0, _extends2["default"])({}, props, {
|
|
95
|
+
displayType: displayType,
|
|
89
96
|
locale: userLocale,
|
|
90
97
|
prefixCls: prefixCls,
|
|
91
98
|
tKeys: tKeys,
|
|
92
99
|
setTKeys: setTKeys,
|
|
93
100
|
expansionSource: expansionSource
|
|
94
|
-
})), /*#__PURE__*/React.createElement(
|
|
101
|
+
})), /*#__PURE__*/React.createElement(_Target["default"], (0, _extends2["default"])({}, props, {
|
|
102
|
+
displayType: displayType,
|
|
95
103
|
locale: userLocale,
|
|
96
104
|
prefixCls: prefixCls,
|
|
97
105
|
tKeys: tKeys,
|
|
@@ -43,8 +43,10 @@
|
|
|
43
43
|
border-radius: 4px 4px 0 0;
|
|
44
44
|
line-height: 21px;
|
|
45
45
|
}
|
|
46
|
+
.acud-transfer-datasource-header-checkall {
|
|
47
|
+
margin-right: 12px;
|
|
48
|
+
}
|
|
46
49
|
.acud-transfer-datasource-label {
|
|
47
|
-
margin-left: 12px;
|
|
48
50
|
color: #151B26;
|
|
49
51
|
font-size: 12px;
|
|
50
52
|
font-weight: #FFECD4;
|
|
@@ -149,8 +151,8 @@
|
|
|
149
151
|
padding-left: 60px;
|
|
150
152
|
}
|
|
151
153
|
.acud-transfer-datasource-search {
|
|
152
|
-
height:
|
|
153
|
-
|
|
154
|
+
height: 40px;
|
|
155
|
+
padding: 8px 12px;
|
|
154
156
|
width: auto;
|
|
155
157
|
flex-shrink: 0;
|
|
156
158
|
}
|
|
@@ -327,10 +329,10 @@
|
|
|
327
329
|
padding-left: 56px;
|
|
328
330
|
}
|
|
329
331
|
.acud-transfer-target-search {
|
|
330
|
-
|
|
332
|
+
padding: 8px 12px;
|
|
331
333
|
width: auto;
|
|
332
334
|
flex-shrink: 0;
|
|
333
|
-
height:
|
|
335
|
+
height: 40px;
|
|
334
336
|
}
|
|
335
337
|
.acud-transfer-target-nodata {
|
|
336
338
|
display: flex;
|
|
@@ -346,3 +348,21 @@
|
|
|
346
348
|
.acud-transfer .acud-input input {
|
|
347
349
|
font-size: 12px;
|
|
348
350
|
}
|
|
351
|
+
.acud-transfer.acud-transfer-table .acud-transfer-datasource,
|
|
352
|
+
.acud-transfer.acud-transfer-table .acud-transfer-target {
|
|
353
|
+
height: 360px;
|
|
354
|
+
}
|
|
355
|
+
.acud-transfer.acud-transfer-table .acud-transfer-datasource-search,
|
|
356
|
+
.acud-transfer.acud-transfer-table .acud-transfer-target-search {
|
|
357
|
+
background-color: #F7F7F9;
|
|
358
|
+
border-top: 1px solid #fff;
|
|
359
|
+
}
|
|
360
|
+
.acud-transfer.acud-transfer-table table {
|
|
361
|
+
border-top: 1px solid #fff;
|
|
362
|
+
}
|
|
363
|
+
.acud-transfer.acud-transfer-table table thead tr th:nth-last-child(2) {
|
|
364
|
+
border-right: none;
|
|
365
|
+
}
|
|
366
|
+
.acud-transfer.acud-transfer-table .acud-transfer-table-box {
|
|
367
|
+
overflow: auto;
|
|
368
|
+
}
|
|
@@ -35,9 +35,11 @@
|
|
|
35
35
|
background-color: @G10;
|
|
36
36
|
border-radius: @R3 @R3 0 0;
|
|
37
37
|
line-height: 21px;
|
|
38
|
+
&-checkall {
|
|
39
|
+
margin-right: @P * 3;
|
|
40
|
+
}
|
|
38
41
|
}
|
|
39
42
|
&-label {
|
|
40
|
-
margin-left: @P * 3;
|
|
41
43
|
color: @G2;
|
|
42
44
|
font-size: @T2;
|
|
43
45
|
font-weight: @W2;
|
|
@@ -88,8 +90,8 @@
|
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
&-search {
|
|
91
|
-
height: @P *
|
|
92
|
-
|
|
93
|
+
height: @P * 10;
|
|
94
|
+
padding: @P * 2 @P * 3;
|
|
93
95
|
width: auto;
|
|
94
96
|
flex-shrink: 0;
|
|
95
97
|
}
|
|
@@ -188,10 +190,10 @@
|
|
|
188
190
|
}
|
|
189
191
|
}
|
|
190
192
|
&-search {
|
|
191
|
-
|
|
193
|
+
padding: @P * 2 @P * 3;
|
|
192
194
|
width: auto;
|
|
193
195
|
flex-shrink: 0;
|
|
194
|
-
height: @P *
|
|
196
|
+
height: @P * 10;
|
|
195
197
|
}
|
|
196
198
|
&-nodata {
|
|
197
199
|
display: flex;
|
|
@@ -208,4 +210,27 @@
|
|
|
208
210
|
.@{acud-prefix}-input input {
|
|
209
211
|
font-size: 12px;
|
|
210
212
|
}
|
|
213
|
+
&.@{transfer-prefix-cls}-table {
|
|
214
|
+
.@{transfer-prefix-cls}-datasource,
|
|
215
|
+
.@{transfer-prefix-cls}-target {
|
|
216
|
+
height: 360px;
|
|
217
|
+
}
|
|
218
|
+
.@{transfer-prefix-cls}-datasource-search,
|
|
219
|
+
.@{transfer-prefix-cls}-target-search {
|
|
220
|
+
background-color: @G10;
|
|
221
|
+
border-top: 1px solid #fff;
|
|
222
|
+
}
|
|
223
|
+
table {
|
|
224
|
+
border-top: 1px solid #fff;
|
|
225
|
+
thead tr th:nth-last-child(2) {
|
|
226
|
+
border-right: none;
|
|
227
|
+
}
|
|
228
|
+
tbody > tr:last-child > td {
|
|
229
|
+
// border-bottom: none;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
.@{transfer-prefix-cls}-table-box {
|
|
233
|
+
overflow: auto;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
211
236
|
}
|
|
@@ -132,7 +132,11 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
132
132
|
|
|
133
133
|
var infoUploadingClass = (0, _classnames["default"])((_classNames3 = {}, (0, _defineProperty2["default"])(_classNames3, "".concat(prefixCls, "-list-item"), true), (0, _defineProperty2["default"])(_classNames3, "".concat(prefixCls, "-list-item-").concat(file.status), true), (0, _defineProperty2["default"])(_classNames3, "".concat(prefixCls, "-list-item-list-type-").concat(listType), true), _classNames3));
|
|
134
134
|
var linkProps = typeof file.linkProps === 'string' ? JSON.parse(file.linkProps) : file.linkProps;
|
|
135
|
-
var removeIcon = showRemoveIcon ? actionIconRender((typeof customRemoveIcon === 'function' ? customRemoveIcon(file) : customRemoveIcon) || listType === 'text' ? /*#__PURE__*/React.createElement(_OutlinedClose["default"],
|
|
135
|
+
var removeIcon = showRemoveIcon ? actionIconRender((typeof customRemoveIcon === 'function' ? customRemoveIcon(file) : customRemoveIcon) || listType === 'text' ? /*#__PURE__*/React.createElement(_OutlinedClose["default"], {
|
|
136
|
+
width: 16
|
|
137
|
+
}) : /*#__PURE__*/React.createElement(_OutlinedDelete["default"], {
|
|
138
|
+
width: 16
|
|
139
|
+
}), function () {
|
|
136
140
|
return onClose(file);
|
|
137
141
|
}, prefixCls, locale.removeFile) : null;
|
|
138
142
|
var downloadIcon = showDownloadIcon ? actionIconRender((typeof customDownloadIcon === 'function' ? customDownloadIcon(file) : customDownloadIcon) || /*#__PURE__*/React.createElement(_OutlinedCloudDownload["default"], null), function () {
|
|
@@ -219,7 +223,8 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
219
223
|
strokeColor: "#2468F2",
|
|
220
224
|
infoType: "none",
|
|
221
225
|
type: "line",
|
|
222
|
-
percent: file.percent
|
|
226
|
+
percent: file.percent,
|
|
227
|
+
strokeWidth: listType === 'text' ? 2 : 4
|
|
223
228
|
}, progressProps)) : null;
|
|
224
229
|
return /*#__PURE__*/React.createElement("div", {
|
|
225
230
|
className: (0, _classnames["default"])("".concat(prefixCls, "-list-item-progress"), motionClassName)
|
|
@@ -196,16 +196,14 @@ var InternalUploadList = function InternalUploadList(_ref, ref) {
|
|
|
196
196
|
}) : /*#__PURE__*/React.createElement(_OutlinedFile["default"], {
|
|
197
197
|
width: 24
|
|
198
198
|
});
|
|
199
|
-
var icon =
|
|
200
|
-
animation: "spin"
|
|
201
|
-
}) : renderIcon(file.name || file.fileName);
|
|
199
|
+
var icon = renderIcon(file.name || file.fileName);
|
|
202
200
|
|
|
203
201
|
if (listType === 'picture') {
|
|
204
202
|
icon = isLoading ? /*#__PURE__*/React.createElement(_OutlinedLoading["default"], {
|
|
205
203
|
animation: "spin"
|
|
206
204
|
}) : fileIcon;
|
|
207
205
|
} else if (listType === 'picture-card') {
|
|
208
|
-
icon = isLoading ? locale.uploading : fileIcon;
|
|
206
|
+
icon = isLoading ? "".concat(locale.uploading, "...") : fileIcon;
|
|
209
207
|
}
|
|
210
208
|
|
|
211
209
|
return icon;
|
|
@@ -318,9 +316,8 @@ var UploadList = /*#__PURE__*/React.forwardRef(InternalUploadList);
|
|
|
318
316
|
UploadList.displayName = 'UploadList';
|
|
319
317
|
UploadList.defaultProps = {
|
|
320
318
|
listType: 'text',
|
|
321
|
-
progress: {
|
|
322
|
-
|
|
323
|
-
|
|
319
|
+
progress: {// strokeWidth: 4,
|
|
320
|
+
// showInfo: false
|
|
324
321
|
},
|
|
325
322
|
showUploadIcon: true,
|
|
326
323
|
showRemoveIcon: true,
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
border-style: solid;
|
|
44
44
|
cursor: pointer;
|
|
45
45
|
transition: border-color 0.3s;
|
|
46
|
+
overflow: hidden;
|
|
46
47
|
color: #5C5F66;
|
|
47
48
|
background-color: #FFFFFF;
|
|
48
49
|
border-color: #E8E9EB;
|
|
@@ -115,15 +116,12 @@
|
|
|
115
116
|
height: 100%;
|
|
116
117
|
text-align: center;
|
|
117
118
|
border: 1px dashed #d9d9d9;
|
|
118
|
-
border-radius:
|
|
119
|
+
border-radius: 6px;
|
|
119
120
|
cursor: pointer;
|
|
120
121
|
transition: border-color 0.3s;
|
|
121
122
|
}
|
|
122
|
-
.acud-upload.acud-upload-drag .acud-upload {
|
|
123
|
-
padding: 16px 0;
|
|
124
|
-
}
|
|
125
123
|
.acud-upload.acud-upload-drag.acud-upload-drag-hover:not(.acud-upload-disabled) {
|
|
126
|
-
border-color:
|
|
124
|
+
border-color: #144BCC;
|
|
127
125
|
}
|
|
128
126
|
.acud-upload.acud-upload-drag.acud-upload-disabled {
|
|
129
127
|
background: #fafafa;
|
|
@@ -300,10 +298,6 @@
|
|
|
300
298
|
color: #B8BABF;
|
|
301
299
|
}
|
|
302
300
|
.acud-upload-list-item .acuicon-outlined-close {
|
|
303
|
-
position: absolute;
|
|
304
|
-
top: 4px;
|
|
305
|
-
right: 4px;
|
|
306
|
-
color: #B8BABF;
|
|
307
301
|
font-size: 10px;
|
|
308
302
|
line-height: 0;
|
|
309
303
|
cursor: pointer;
|
|
@@ -319,6 +313,19 @@
|
|
|
319
313
|
.acud-upload-list-item:hover .acuicon-outlined-close {
|
|
320
314
|
opacity: 1;
|
|
321
315
|
}
|
|
316
|
+
.acud-upload-list-item .acuicon-outlined-cloud-download {
|
|
317
|
+
transition: all 0.3s;
|
|
318
|
+
opacity: 0;
|
|
319
|
+
}
|
|
320
|
+
.acud-upload-list-item:hover .acuicon-outlined-cloud-download {
|
|
321
|
+
opacity: 1;
|
|
322
|
+
}
|
|
323
|
+
.acud-upload-list-item-card-actions-btn {
|
|
324
|
+
margin-right: 6px;
|
|
325
|
+
}
|
|
326
|
+
.acud-upload-list-item-card-actions-btn:last-child {
|
|
327
|
+
margin-right: 0;
|
|
328
|
+
}
|
|
322
329
|
.acud-upload-list-item:hover .acud-upload-list-item-card-actions-btn {
|
|
323
330
|
opacity: 1;
|
|
324
331
|
}
|
|
@@ -328,12 +335,9 @@
|
|
|
328
335
|
.acud-upload-list-item-error .acud-upload-list-item-info .acud-upload-text-icon .acuicon:hover {
|
|
329
336
|
color: #F33E3E;
|
|
330
337
|
}
|
|
331
|
-
.acud-upload-list-item-error .acud-upload-list-item-card-actions .
|
|
338
|
+
.acud-upload-list-item-error .acud-upload-list-item-card-actions .acud-upload-text-icon {
|
|
332
339
|
color: #F33E3E;
|
|
333
340
|
}
|
|
334
|
-
.acud-upload-list-item-error .acud-upload-list-item-card-actions-btn {
|
|
335
|
-
opacity: 1;
|
|
336
|
-
}
|
|
337
341
|
.acud-upload-list-item-progress {
|
|
338
342
|
position: absolute;
|
|
339
343
|
bottom: -12px;
|