acud 0.0.64 → 0.0.67

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.
Files changed (103) hide show
  1. package/dist/acud.css +131 -39
  2. package/dist/acud.css.map +1 -1
  3. package/dist/acud.js +799 -212
  4. package/dist/acud.js.map +1 -1
  5. package/dist/acud.min.css +1 -1
  6. package/dist/acud.min.css.map +1 -1
  7. package/dist/acud.min.js +11 -7
  8. package/dist/acud.min.js.map +1 -1
  9. package/es/breadcrumb/BreadcrumbItem.d.ts +1 -1
  10. package/es/breadcrumb/BreadcrumbItem.js +16 -4
  11. package/es/dialog-box/style/index.css +4 -4
  12. package/es/dropdown/dropdown-button.js +8 -4
  13. package/es/dropdown/style/index.css +2 -1
  14. package/es/dropdown/style/index.less +2 -1
  15. package/es/modal/DialogBox.d.ts +46 -0
  16. package/es/modal/DialogBox.js +152 -0
  17. package/es/modal/Modal.d.ts +5 -2
  18. package/es/modal/Modal.js +6 -4
  19. package/es/modal/dialog.d.ts +17 -0
  20. package/es/modal/dialog.js +123 -0
  21. package/es/modal/index.d.ts +11 -2
  22. package/es/modal/index.js +10 -1
  23. package/es/modal/style/index.css +79 -13
  24. package/es/modal/style/index.less +93 -6
  25. package/es/modal/style/mixin.less +4 -4
  26. package/es/progress/style/common.less +5 -3
  27. package/es/progress/style/index.css +2 -1
  28. package/es/radio/index.d.ts +3 -0
  29. package/es/style/themes/dark/components/modal.less +14 -9
  30. package/es/style/themes/default/components/modal.less +15 -15
  31. package/es/tabs/src/TabNavList/index.js +2 -2
  32. package/es/tabs/style/index.css +0 -1
  33. package/es/tabs/style/index.less +0 -1
  34. package/es/time-picker/style/index.css +1 -0
  35. package/es/time-picker/style/index.less +1 -0
  36. package/es/transfer/{dataSource.d.ts → DataSource.d.ts} +1 -1
  37. package/es/transfer/{dataSource.js → DataSource.js} +37 -6
  38. package/{lib/transfer/sourceList.d.ts → es/transfer/SourceList.d.ts} +2 -2
  39. package/es/transfer/{sourceList.js → SourceList.js} +0 -0
  40. package/es/transfer/{target.d.ts → Target.d.ts} +1 -1
  41. package/es/transfer/{target.js → Target.js} +60 -4
  42. package/{lib/transfer/targetList.d.ts → es/transfer/TargetList.d.ts} +2 -2
  43. package/es/transfer/{targetList.js → TargetList.js} +0 -0
  44. package/es/transfer/index.d.ts +3 -0
  45. package/es/transfer/index.js +9 -4
  46. package/es/transfer/style/css.js +3 -1
  47. package/es/transfer/style/index.css +25 -5
  48. package/es/transfer/style/index.d.ts +1 -0
  49. package/es/transfer/style/index.js +3 -1
  50. package/es/transfer/style/index.less +30 -5
  51. package/es/upload/UploadList/ListItem.js +7 -2
  52. package/es/upload/UploadList/index.js +4 -7
  53. package/es/upload/style/index.css +17 -13
  54. package/es/upload/style/index.less +25 -20
  55. package/es/upload/utils.js +1 -1
  56. package/lib/breadcrumb/BreadcrumbItem.d.ts +1 -1
  57. package/lib/breadcrumb/BreadcrumbItem.js +21 -8
  58. package/lib/dialog-box/style/index.css +4 -4
  59. package/lib/dropdown/dropdown-button.js +8 -4
  60. package/lib/dropdown/style/index.css +2 -1
  61. package/lib/dropdown/style/index.less +2 -1
  62. package/lib/modal/DialogBox.d.ts +46 -0
  63. package/lib/modal/DialogBox.js +179 -0
  64. package/lib/modal/Modal.d.ts +5 -2
  65. package/lib/modal/Modal.js +6 -4
  66. package/lib/modal/dialog.d.ts +17 -0
  67. package/lib/modal/dialog.js +145 -0
  68. package/lib/modal/index.d.ts +11 -2
  69. package/lib/modal/index.js +13 -1
  70. package/lib/modal/style/index.css +79 -13
  71. package/lib/modal/style/index.less +93 -6
  72. package/lib/modal/style/mixin.less +4 -4
  73. package/lib/progress/style/common.less +5 -3
  74. package/lib/progress/style/index.css +2 -1
  75. package/lib/radio/index.d.ts +3 -0
  76. package/lib/style/themes/dark/components/modal.less +14 -9
  77. package/lib/style/themes/default/components/modal.less +15 -15
  78. package/lib/tabs/src/TabNavList/index.js +2 -2
  79. package/lib/tabs/style/index.css +0 -1
  80. package/lib/tabs/style/index.less +0 -1
  81. package/lib/time-picker/style/index.css +1 -0
  82. package/lib/time-picker/style/index.less +1 -0
  83. package/lib/transfer/{dataSource.d.ts → DataSource.d.ts} +1 -1
  84. package/lib/transfer/{dataSource.js → DataSource.js} +38 -6
  85. package/{es/transfer/sourceList.d.ts → lib/transfer/SourceList.d.ts} +2 -2
  86. package/lib/transfer/{sourceList.js → SourceList.js} +0 -0
  87. package/lib/transfer/{target.d.ts → Target.d.ts} +1 -1
  88. package/lib/transfer/{target.js → Target.js} +63 -5
  89. package/{es/transfer/targetList.d.ts → lib/transfer/TargetList.d.ts} +2 -2
  90. package/lib/transfer/{targetList.js → TargetList.js} +0 -0
  91. package/lib/transfer/index.d.ts +3 -0
  92. package/lib/transfer/index.js +11 -7
  93. package/lib/transfer/style/css.js +3 -1
  94. package/lib/transfer/style/index.css +25 -5
  95. package/lib/transfer/style/index.d.ts +1 -0
  96. package/lib/transfer/style/index.js +3 -1
  97. package/lib/transfer/style/index.less +30 -5
  98. package/lib/upload/UploadList/ListItem.js +7 -2
  99. package/lib/upload/UploadList/index.js +4 -7
  100. package/lib/upload/style/index.css +17 -13
  101. package/lib/upload/style/index.less +25 -20
  102. package/lib/upload/utils.js +1 -1
  103. package/package.json +1 -1
