acud 0.0.63 → 0.0.66

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 (115) hide show
  1. package/dist/acud.css +164 -53
  2. package/dist/acud.css.map +1 -1
  3. package/dist/acud.js +817 -213
  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 +10 -4
  8. package/dist/acud.min.js.map +1 -1
  9. package/es/alert/style/index.css +1 -1
  10. package/es/alert/style/index.less +150 -147
  11. package/es/alert/style/rtl.less +27 -27
  12. package/es/breadcrumb/BreadcrumbItem.d.ts +1 -1
  13. package/es/breadcrumb/BreadcrumbItem.js +16 -4
  14. package/es/date-picker/src/Picker.js +1 -1
  15. package/es/date-picker/src/RangePicker.js +1 -1
  16. package/es/date-picker/style/index.css +43 -11
  17. package/es/date-picker/style/index.less +13 -2
  18. package/es/date-picker/style/panel.less +32 -10
  19. package/es/dialog-box/style/index.css +4 -4
  20. package/es/dropdown/dropdown-button.js +11 -2
  21. package/es/dropdown/style/index.css +6 -1
  22. package/es/dropdown/style/index.less +6 -1
  23. package/es/modal/DialogBox.d.ts +46 -0
  24. package/es/modal/DialogBox.js +152 -0
  25. package/es/modal/Modal.d.ts +5 -0
  26. package/es/modal/Modal.js +6 -4
  27. package/es/modal/dialog.d.ts +17 -0
  28. package/es/modal/dialog.js +123 -0
  29. package/es/modal/index.d.ts +11 -2
  30. package/es/modal/index.js +10 -1
  31. package/es/modal/style/index.css +62 -16
  32. package/es/modal/style/index.less +76 -5
  33. package/es/modal/style/mixin.less +2 -2
  34. package/es/progress/style/common.less +5 -3
  35. package/es/progress/style/index.css +2 -1
  36. package/es/radio/index.d.ts +3 -0
  37. package/es/style/themes/dark/components/modal.less +14 -9
  38. package/es/style/themes/default/components/datePicker.less +1 -1
  39. package/es/style/themes/default/components/modal.less +14 -14
  40. package/es/time-picker/style/index.css +1 -0
  41. package/es/time-picker/style/index.less +1 -0
  42. package/es/transfer/{dataSource.d.ts → DataSource.d.ts} +1 -1
  43. package/es/transfer/{dataSource.js → DataSource.js} +37 -6
  44. package/{lib/transfer/sourceList.d.ts → es/transfer/SourceList.d.ts} +2 -2
  45. package/es/transfer/{sourceList.js → SourceList.js} +0 -0
  46. package/es/transfer/{target.d.ts → Target.d.ts} +1 -1
  47. package/es/transfer/{target.js → Target.js} +60 -4
  48. package/{lib/transfer/targetList.d.ts → es/transfer/TargetList.d.ts} +2 -2
  49. package/es/transfer/{targetList.js → TargetList.js} +0 -0
  50. package/es/transfer/index.d.ts +3 -0
  51. package/es/transfer/index.js +9 -4
  52. package/es/transfer/style/css.js +3 -1
  53. package/es/transfer/style/index.css +27 -5
  54. package/es/transfer/style/index.d.ts +1 -0
  55. package/es/transfer/style/index.js +3 -1
  56. package/es/transfer/style/index.less +32 -5
  57. package/es/upload/UploadList/ListItem.js +7 -2
  58. package/es/upload/UploadList/index.js +4 -7
  59. package/es/upload/style/index.css +17 -13
  60. package/es/upload/style/index.less +25 -20
  61. package/es/upload/utils.js +1 -1
  62. package/lib/alert/style/index.css +1 -1
  63. package/lib/alert/style/index.less +150 -147
  64. package/lib/alert/style/rtl.less +27 -27
  65. package/lib/breadcrumb/BreadcrumbItem.d.ts +1 -1
  66. package/lib/breadcrumb/BreadcrumbItem.js +21 -8
  67. package/lib/date-picker/src/Picker.js +1 -1
  68. package/lib/date-picker/src/RangePicker.js +1 -1
  69. package/lib/date-picker/style/index.css +43 -11
  70. package/lib/date-picker/style/index.less +13 -2
  71. package/lib/date-picker/style/panel.less +32 -10
  72. package/lib/dialog-box/style/index.css +4 -4
  73. package/lib/dropdown/dropdown-button.js +11 -2
  74. package/lib/dropdown/style/index.css +6 -1
  75. package/lib/dropdown/style/index.less +6 -1
  76. package/lib/modal/DialogBox.d.ts +46 -0
  77. package/lib/modal/DialogBox.js +179 -0
  78. package/lib/modal/Modal.d.ts +5 -0
  79. package/lib/modal/Modal.js +6 -4
  80. package/lib/modal/dialog.d.ts +17 -0
  81. package/lib/modal/dialog.js +145 -0
  82. package/lib/modal/index.d.ts +11 -2
  83. package/lib/modal/index.js +13 -1
  84. package/lib/modal/style/index.css +62 -16
  85. package/lib/modal/style/index.less +76 -5
  86. package/lib/modal/style/mixin.less +2 -2
  87. package/lib/progress/style/common.less +5 -3
  88. package/lib/progress/style/index.css +2 -1
  89. package/lib/radio/index.d.ts +3 -0
  90. package/lib/style/themes/dark/components/modal.less +14 -9
  91. package/lib/style/themes/default/components/datePicker.less +1 -1
  92. package/lib/style/themes/default/components/modal.less +14 -14
  93. package/lib/time-picker/style/index.css +1 -0
  94. package/lib/time-picker/style/index.less +1 -0
  95. package/lib/transfer/{dataSource.d.ts → DataSource.d.ts} +1 -1
  96. package/lib/transfer/{dataSource.js → DataSource.js} +38 -6
  97. package/{es/transfer/sourceList.d.ts → lib/transfer/SourceList.d.ts} +2 -2
  98. package/lib/transfer/{sourceList.js → SourceList.js} +0 -0
  99. package/lib/transfer/{target.d.ts → Target.d.ts} +1 -1
  100. package/lib/transfer/{target.js → Target.js} +63 -5
  101. package/{es/transfer/targetList.d.ts → lib/transfer/TargetList.d.ts} +2 -2
  102. package/lib/transfer/{targetList.js → TargetList.js} +0 -0
  103. package/lib/transfer/index.d.ts +3 -0
  104. package/lib/transfer/index.js +11 -7
  105. package/lib/transfer/style/css.js +3 -1
  106. package/lib/transfer/style/index.css +27 -5
  107. package/lib/transfer/style/index.d.ts +1 -0
  108. package/lib/transfer/style/index.js +3 -1
  109. package/lib/transfer/style/index.less +32 -5
  110. package/lib/upload/UploadList/ListItem.js +7 -2
  111. package/lib/upload/UploadList/index.js +4 -7
  112. package/lib/upload/style/index.css +17 -13
  113. package/lib/upload/style/index.less +25 -20
  114. package/lib/upload/utils.js +1 -1
  115. package/package.json +1 -1