@@ -3,6 +3,7 @@
3
3
  @import './mixin';
4
4
 
5
5
  @modal-prefix-cls: ~'@{acud-prefix}-modal';
6
+ @dialogbox-prefix: ~'@{modal-prefix-cls}-dialogbox';
6
7
 
7
8
  .@{modal-prefix-cls} {
8
9
  .reset-component();
@@ -16,22 +17,37 @@
16
17
  transform: translate(-50%, -50%);
17
18
  width: auto;
18
19
  max-width: calc(100vw - 32px);
19
- padding-bottom: 24px;
20
20
 
21
21
  &-sm {
22
- .modal-size-config(sm);
22
+ .modal-size-config(sm, false);
23
+ }
24
+
25
+ &-sm > &-content {
26
+ .modal-size-config(sm, true);
23
27
  }
24
28
 
25
29
  &-md {
26
- .modal-size-config(md);
30
+ .modal-size-config(md, false);
31
+ }
32
+
33
+ &-md > &-content {
34
+ .modal-size-config(md, true);
27
35
  }
28
36
 
29
37
  &-lg {
30
- .modal-size-config(lg);
38
+ .modal-size-config(lg, false);
39
+ }
40
+
41
+ &-lg > &-content {
42
+ .modal-size-config(lg, true);
31
43
  }
32
44
 
33
45
  &-xl {
34
- .modal-size-config(xl);
46
+ .modal-size-config(xl, false);
47
+ }
48
+
49
+ &-xl > &-content {
50
+ .modal-size-config(xl, true);
35
51
  }
36
52
 
37
53
  // 弹框内容
@@ -94,18 +110,20 @@
94
110
  &-title {
95
111
  font-size: @modal-heading-font-size;
96
112
  line-height: @modal-heading-height;
113
+ padding-right: @P * 3;
97
114
  word-wrap: break-word;
98
115
  }
99
116
 
100
117
  // 内容body部分
101
118
  &-body {
102
- padding: @modal-body-padding;
119
+ margin: @modal-body-margin;
103
120
  font-size: @modal-body-font-size;
104
121
  font-weight: @modal-body-font-weight;
105
122
  line-height: @modal-body-line-height;
106
123
  word-wrap: break-word;
107
124
  color: @modal-body-font-color;
108
125
  flex: 1;
126
+ overflow-y: auto;
109
127
  }
110
128
 
111
129
  // 内容footer部分
@@ -114,6 +132,10 @@
114
132
  background: @modal-footer-bg-color;
115
133
  text-align: right;
116
134
  flex: none;
135
+ // TODO: 暂时解决 confirmLoading 时按钮对齐问题
136
+ display: flex;
137
+ align-items: center;
138
+ justify-content: flex-end;
117
139
 
118
140
  .@{acud-prefix}-btn {
119
141
  margin: 0;
@@ -123,3 +145,68 @@
123
145
  }
124
146
  }
125
147
  }
148
+
149
+ .@{dialogbox-prefix} {
150
+ width: @P * 100;
151
+ height: auto;
152
+ min-height: @P * 46;
153
+
154
+ &-icon {
155
+ height: 100%;
156
+ margin-right: @P * 3;
157
+ float: left;
158
+ // TODO: 没找到更好的居中办法
159
+ display: flex;
160
+ align-items: center;
161
+ padding-top: 2px;
162
+ }
163
+
164
+ &-title {
165
+ overflow: hidden;
166
+ padding-right: @P * 3;
167
+ }
168
+
169
+ &-content {
170
+ width: 100%;
171
+ padding-left: @P * 3 + @T6;
172
+ }
173
+
174
+ .@{modal-prefix-cls}-title {
175
+ .acudicon {
176
+ font-size: @T6;
177
+ }
178
+ }
179
+
180
+ & > .@{modal-prefix-cls}-content {
181
+ min-height: @P * 46;
182
+ }
183
+ }
184
+
185
+ .@{dialogbox-prefix}-warning {
186
+ .@{dialogbox-prefix}-icon {
187
+ color: @W6;
188
+ }
189
+ }
190
+
191
+ .@{dialogbox-prefix}-info {
192
+ .@{dialogbox-prefix}-icon {
193
+ color: @B6;
194
+ }
195
+ }
196
+
197
+ .@{dialogbox-prefix}-success {
198
+ .@{dialogbox-prefix}-icon {
199
+ color: @S6;
200
+ }
201
+ }
202
+ .@{dialogbox-prefix}-error {
203
+ .@{dialogbox-prefix}-icon {
204
+ color: @E6;
205
+ }
206
+ }
207
+
208
+ .@{dialogbox-prefix}-confirm {
209
+ .@{dialogbox-prefix}-icon {
210
+ color: @W6;
211
+ }
212
+ }
@@ -37,11 +37,11 @@
37
37
  }
38
38
  }
39
39
 
40
- .modal-size-config(@type) {
40
+ .modal-size-config(@type, @content) {
41
41
  @width: ~'modal-width-@{type}';
42
- @height: ~'modal-height-@{type}';
42
+ @min-height: ~'modal-height-@{type}';
43
43
  @max-height: ~'modal-max-height-@{type}';
44
- width: @@width;
45
- height: @@height;
44
+ width: if(@content, 100%, @@width);
45
+ min-height: @@min-height;
46
46
  max-height: @@max-height;
47
47
  }
@@ -29,6 +29,8 @@
29
29
  }
30
30
  }
31
31
 
32
- .@{progress-prefix-cls}-label-hidden .@{progress-prefix-cls}-label {
33
- display: none;
34
- }
32
+ .@{progress-prefix-cls}-label-hidden .@{progress-prefix-cls}-label{
33
+ &.@{progress-prefix-cls}-label-outer, &.@{progress-prefix-cls}-label-inner{
34
+ display: none;
35
+ }
36
+ }
@@ -23,7 +23,8 @@
23
23
  .acud-progress-success .acud-progress-label-icon {
24
24
  font-size: 0;
25
25
  }