@@ -19,7 +19,6 @@
19
19
  transform: translate(-50%, -50%);
20
20
  width: auto;
21
21
  max-width: calc(100vw - 32px);
22
- padding-bottom: 24px;
23
22
  }
24
23
  .acud-modal.zoom-enter,
25
24
  .acud-modal.zoom-appear {
@@ -56,25 +55,25 @@
56
55
  -webkit-overflow-scrolling: touch;
57
56
  z-index: 1000;
58
57
  }
59
- .acud-modal-sm {
58
+ .acud-modal-sm > .acud-modal-content {
60
59
  width: 520px;
61
- height: 240px;
62
- max-height: 240px;
60
+ min-height: 240px;
61
+ max-height: 560px;
63
62
  }
64
- .acud-modal-md {
63
+ .acud-modal-md > .acud-modal-content {
65
64
  width: 800px;
66
- height: 400px;
67
- max-height: 400px;
65
+ min-height: 400px;
66
+ max-height: 560px;
68
67
  }
69
- .acud-modal-lg {
68
+ .acud-modal-lg > .acud-modal-content {
70
69
  width: 1120px;
71
- height: 480px;
72
- max-height: 480px;
70
+ min-height: 480px;
71
+ max-height: 560px;
73
72
  }
74
- .acud-modal-xl {
73
+ .acud-modal-xl > .acud-modal-content {
75
74
  width: 1200px;
76
- height: 480px;
77
- max-height: 480px;
75
+ min-height: 480px;
76
+ max-height: 560px;
78
77
  }
79
78
  .acud-modal-content {
80
79
  position: relative;
@@ -111,7 +110,7 @@
111
110
  }
112
111
  .acud-modal-close-x {
113
112
  display: block;
114
- margin-top: 28px;
113
+ margin-top: 27px;
115
114
  font-size: 16px;
116
115
  text-align: center;
117
116
  text-transform: none;
@@ -125,8 +124,9 @@
125
124
  font-weight: 900;
126
125
  }
127
126
  .acud-modal-title {
128
- font-size: 16px;
129
- line-height: 24px;
127
+ font-size: 14px;
128
+ line-height: 22px;
129
+ padding-right: 12px;
130
130
  word-wrap: break-word;
131
131
  }
132
132
  .acud-modal-body {
@@ -143,6 +143,9 @@
143
143
  background: #FFFFFF;
144
144
  text-align: right;
145
145
  flex: none;
146
+ display: flex;
147
+ align-items: center;
148
+ justify-content: flex-end;
146
149
  }
147
150
  .acud-modal-footer .acud-btn {
148
151
  margin: 0;
@@ -150,3 +153,46 @@
150
153
  .acud-modal-footer .acud-btn + .acud-btn {
151
154
  margin-left: 16px;
152
155
  }
156
+ .acud-modal-dialogbox {
157
+ width: 400px;
158
+ height: auto;
159
+ min-height: 184px;
160
+ }
161
+ .acud-modal-dialogbox-icon {
162
+ height: 100%;
163
+ margin-right: 12px;
164
+ float: left;
165
+ display: flex;
166
+ align-items: center;
167
+ padding-top: 2px;
168
+ }
169
+ .acud-modal-dialogbox-title {
170
+ overflow: hidden;
171
+ padding-right: 12px;
172
+ }
173
+ .acud-modal-dialogbox-content {
174
+ width: 400px;
175
+ padding-left: 32px;
176
+ }
177
+ .acud-modal-dialogbox .acud-modal-title .acudicon {
178
+ font-size: 20px;
179
+ }
180
+ .acud-modal-dialogbox > .acud-modal-content {
181
+ width: 400px;
182
+ min-height: 184px;
183
+ }
184
+ .acud-modal-dialogbox-warning .acud-modal-dialogbox-icon {
185
+ color: #FF9326;
186
+ }
187
+ .acud-modal-dialogbox-info .acud-modal-dialogbox-icon {
188
+ color: #2468F2;
189
+ }
190
+ .acud-modal-dialogbox-success .acud-modal-dialogbox-icon {
191
+ color: #30BF13;
192
+ }
193
+ .acud-modal-dialogbox-error .acud-modal-dialogbox-icon {
194
+ color: #F33E3E;
195
+ }
196
+ .acud-modal-dialogbox-confirm .acud-modal-dialogbox-icon {
197
+ color: #FF9326;
198
+ }
@@ -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,21 +17,20 @@
16
17
  transform: translate(-50%, -50%);
17
18
  width: auto;
18
19
  max-width: calc(100vw - 32px);
19
- padding-bottom: 24px;
20
20
 
21
- &-sm {
21
+ &-sm > &-content {
22
22
  .modal-size-config(sm);
23
23
  }
24
24
 
25
- &-md {
25
+ &-md > &-content {
26
26
  .modal-size-config(md);
27
27
  }
28
28
 
29
- &-lg {
29
+ &-lg > &-content {
30
30
  .modal-size-config(lg);
31
31
  }
32
32
 
33
- &-xl {
33
+ &-xl > &-content {
34
34
  .modal-size-config(xl);
35
35
  }
36
36
 
@@ -94,6 +94,7 @@
94
94
  &-title {
95
95
  font-size: @modal-heading-font-size;
96
96
  line-height: @modal-heading-height;
97
+ padding-right: @P * 3;
97
98
  word-wrap: break-word;
98
99
  }
99
100
 
@@ -114,6 +115,10 @@
114
115
  background: @modal-footer-bg-color;
115
116
  text-align: right;
116
117
  flex: none;
118
+ // TODO: 暂时解决 confirmLoading 时按钮对齐问题
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: flex-end;
117
122
 
118
123
  .@{acud-prefix}-btn {
119
124
  margin: 0;
@@ -123,3 +128,69 @@
123
128
  }
124
129
  }
125
130
  }
131
+
132
+ .@{dialogbox-prefix} {
133
+ width: @P * 100;
134
+ height: auto;
135
+ min-height: @P * 46;
136
+
137
+ &-icon {
138
+ height: 100%;
139
+ margin-right: @P * 3;
140
+ float: left;
141
+ // TODO: 没找到更好的居中办法
142
+ display: flex;
143
+ align-items: center;
144
+ padding-top: 2px;
145
+ }
146
+
147
+ &-title {
148
+ overflow: hidden;
149
+ padding-right: @P * 3;
150
+ }
151
+
152
+ &-content {
153
+ width: @P * 100;
154
+ padding-left: @P * 3 + @T6;
155
+ }
156
+
157
+ .@{modal-prefix-cls}-title {
158
+ .acudicon {
159
+ font-size: @T6;
160
+ }
161
+ }
162
+
163
+ & > .@{modal-prefix-cls}-content {
164
+ width: @P * 100;
165
+ min-height: @P * 46;
166
+ }
167
+ }
168
+
169
+ .@{dialogbox-prefix}-warning {
170
+ .@{dialogbox-prefix}-icon {
171
+ color: @W6;
172
+ }
173
+ }
174
+
175
+ .@{dialogbox-prefix}-info {
176
+ .@{dialogbox-prefix}-icon {
177
+ color: @B6;
178
+ }
179
+ }
180
+
181
+ .@{dialogbox-prefix}-success {
182
+ .@{dialogbox-prefix}-icon {
183
+ color: @S6;
184
+ }
185
+ }
186
+ .@{dialogbox-prefix}-error {
187
+ .@{dialogbox-prefix}-icon {
188
+ color: @E6;
189
+ }
190
+ }
191
+
192
+ .@{dialogbox-prefix}-confirm {
193
+ .@{dialogbox-prefix}-icon {
194
+ color: @W6;
195
+ }
196
+ }
@@ -39,9 +39,9 @@
39
39
 
40
40
  .modal-size-config(@type) {
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
44
  width: @@width;
45
- height: @@height;
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;
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;
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
+
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;
@@ -27,7 +27,7 @@
27
27
  @primary-color: @B2;
28
28
  @picker-basic-cell-active-with-range-color: @B1;
29
29
  @picker-date-hover-range-border-color: @B4;
30
- @picker-date-hover-range-color: @B3;
30
+ @picker-date-hover-range-color: @B2;
31
31
  @disabled-color: @G6;
32
32
  @picker-basic-cell-disabled-bg: transparent;
33
33
 
@@ -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
 
@@ -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;
@@ -9,20 +9,26 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
9
9
  import * as React from 'react';
10
10
  import cloneDeep from 'lodash/cloneDeep';
11
11
  import Checkbox from '../checkbox';
12
+ import Table from '../table';
12
13
  import Search from '../search';
13
- import SourceList from './sourceList';
14
+ import SourceList from './SourceList';
14
15
 
15
16
  var defaultFilterOption = function defaultFilterOption(inputValue, option) {
16
17
  return option.title.indexOf(inputValue) > -1;
17
18
  };
18
19
 
20
+ var defaultTableFilterOption = function defaultTableFilterOption(inputValue, option) {
21
+ return option.key.indexOf(inputValue) > -1;
22
+ };
23
+
19
24
  export default function dataSource(props) {
20
25
  var prefixCls = props.prefixCls,
26
+ displayType = props.displayType,
27
+ columns = props.columns,
21
28
  expansionSource = props.expansionSource,
22
29
  _props$showSelectAll = props.showSelectAll,
23
30
  showSelectAll = _props$showSelectAll === void 0 ? true : _props$showSelectAll,
24
- _props$filterOption = props.filterOption,
25
- filterOption = _props$filterOption === void 0 ? defaultFilterOption : _props$filterOption,
31
+ filterOptionProp = props.filterOption,
26
32
  showSearch = props.showSearch,
27
33
  _props$showSearchClea = props.showSearchClear,
28
34
  showSearchClear = _props$showSearchClea === void 0 ? true : _props$showSearchClea,
@@ -30,6 +36,7 @@ export default function dataSource(props) {
30
36
  setTKeys = props.setTKeys,
31
37
  leftStyle = props.leftStyle,
32
38
  locale = props.locale;
39
+ var filterOption = filterOptionProp || (displayType === 'table' ? defaultTableFilterOption : defaultFilterOption);
33
40
  var dataSourceCls = "".concat(prefixCls, "-datasource");
34
41
  var sourceTitle = locale.sourceTitle,
35
42
  searchPlaceholder = locale.searchPlaceholder,
@@ -79,7 +86,7 @@ export default function dataSource(props) {
79
86
  }
80
87
  });
81
88
  return fileterCloneSource;
82
- }, [searchValue, expansionSource]);
89
+ }, [searchValue, expansionSource, displayType]);
83
90
  var totalUndisabledKeys = React.useMemo(function () {
84
91
  var unDisabledDataSource = filterSource.filter(function (data) {
85
92
  return !data.group && !data.disabled;
@@ -112,14 +119,31 @@ export default function dataSource(props) {
112
119
  var searchValue = e.target.value;
113
120
  setSearchValue(searchValue);
114
121
  }, []);
122
+
123
+ var onSelectChange = function onSelectChange(v) {
124
+ // 排除filter中包含的tKeys,记为noneFilterKeys
125
+ // 联合noneFilterKeys与filter中的选择项,记为最终keys
126
+ var noneFilterKeys = tKeys.filter(function (key) {
127
+ return !filterSource.some(function (item) {
128
+ return item.key === key;
129
+ });
130
+ });
131
+ setTKeys([].concat(_toConsumableArray(noneFilterKeys), _toConsumableArray(v)));
132
+ };
133
+
134
+ var rowSelection = {
135
+ onChange: onSelectChange,
136
+ selectedRowKeys: tKeys
137
+ };
115
138
  return /*#__PURE__*/React.createElement("div", {
116
139
  className: dataSourceCls,
117
140
  style: leftStyle
118
141
  }, /*#__PURE__*/React.createElement("div", {
119
142
  className: "".concat(dataSourceCls, "-header")
120
- }, showSelectAll && /*#__PURE__*/React.createElement(Checkbox, {
143
+ }, showSelectAll && displayType === 'single' && /*#__PURE__*/React.createElement(Checkbox, {
121
144
  checked: allChecked,
122
145
  indeterminate: indeterminate,
146
+ className: "".concat(dataSourceCls, "-header-checkall"),
123
147
  onClick: selectAll
124
148
  }), /*#__PURE__*/React.createElement("span", {
125
149
  className: "".concat(dataSourceCls, "-label")
@@ -131,7 +155,14 @@ export default function dataSource(props) {
131
155
  allowClear: showSearchClear,
132
156
  size: "small",
133
157
  onChange: searchChange
134
- }), !!filterSource.length && /*#__PURE__*/React.createElement(SourceList, _extends({}, props, {
158
+ }), !!filterSource.length && displayType === 'table' && /*#__PURE__*/React.createElement("div", {
159
+ className: "".concat(prefixCls, "-table-box")
160
+ }, /*#__PURE__*/React.createElement(Table, {
161
+ pagination: false,
162
+ dataSource: filterSource,
163
+ columns: columns,
164
+ rowSelection: rowSelection
165
+ })), !!filterSource.length && displayType === 'single' && /*#__PURE__*/React.createElement(SourceList, _extends({}, props, {
135
166
  filterSource: filterSource
136
167
  })), filterSource.length === 0 && /*#__PURE__*/React.createElement("p", {
137
168
  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;
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
4
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
5
 
5
6
  /*
@@ -7,8 +8,10 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
7
8
  * author zhousheng
8
9
  */
9
10
  import * as React from 'react';
10
- import classnames from 'classnames';
11
- import TargetList from './targetList';
11
+ import classnames from 'classnames/dedupe';
12
+ import { OutlinedClose } from 'acud-icon';
13
+ import Table from '../table';
14
+ import TargetList from './TargetList';
12
15
  import Search from '../search';
13
16
 
14
17
  var defaultFilterOption = function defaultFilterOption(inputValue, option) {
@@ -19,6 +22,7 @@ export default function target(props) {
19
22
  var _classnames;
20
23
 
21
24
  var prefixCls = props.prefixCls,
25
+ displayType = props.displayType,
22
26
  _props$showClearAll = props.showClearAll,
23
27
  showClearAll = _props$showClearAll === void 0 ? true : _props$showClearAll,
24
28
  _props$filterOption = props.filterOption,
@@ -30,7 +34,8 @@ export default function target(props) {
30
34
  setTKeys = props.setTKeys,
31
35
  rightStyle = props.rightStyle,
32
36
  locale = props.locale,
33
- expansionSource = props.expansionSource;
37
+ expansionSource = props.expansionSource,
38
+ columns = props.columns;
34
39
  var targetCls = "".concat(prefixCls, "-target");
35
40
  var targetTitle = locale.targetTitle,
36
41
  searchPlaceholder = locale.searchPlaceholder,
@@ -105,6 +110,51 @@ export default function target(props) {
105
110
  var searchValue = e.target.value;
106
111
  setSearchValue(searchValue);
107
112
  }, []);
113
+ var targetColumns = React.useMemo(function () {
114
+ if (!columns) {
115
+ return;
116
+ }
117
+
118
+ var cancelItem = function cancelItem(data) {
119
+ if (data.disabled) {
120
+ return;
121
+ }
122
+
123
+ var curTKeys = _toConsumableArray(tKeys);
124
+
125
+ if (data.group) {
126
+ var deleteKeys = data.childrenKeys;
127
+ curTKeys = curTKeys.filter(function (tKey) {
128
+ return !deleteKeys.includes(tKey);
129
+ });
130
+ } else if (curTKeys.includes(data.key)) {
131
+ curTKeys.splice(curTKeys.indexOf(data.key), 1);
132
+ }
133
+
134
+ setTKeys(curTKeys);
135
+ };
136
+
137
+ var tColumns = _toConsumableArray(columns);
138
+
139
+ tColumns.push({
140
+ title: '',
141
+ key: 'action',
142
+ width: 40,
143
+ render: function render(_text, data) {
144
+ if (!data.disabled) {
145
+ return /*#__PURE__*/React.createElement(OutlinedClose, {
146
+ className: "".concat(prefixCls, "-target-item-cancel"),
147
+ onClick: function onClick() {
148
+ return cancelItem(data);
149
+ }
150
+ });
151
+ }
152
+
153
+ return null;
154
+ }
155
+ });
156
+ return tColumns;
157
+ }, [columns, tKeys]);
108
158
  var clearCls = classnames((_classnames = {}, _defineProperty(_classnames, "".concat(targetCls, "-clear-all"), true), _defineProperty(_classnames, "".concat(targetCls, "-clear-all-disabled"), filterSource.length === totalDisabledKeys.length), _classnames));
109
159
  return /*#__PURE__*/React.createElement("div", {
110
160
  className: targetCls,
@@ -125,7 +175,13 @@ export default function target(props) {
125
175
  allowClear: showSearchClear,
126
176
  size: "small",
127
177
  onChange: searchChange
128
- }), !!filterSource.length && /*#__PURE__*/React.createElement(TargetList, _extends({}, props, {
178
+ }), !!filterSource.length && displayType === 'table' && /*#__PURE__*/React.createElement("div", {
179
+ className: "".concat(prefixCls, "-table-box")
180
+ }, /*#__PURE__*/React.createElement(Table, {
181
+ pagination: false,
182
+ dataSource: filterSource,
183
+ columns: targetColumns
184
+ })), !!filterSource.length && displayType === 'single' && /*#__PURE__*/React.createElement(TargetList, _extends({}, props, {
129
185
  filterSource: filterSource
130
186
  })), filterSource.length === 0 && /*#__PURE__*/React.createElement("p", {
131
187
  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;