26
- .acud-progress-label-hidden .acud-progress-label {
26
+ .acud-progress-label-hidden .acud-progress-label.acud-progress-label-outer,
27
+ .acud-progress-label-hidden .acud-progress-label.acud-progress-label-inner {
27
28
  display: none;
28
29
  }
29
30
  .acud-progress-line {
@@ -1,2 +1,5 @@
1
1
  import Radio from './Radio';
2
+ export { RadioProps } from './Radio';
3
+ export { ContextProps } from './context';
4
+ export { BaseRadioGourpProps } from './RadioGroup';
2
5
  export default Radio;
@@ -10,15 +10,20 @@
10
10
  @modal-mask-color: fade(@G5, 50%);
11
11
 
12
12
  // 默认宽高设置
13
- @modal-width-sm: 100*@P;
14
- @modal-width-md: 150*@P;
15
- @modal-width-lg: 200*@P;
16
- @modal-width-xl: 300*@P;
13
+ @modal-width-sm: 100 * @P;
14
+ @modal-width-md: 150 * @P;
15
+ @modal-width-lg: 200 * @P;
16
+ @modal-width-xl: 300 * @P;
17
17
 
18
- @modal-max-height-sm: 160*@P;
19
- @modal-max-height-md: 160*@P;
20
- @modal-max-height-lg: 160*@P;
21
- @modal-max-height-xl: 160*@P;
18
+ @modal-max-height-sm: 140 * @P;
19
+ @modal-max-height-md: 140 * @P;
20
+ @modal-max-height-lg: 140 * @P;
21
+ @modal-max-height-xl: 140 * @P;
22
+
23
+ @modal-height-sm: 60 * @P;
24
+ @modal-height-md: 100 * @P;
25
+ @modal-height-lg: 120 * @P;
26
+ @modal-height-xl: 120 * @P;
22
27
 
23
28
  // Content
24
29
  @modal-content-bg-color: @G11;
@@ -36,7 +41,7 @@
36
41
  @modal-close-font-size: @T4;
37
42
 
38
43
  // Body
39
- @modal-body-padding: 6*@P 8*@P;
44
+ @modal-body-margin: 4*@P 6*@P 6*@P;
40
45
  @modal-body-bg-color: @G11;
41
46
  @modal-body-font-size: @T2;
42
47
  @modal-body-line-height: 5*@P;
@@ -10,29 +10,29 @@
10
10
  @modal-mask-color: fade(@G5, 50%);
11
11
 
12
12
  // 默认宽高设置
13
- @modal-width-sm: 130*@P;
14
- @modal-width-md: 200*@P;
15
- @modal-width-lg: 280*@P;
16
- @modal-width-xl: 300*@P;
13
+ @modal-width-sm: 130 * @P;
14
+ @modal-width-md: 200 * @P;
15
+ @modal-width-lg: 280 * @P;
16
+ @modal-width-xl: 300 * @P;
17
17
 
18
- @modal-max-height-sm: 60*@P;
19
- @modal-max-height-md: 100*@P;
20
- @modal-max-height-lg: 120*@P;
21
- @modal-max-height-xl: 120*@P;
18
+ @modal-max-height-sm: 140 * @P;
19
+ @modal-max-height-md: 140 * @P;
20
+ @modal-max-height-lg: 140 * @P;
21
+ @modal-max-height-xl: 140 * @P;
22
22
 
23
- @modal-height-sm: 60*@P;
24
- @modal-height-md: 100*@P;
25
- @modal-height-lg: 120*@P;
26
- @modal-height-xl: 120*@P;
23
+ @modal-height-sm: 60 * @P;
24
+ @modal-height-md: 100 * @P;
25
+ @modal-height-lg: 120 * @P;
26
+ @modal-height-xl: 120 * @P;
27
27
 
28
28
  // Content
29
29
  @modal-content-bg-color: @G11;
30
30
 
31
31
  // Header
32
- @modal-heading-height: 6*@P;
32
+ @modal-heading-height: 22px;
33
33
  @modal-heading-bg-color: @G10;
34
34
  @modal-heading-padding: 6*@P 6*@P 0;
35
- @modal-heading-font-size: @T4;
35
+ @modal-heading-font-size: @T3;
36
36
  @modal-heading-font-weight: 500;
37
37
  @modal-heading-color: @G2;
38
38
 
@@ -42,7 +42,7 @@
42
42
  @modal-close-font-size: @T4;
43
43
 
44
44
  // Body
45
- @modal-body-padding: 4*@P 6*@P 6*@P;
45
+ @modal-body-margin: 4*@P 6*@P 6*@P;
46
46
  @modal-body-bg-color: @G11;
47
47
  @modal-body-font-color: @G2;
48
48
  @modal-body-font-size: @T2;
@@ -396,9 +396,9 @@ function TabNavList(props, ref) {
396
396
 
397
397
  if (btnNode) {
398
398
  newSizes.set(key, {
399
- width: btnNode.offsetWidth,
399
+ width: btnNode.offsetWidth - 32,
400
400
  height: btnNode.offsetHeight,
401
- left: btnNode.offsetLeft,
401
+ left: btnNode.offsetLeft + 16,
402
402
  top: btnNode.offsetTop
403
403
  });
404
404
  }
@@ -556,7 +556,6 @@
556
556
  }
557
557
  .acud-tabs-tab-active {
558
558
  color: #2468F2;
559
- background: #FFFFFF;
560
559
  }
561
560
  .acud-tabs-tab-btn {
562
561
  outline: none;
@@ -155,7 +155,6 @@
155
155
 
156
156
  &-active {
157
157
  color: @tabs-active-color;
158
- background: @tabs-card-head-background;
159
158
  }
160
159
 
161
160
  &-btn {
@@ -231,6 +231,7 @@
231
231
  text-align: left;
232
232
  color: #2468F2;
233
233
  cursor: pointer;
234
+ margin-top: 0;
234
235
  }
235
236
  .acud-time-panel-wrap .acud-picker-decade-panel .acud-picker-cell-inner {
236
237
  padding: 0 6px;
@@ -183,6 +183,7 @@
183
183
  text-align: left;
184
184
  color: @picker-time-active-color;
185
185
  cursor: pointer;
186
+ margin-top: 0;
186
187
  }
187
188
  // ===================== Decade Panel =====================
188
189
  &-decade-panel {
@@ -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;
@@ -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 _sourceList = _interopRequireDefault(require("./sourceList"));
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
- _props$filterOption = props.filterOption,
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(_sourceList["default"], (0, _extends2["default"])({}, props, {
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 './dataSource';
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 _classnames2 = _interopRequireDefault(require("classnames"));
22
+ var _dedupe = _interopRequireDefault(require("classnames/dedupe"));
23
+
24
+ var _acudIcon = require("acud-icon");
21
25
 
22
- var _targetList = _interopRequireDefault(require("./targetList"));
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 clearCls = (0, _classnames2["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));
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(_targetList["default"], (0, _extends2["default"])({}, props, {
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 './dataSource';
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,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;
@@ -21,9 +21,9 @@ var _classnames2 = _interopRequireDefault(require("classnames"));
21
21
 
22
22
  var _default = _interopRequireDefault(require("../locale/default"));
23
23
 
24
- var _dataSource = _interopRequireDefault(require("./dataSource"));
24
+ var _DataSource = _interopRequireDefault(require("./DataSource"));
25
25
 
26
- var _target = _interopRequireDefault(require("./target"));
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,11 +33,13 @@ 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$displayType = props.displayType,
42
+ displayType = _props$displayType === void 0 ? 'single' : _props$displayType,
41
43
  _props$targetKeys = props.targetKeys,
42
44
  targetKeys = _props$targetKeys === void 0 ? [] : _props$targetKeys,
43
45
  onChange = props.onChange,
@@ -82,16 +84,18 @@ function transfer(props) {
82
84
  React.useEffect(function () {
83
85
  onChange && onChange(tKeys);
84
86
  }, [tKeys]);
85
- var classNames = (0, _classnames2["default"])((0, _defineProperty2["default"])({}, prefixCls, true));
87
+ var classNames = (0, _classnames2["default"])((_classnames = {}, (0, _defineProperty2["default"])(_classnames, prefixCls, true), (0, _defineProperty2["default"])(_classnames, "".concat(prefixCls, "-table"), displayType === 'table'), _classnames));
86
88
  return /*#__PURE__*/React.createElement("div", {
87
89
  className: classNames
88
- }, /*#__PURE__*/React.createElement(_dataSource["default"], (0, _extends2["default"])({}, props, {
90
+ }, /*#__PURE__*/React.createElement(_DataSource["default"], (0, _extends2["default"])({}, props, {
91
+ displayType: displayType,
89
92
  locale: userLocale,
90
93
  prefixCls: prefixCls,
91
94
  tKeys: tKeys,
92
95
  setTKeys: setTKeys,
93
96
  expansionSource: expansionSource
94
- })), /*#__PURE__*/React.createElement(_target["default"], (0, _extends2["default"])({}, props, {
97
+ })), /*#__PURE__*/React.createElement(_Target["default"], (0, _extends2["default"])({}, props, {
98
+ displayType: displayType,
95
99
  locale: userLocale,
96
100
  prefixCls: prefixCls,
97
101
  tKeys: tKeys,
@@ -2,4 +2,6 @@
2
2
 
3
3
  require("../../style/index.css");
4
4
 
5
- require("./index.css");
5
+ require("./index.css");
6
+
7
+ require("../../table/style/css");