@kdcloudjs/kdesign 1.6.3 → 1.6.5-stable.1

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 (76) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/dist/kdesign-complete.less +108 -105
  3. package/dist/kdesign.css +76 -84
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +271 -97
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +3 -3
  8. package/dist/kdesign.min.js +8 -8
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/cascader/cascader.js +2 -2
  11. package/es/cascader/style/index.css +4 -1
  12. package/es/cascader/style/index.less +5 -1
  13. package/es/cascader/style/token.less +1 -0
  14. package/es/date-picker/style/index.css +40 -40
  15. package/es/date-picker/style/index.less +3 -8
  16. package/es/date-picker/style/token.less +3 -0
  17. package/es/input/style/index.css +3 -3
  18. package/es/input/style/token.less +1 -1
  19. package/es/locale/locale.d.ts +2 -3
  20. package/es/locale/zh-CN.d.ts +2 -0
  21. package/es/locale/zh-CN.js +3 -1
  22. package/es/pagination/pagination.d.ts +3 -0
  23. package/es/pagination/pagination.js +34 -15
  24. package/es/pagination/style/index.css +24 -21
  25. package/es/pagination/style/index.less +85 -79
  26. package/es/rate/rate.js +1 -1
  27. package/es/rate/style/index.css +3 -3
  28. package/es/rate/style/index.less +9 -3
  29. package/es/search/search.js +12 -6
  30. package/es/steps/style/index.css +0 -13
  31. package/es/steps/style/index.less +0 -11
  32. package/es/table/feature/mergeCellHover.d.ts +3 -0
  33. package/es/table/feature/mergeCellHover.js +7 -0
  34. package/es/table/interface.d.ts +8 -0
  35. package/es/table/table.d.ts +2 -2
  36. package/es/table/table.js +20 -6
  37. package/es/transfer/list.d.ts +1 -1
  38. package/es/transfer/list.js +8 -2
  39. package/es/transfer/transfer.d.ts +1 -1
  40. package/es/transfer/transfer.js +29 -4
  41. package/es/upload/style/index.css +1 -2
  42. package/es/upload/style/index.less +1 -2
  43. package/lib/cascader/cascader.js +2 -2
  44. package/lib/cascader/style/index.css +4 -1
  45. package/lib/cascader/style/index.less +5 -1
  46. package/lib/cascader/style/token.less +1 -0
  47. package/lib/date-picker/style/index.css +40 -40
  48. package/lib/date-picker/style/index.less +3 -8
  49. package/lib/date-picker/style/token.less +3 -0
  50. package/lib/input/style/index.css +3 -3
  51. package/lib/input/style/token.less +1 -1
  52. package/lib/locale/locale.d.ts +2 -3
  53. package/lib/locale/zh-CN.d.ts +2 -0
  54. package/lib/locale/zh-CN.js +3 -1
  55. package/lib/pagination/pagination.d.ts +3 -0
  56. package/lib/pagination/pagination.js +36 -16
  57. package/lib/pagination/style/index.css +24 -21
  58. package/lib/pagination/style/index.less +85 -79
  59. package/lib/rate/rate.js +1 -1
  60. package/lib/rate/style/index.css +3 -3
  61. package/lib/rate/style/index.less +9 -3
  62. package/lib/search/search.js +12 -6
  63. package/lib/steps/style/index.css +0 -13
  64. package/lib/steps/style/index.less +0 -11
  65. package/lib/table/feature/mergeCellHover.d.ts +3 -0
  66. package/lib/table/feature/mergeCellHover.js +15 -0
  67. package/lib/table/interface.d.ts +8 -0
  68. package/lib/table/table.d.ts +2 -2
  69. package/lib/table/table.js +20 -4
  70. package/lib/transfer/list.d.ts +1 -1
  71. package/lib/transfer/list.js +8 -1
  72. package/lib/transfer/transfer.d.ts +1 -1
  73. package/lib/transfer/transfer.js +29 -3
  74. package/lib/upload/style/index.css +1 -2
  75. package/lib/upload/style/index.less +1 -2
  76. package/package.json +2 -2
@@ -186,107 +186,113 @@
186
186
 
187
187
  // 简化版分页
188
188
  &.simple {
189
- display: inline-flex;
190
- justify-content: space-around;
191
- align-items: center;
192
- height: @pagination-size;
193
- border-radius: @radius-border;
194
- border: @pagination-border-size solid transparent;
189
+ .@{pagination-prefix-cls}-action {
190
+ display: inline-flex;
191
+ justify-content: space-around;
192
+ align-items: center;
193
+ height: @pagination-size;
194
+ border-radius: @radius-border;
195
+ border: @pagination-border-size solid transparent;
195
196
 
196
- &.bordered {
197
- border-color: @pagination-border-color;
198
- transition: border-color @duration-promptly;
197
+ &.bordered {
198
+ border-color: @pagination-border-color;
199
+ transition: border-color @duration-promptly;
199
200
 
200
- &:active:not(.disabled) {
201
- border-color: @pagination-border-hover-color;
202
- }
201
+ &:active:not(.disabled) {
202
+ border-color: @pagination-border-hover-color;
203
+ }
203
204
 
204
- &.disabled,
205
- &.disabled > .@{pagination-prefix-cls}-item > button {
206
- background-color: @pagination-button-disabled-background-color;
205
+ &.disabled,
206
+ &.disabled > .@{pagination-prefix-cls}-item > button {
207
+ background-color: @pagination-button-disabled-background-color;
208
+ }
207
209
  }
208
- }
209
-
210
- &.disabled > .@{pagination-prefix-cls}-item {
211
- color: @pagination-disabled-color;
212
- }
213
-
214
- .@{pagination-prefix-cls}-item {
215
- .reset-component;
216
- display: inline-block;
217
- height: @pagination-size;
218
- overflow: hidden;
219
- margin: 0 8px;
220
- vertical-align: middle;
221
- color: @color-text-primary;
222
210
 
223
- &:first-child,
224
- &:last-child {
225
- margin: 0;
211
+ &.disabled > .@{pagination-prefix-cls}-action-item {
212
+ color: @pagination-disabled-color;
226
213
  }
227
214
 
228
- .@{pagination-prefix-cls}-current {
229
- margin-right: 2px;
215
+ &-item {
216
+ .reset-component;
217
+ display: inline-block;
218
+ height: @pagination-size;
219
+ overflow: hidden;
220
+ margin: 0 8px;
230
221
  vertical-align: middle;
222
+ color: @color-text-primary;
231
223
 
232
- .@{pagination-prefix-cls}-current-input {
224
+ &:first-child,
225
+ &:last-child {
233
226
  margin: 0;
227
+ }
234
228
 
235
- &:disabled {
236
- color: @pagination-disabled-color;
237
- cursor: not-allowed;
229
+ .@{pagination-prefix-cls}-current {
230
+ margin-right: 2px;
231
+ vertical-align: middle;
232
+
233
+ .@{pagination-prefix-cls}-current-input {
234
+ margin: 0;
235
+
236
+ &:disabled {
237
+ color: @pagination-disabled-color;
238
+ cursor: not-allowed;
239
+ }
238
240
  }
239
241
  }
240
- }
241
242
 
242
- .@{pagination-prefix-cls}-total {
243
- vertical-align: middle;
244
- margin-right: 0;
245
- }
243
+ .@{pagination-prefix-cls}-total {
244
+ vertical-align: middle;
245
+ margin-right: 0;
246
+ }
246
247
 
247
- button {
248
- box-sizing: border-box;
249
- position: relative;
250
- width: calc(@pagination-size - 2px);
251
- height: calc(@pagination-size - 2px);
252
- border: none;
253
- background-color: @color-background;
254
- border-radius: @radius-border;
255
- cursor: pointer;
256
- outline: none;
257
- vertical-align: middle;
258
- transition: border-color @duration-promptly;
248
+ &.bordered > button {
249
+ border: none;
250
+ }
259
251
 
260
- &:hover,
261
- &:active {
262
- &:not(:disabled) {
263
- border-color: @pagination-border-hover-color;
264
- }
252
+ button {
253
+ box-sizing: border-box;
254
+ position: relative;
255
+ width: calc(@pagination-size - 2px);
256
+ height: calc(@pagination-size - 2px);
257
+ border: none;
258
+ background-color: @color-background;
259
+ border-radius: @radius-border;
260
+ cursor: pointer;
261
+ outline: none;
262
+ vertical-align: middle;
263
+ transition: border-color @duration-promptly;
265
264
 
266
- i {
267
- color: @pagination-hover-color;
265
+ &:hover,
266
+ &:active {
267
+ &:not(:disabled) {
268
+ border-color: @pagination-border-hover-color;
269
+ }
270
+
271
+ i {
272
+ color: @pagination-hover-color;
273
+ }
268
274
  }
269
- }
270
275
 
271
- &:disabled {
272
- cursor: not-allowed;
276
+ &:disabled {
277
+ cursor: not-allowed;
273
278
 
274
- i {
275
- color: @pagination-disabled-color;
279
+ i {
280
+ color: @pagination-disabled-color;
281
+ }
276
282
  }
277
- }
278
283
 
279
- i {
280
- position: absolute;
281
- top: 0;
282
- right: 0;
283
- bottom: 0;
284
- left: 0;
285
- margin: auto;
286
- line-height: calc(@pagination-size - 2px);
287
- font-size: @pagination-icon-size;
288
- color: @pagination-icon-color;
289
- transition: color @duration-promptly;
284
+ i {
285
+ position: absolute;
286
+ top: 0;
287
+ right: 0;
288
+ bottom: 0;
289
+ left: 0;
290
+ margin: auto;
291
+ line-height: calc(@pagination-size - 2px);
292
+ font-size: @pagination-icon-size;
293
+ color: @pagination-icon-color;
294
+ transition: color @duration-promptly;
295
+ }
290
296
  }
291
297
  }
292
298
  }
package/es/rate/rate.js CHANGED
@@ -54,7 +54,7 @@ var Rate = function Rate(props) {
54
54
 
55
55
 
56
56
  React.useEffect(function () {
57
- if (value && value !== 0 && value !== selectedValue) {
57
+ if (value !== undefined && value !== selectedValue) {
58
58
  setSelectedValue(value);
59
59
  }
60
60
  }, [value, selectedValue]); // const shouldSetValue = (value: number) => {
@@ -120,13 +120,13 @@
120
120
  -ms-flex-pack: start;
121
121
  justify-content: flex-start;
122
122
  }
123
- .kd-rate-size-large {
123
+ .kd-rate-size-large .kdicon {
124
124
  font-size: var(--kd-c-rate-font-size-large, 20px);
125
125
  }
126
- .kd-rate-size-middle {
126
+ .kd-rate-size-middle .kdicon {
127
127
  font-size: var(--kd-c-rate-font-size-middle, 16px);
128
128
  }
129
- .kd-rate-size-small {
129
+ .kd-rate-size-small .kdicon {
130
130
  font-size: var(--kd-c-rate-font-size-small, 12px);
131
131
  }
132
132
  .kd-rate-item {
@@ -9,13 +9,19 @@
9
9
  display: inline-flex;
10
10
  justify-content: flex-start;
11
11
  &-size-large {
12
- font-size: @rate-large-font-size;
12
+ .@{kd-prefix}icon {
13
+ font-size: @rate-large-font-size;
14
+ }
13
15
  }
14
16
  &-size-middle {
15
- font-size: @rate-middle-font-size;
17
+ .@{kd-prefix}icon {
18
+ font-size: @rate-middle-font-size;
19
+ }
16
20
  }
17
21
  &-size-small {
18
- font-size: @rate-small-font-size;
22
+ .@{kd-prefix}icon {
23
+ font-size: @rate-small-font-size;
24
+ }
19
25
  }
20
26
  }
21
27
  .@{rate-prefix-cls}-item {
@@ -54,7 +54,9 @@ var InternalSearch = function InternalSearch(props, ref) {
54
54
  type = searchProps.type,
55
55
  placeholder = searchProps.placeholder,
56
56
  onSearch = searchProps.onSearch,
57
- restProps = __rest(searchProps, ["prefixCls", "className", "style", "size", "disabled", "onPressEnter", "prefix", "suffix", "borderType", "children", "type", "placeholder", "onSearch"]);
57
+ onFocus = searchProps.onFocus,
58
+ onBlur = searchProps.onBlur,
59
+ restProps = __rest(searchProps, ["prefixCls", "className", "style", "size", "disabled", "onPressEnter", "prefix", "suffix", "borderType", "children", "type", "placeholder", "onSearch", "onFocus", "onBlur"]);
58
60
 
59
61
  devWarning(SearchSizeTypes.indexOf(size) === -1, 'search', "cannot found search size '".concat(size, "'"));
60
62
  devWarning(BorderTypes.indexOf(borderType) === -1, 'search', "cannot found search borderType '".concat(borderType, "'"));
@@ -73,12 +75,14 @@ var InternalSearch = function InternalSearch(props, ref) {
73
75
  var handlePressEnter = useCallback(function (_, event) {
74
76
  onPressEnter && (onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(searchRef.current.value, event));
75
77
  }, [onPressEnter, searchRef]);
76
- var handleFocus = useCallback(function () {
78
+ var handleFocus = useCallback(function (event) {
77
79
  setFocused(true);
78
- }, []);
79
- var handleBlur = useCallback(function () {
80
+ onFocus && onFocus(event);
81
+ }, [onFocus]);
82
+ var handleBlur = useCallback(function (event) {
80
83
  setFocused(false);
81
- }, []);
84
+ onBlur && onBlur(event);
85
+ }, [onBlur]);
82
86
  var renderPrefix = useCallback(function () {
83
87
  if (!prefix) {
84
88
  return null;
@@ -111,7 +115,9 @@ var InternalSearch = function InternalSearch(props, ref) {
111
115
  onSearch: onSearch,
112
116
  className: className,
113
117
  style: style,
114
- placeholder: placeholder
118
+ placeholder: placeholder,
119
+ onFocus: onFocus,
120
+ onBlur: onBlur
115
121
  }), children);
116
122
  }
117
123
 
@@ -164,9 +164,6 @@
164
164
  -webkit-box-direction: normal;
165
165
  -ms-flex-direction: column;
166
166
  flex-direction: column;
167
- -webkit-box-pack: center;
168
- -ms-flex-pack: center;
169
- justify-content: center;
170
167
  }
171
168
  .kd-steps-item-iconContainer {
172
169
  display: -webkit-box;
@@ -233,21 +230,11 @@
233
230
  line-height: 20px;
234
231
  font-size: var(--kd-c-steps-font-size, var(--kd-g-font-size-small, 12px));
235
232
  color: var(--kd-c-steps-color-wait, #999);
236
- overflow: hidden;
237
- text-overflow: ellipsis;
238
- word-break: break-word;
239
- display: -webkit-box;
240
- -webkit-box-orient: vertical;
241
233
  }
242
234
  .kd-steps-item-content .kd-steps-item-description {
243
235
  line-height: 20px;
244
236
  font-size: var(--kd-c-steps-font-size, var(--kd-g-font-size-small, 12px));
245
237
  color: var(--kd-c-steps-color-wait, #999);
246
- overflow: hidden;
247
- text-overflow: ellipsis;
248
- word-break: break-word;
249
- display: -webkit-box;
250
- -webkit-box-orient: vertical;
251
238
  width: var(--kd-c-steps-vertical-description-sizing-width, 200px);
252
239
  }
253
240
  .kd-steps-item-process {
@@ -69,7 +69,6 @@
69
69
  width: 100%;
70
70
  display: flex;
71
71
  flex-direction: column;
72
- justify-content: center;
73
72
  }
74
73
 
75
74
  &-iconContainer {
@@ -126,22 +125,12 @@
126
125
  line-height: 20px;
127
126
  font-size: @steps-font-size;
128
127
  color: @steps-color-wait;
129
- overflow: hidden;
130
- text-overflow: ellipsis;
131
- word-break: break-word;
132
- display: -webkit-box;
133
- -webkit-box-orient: vertical;
134
128
  }
135
129
 
136
130
  .@{steps-prefix-cls}-item-description {
137
131
  line-height: 20px;
138
132
  font-size: @steps-font-size;
139
133
  color: @steps-color-wait;
140
- overflow: hidden;
141
- text-overflow: ellipsis;
142
- word-break: break-word;
143
- display: -webkit-box;
144
- -webkit-box-orient: vertical;
145
134
  width: @steps-vertical-description-sizing-width;
146
135
  }
147
136
  }
@@ -0,0 +1,3 @@
1
+ import { TablePipeline } from '../interface';
2
+ declare function mergeCellHover(pipeline: TablePipeline): void;
3
+ export default mergeCellHover;
@@ -0,0 +1,7 @@
1
+ import { features } from '@kdcloudjs/table';
2
+
3
+ function mergeCellHover(pipeline) {
4
+ pipeline.use(features.mergeCellHover());
5
+ }
6
+
7
+ export default mergeCellHover;
@@ -10,6 +10,14 @@ declare type TablePropsOfComponents = Pick<BaseTableProps, 'components'> & {
10
10
  };
11
11
  };
12
12
  declare type TablePropsOfExtend = Omit<BaseTableProps, 'components'>;
13
+ export declare type TableApi = {
14
+ getColumns: () => any[];
15
+ getDataSource: () => any[];
16
+ getFooterDataSource: () => any[];
17
+ };
18
+ export declare type TableInstance = {
19
+ api: TableApi;
20
+ };
13
21
  export interface TableProps extends TablePropsOfExtend, TablePropsOfComponents {
14
22
  rowSelection?: TableRowSelection;
15
23
  prefixCls?: string;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { TableProps } from './interface';
3
- declare function Table(props: TableProps): JSX.Element;
3
+ declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<unknown>>;
4
4
  export default Table;
package/es/table/table.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
3
3
  import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
4
- import React, { useContext } from 'react';
4
+ import React, { forwardRef, useContext, useImperativeHandle, useRef } from 'react';
5
5
  import { Table as BaseTable, useTablePipeline } from '@kdcloudjs/table';
6
6
  import ConfigContext from '../config-provider/ConfigContext';
7
7
  import Checkbox from '../checkbox/index';
@@ -18,9 +18,9 @@ import useColumnResize from './feature/columnResize';
18
18
  import useColumnDrag from './feature/columnDrag';
19
19
  import useContextMenu from './feature/contextMenu';
20
20
  import useRangeSelection from './feature/useRangeSelection';
21
+ import useMergeCellHover from './feature/mergeCellHover';
21
22
  import devWarning from '../_utils/devwarning';
22
-
23
- function Table(props) {
23
+ var Table = /*#__PURE__*/forwardRef(function (props, ref) {
24
24
  var columns = props.columns,
25
25
  dataSource = props.dataSource,
26
26
  columnDrag = props.columnDrag,
@@ -68,19 +68,32 @@ function Table(props) {
68
68
  columns: columns,
69
69
  dataSource: dataSource
70
70
  });
71
+ var pipelineRef = useRef(pipeline);
72
+ pipelineRef.current = pipeline;
71
73
 
72
74
  if (footerDataSource) {
73
75
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
74
76
  // @ts-ignore
75
77
  pipeline.footerDataSource(footerDataSource);
76
78
  }
79
+
80
+ useImperativeHandle(ref, function () {
81
+ var _a, _b, _c;
82
+
83
+ return {
84
+ api: {
85
+ getColumns: (_a = pipelineRef.current.getColumns) === null || _a === void 0 ? void 0 : _a.bind(pipelineRef.current),
86
+ getDataSource: (_b = pipelineRef.current.getDataSource) === null || _b === void 0 ? void 0 : _b.bind(pipelineRef.current),
87
+ getFooterDataSource: (_c = pipelineRef.current.getFooterDataSource) === null || _c === void 0 ? void 0 : _c.bind(pipelineRef.current)
88
+ }
89
+ };
90
+ });
77
91
  /* -------------------------------------------------------------------------- */
78
92
 
79
93
  /* features */
80
94
 
81
95
  /* -------------------------------------------------------------------------- */
82
96
 
83
-
84
97
  useRowSelection(pipeline, rowSelection);
85
98
  useRowDetail(pipeline, rowDetail);
86
99
  useFilter(pipeline, filter);
@@ -91,6 +104,7 @@ function Table(props) {
91
104
  useColumnDrag(pipeline, columnDrag);
92
105
  useContextMenu(pipeline, contextMenu);
93
106
  useRangeSelection(pipeline, rangeSelection);
107
+ useMergeCellHover(pipeline);
94
108
  /* -------------------------------------------------------------------------- */
95
109
 
96
110
  /* after useTablePipeline, merge pipeline.getProps result */
@@ -135,6 +149,6 @@ function Table(props) {
135
149
  scrollbarWidth: scrollbarWidth,
136
150
  scrollLoad: scrollLoad
137
151
  }));
138
- }
139
-
152
+ });
153
+ Table.displayName = 'Table';
140
154
  export default Table;
@@ -32,5 +32,5 @@ export interface TransferListProps {
32
32
  showRemove?: boolean;
33
33
  pagination?: PaginationType;
34
34
  }
35
- declare const TransferList: React.FC<TransferListProps>;
35
+ declare const TransferList: React.ForwardRefExoticComponent<TransferListProps & React.RefAttributes<unknown>>;
36
36
  export default TransferList;
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
4
4
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
5
5
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
6
6
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
7
- import React, { useState } from 'react';
7
+ import React, { useState, useImperativeHandle } from 'react';
8
8
  import { omit } from '../_utils/omit';
9
9
  import Search from './search';
10
10
  import DefaultListBody, { OmitProps } from './list-body';
@@ -19,7 +19,7 @@ function isRenderResultPlainObject(result) {
19
19
  return result && ! /*#__PURE__*/React.isValidElement(result) && Object.prototype.toString.call(result) === '[object Object]';
20
20
  }
21
21
 
22
- var TransferList = function TransferList(props) {
22
+ var ITransferList = function ITransferList(props, ref) {
23
23
  var _classNames;
24
24
 
25
25
  var prefixCls = props.prefixCls,
@@ -50,6 +50,11 @@ var TransferList = function TransferList(props) {
50
50
 
51
51
 
52
52
  var footerDom = footer && footer(props);
53
+ useImperativeHandle(ref, function () {
54
+ return {
55
+ onClear: onClear
56
+ };
57
+ });
53
58
 
54
59
  var renderItem = function renderItem(item) {
55
60
  var renderResult = render(item);
@@ -226,6 +231,7 @@ var TransferList = function TransferList(props) {
226
231
  }, getSelectAllLabel(checkedKeys.length, filteredItems.length))), listBody, listFooter);
227
232
  };
228
233
 
234
+ var TransferList = /*#__PURE__*/React.forwardRef(ITransferList);
229
235
  TransferList.defaultProps = {
230
236
  dataSource: [],
231
237
  titleText: '',
@@ -29,5 +29,5 @@ export interface TransferProps {
29
29
  pagination?: PaginationType;
30
30
  footer?: (props: TransferListProps) => React.ReactNode;
31
31
  }
32
- declare const Transfer: React.FC<TransferProps>;
32
+ declare const Transfer: React.ForwardRefExoticComponent<TransferProps & React.RefAttributes<unknown>>;
33
33
  export default Transfer;
@@ -6,7 +6,7 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
6
6
  import _Set from "@babel/runtime-corejs3/core-js-stable/set";
7
7
  import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/splice";
8
8
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
9
- import React, { useContext, useState } from 'react';
9
+ import React, { useContext, useState, useImperativeHandle, useRef } from 'react';
10
10
  import classNames from 'classnames';
11
11
  import List from './list';
12
12
  import Operation from './operation';
@@ -14,7 +14,7 @@ import ConfigContext from '../config-provider/ConfigContext';
14
14
  import { getCompProps } from '../_utils';
15
15
  import noDataImg from './img/transfer-empty.png';
16
16
 
17
- var Transfer = function Transfer(props) {
17
+ var InternalTransfer = function InternalTransfer(props, ref) {
18
18
  var _classNames;
19
19
 
20
20
  var _useContext = useContext(ConfigContext),
@@ -75,6 +75,8 @@ var Transfer = function Transfer(props) {
75
75
  targetSelectedKeys = _useState4[0],
76
76
  setTargetSelectedKeys = _useState4[1];
77
77
 
78
+ var leftListRef = useRef(null);
79
+ var rightListRef = useRef(null);
78
80
  var leftActive = targetSelectedKeys.length > 0;
79
81
  var rightActive = sourceSelectedKeys.length > 0;
80
82
  var mergedPagination = !children && pagination;
@@ -82,6 +84,25 @@ var Transfer = function Transfer(props) {
82
84
  var rightTitle = titles[1] || transferLang.rightTitle;
83
85
  var leftPlaceholder = searchPlaceholder[0] || transferLang.searchPlaceholder[0];
84
86
  var rightPlaceholder = searchPlaceholder[1] || transferLang.searchPlaceholder[1];
87
+ useImperativeHandle(ref, function () {
88
+ return {
89
+ clearSearch: clearSearch
90
+ };
91
+ });
92
+
93
+ var clearSearch = function clearSearch(position) {
94
+ var _a, _b;
95
+
96
+ if (position === 'left' || position === undefined) {
97
+ ;
98
+ (_a = leftListRef === null || leftListRef === void 0 ? void 0 : leftListRef.current) === null || _a === void 0 ? void 0 : _a.onClear();
99
+ }
100
+
101
+ if (position === 'right' || position === undefined) {
102
+ ;
103
+ (_b = rightListRef === null || rightListRef === void 0 ? void 0 : rightListRef.current) === null || _b === void 0 ? void 0 : _b.onClear();
104
+ }
105
+ };
85
106
 
86
107
  var setStateKeys = function setStateKeys(direction, keys) {
87
108
  if (direction === 'left') {
@@ -301,7 +322,8 @@ var Transfer = function Transfer(props) {
301
322
  showSelectAll: showSelectAll,
302
323
  pagination: mergedPagination,
303
324
  noDataContent: handleNoDataContent(noDataContent, 'left'),
304
- footer: footer
325
+ footer: footer,
326
+ ref: leftListRef
305
327
  }), /*#__PURE__*/React.createElement(Operation, {
306
328
  className: "".concat(transferPrefixCls, "-operation"),
307
329
  rightActive: rightActive,
@@ -335,8 +357,11 @@ var Transfer = function Transfer(props) {
335
357
  pagination: mergedPagination,
336
358
  noDataContent: handleNoDataContent(noDataContent, 'right'),
337
359
  footer: footer,
338
- showRemove: oneWay
360
+ showRemove: oneWay,
361
+ ref: rightListRef
339
362
  }));
340
363
  };
341
364
 
365
+ var Transfer = /*#__PURE__*/React.forwardRef(InternalTransfer);
366
+ Transfer.displayName = 'Transfer';
342
367
  export default Transfer;
@@ -207,7 +207,6 @@
207
207
  visibility: visible;
208
208
  -webkit-transform: translateX(0);
209
209
  transform: translateX(0);
210
- background-color: var(--kd-c-upload-color-background-hover, var(--kd-g-color-hover, #f5f5f5));
211
210
  }
212
211
  .kd-upload .kd-upload-text-list-item.error i,
213
212
  .kd-upload .kd-upload-text-list-item.error .kd-upload-text-list-item-name {
@@ -234,7 +233,7 @@
234
233
  padding: 0 var(--kd-c-upload-text-list-item-padding-horizontal, 20px);
235
234
  height: var(--kd-c-upload-list-item-height, 44px);
236
235
  line-height: var(--kd-c-upload-list-item-height, 44px);
237
- background-color: transparent;
236
+ background: transparent;
238
237
  opacity: 0;
239
238
  visibility: hidden;
240
239
  -webkit-transform: translateX(5px);
@@ -80,7 +80,6 @@
80
80
  opacity: 1;
81
81
  visibility: visible;
82
82
  transform: translateX(0);
83
- background-color: @upload-background-color-hover;
84
83
  }
85
84
  }
86
85
 
@@ -113,7 +112,7 @@
113
112
  padding: 0 @upload-text-list-item-padding-horizontal;
114
113
  height: @upload-list-item-height;
115
114
  line-height: @upload-list-item-height;
116
- background-color: transparent;
115
+ background: transparent;
117
116
  opacity: 0;
118
117
  visibility: hidden;
119
118
  transform: translateX(5px);
@@ -164,7 +164,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
164
164
  };
165
165
 
166
166
  var handleClear = function handleClear() {
167
- setValue([]);
167
+ onChange([]);
168
168
  };
169
169
 
170
170
  var inputProps = {
@@ -196,7 +196,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
196
196
  }, /*#__PURE__*/React.createElement(_input.default, (0, _extends2.default)({}, inputProps)), /*#__PURE__*/React.createElement("span", {
197
197
  className: "".concat(prefixCls, "-picker-label")
198
198
  }, (labels === null || labels === void 0 ? void 0 : labels.length) ? displayRender(labels, currentOptions) : '')), allowClear && /*#__PURE__*/React.createElement(_icon.default, {
199
- type: "close",
199
+ type: "close-solid",
200
200
  className: "".concat(prefixCls, "-picker-close"),
201
201
  onClick: handleClear
202
202
  })));
@@ -188,7 +188,7 @@
188
188
  opacity: 0;
189
189
  cursor: pointer;
190
190
  visibility: hidden;
191
- color: var(--kd-c-cascader-color-active, var(--kd-g-color-theme, #5582f3));
191
+ color: var(--kd-c-cascader-clear-color-text, #666);
192
192
  -webkit-transition: all 0.1s;
193
193
  transition: all 0.1s;
194
194
  -webkit-transform-origin: 50% 50%;
@@ -196,6 +196,9 @@
196
196
  -webkit-transform: scale(0.9) translateY(-50%);
197
197
  transform: scale(0.9) translateY(-50%);
198
198
  }
199
+ .kd-cascader-picker-close:hover {
200
+ color: var(--kd-c-cascader-color-active, var(--kd-g-color-theme, #5582f3));
201
+ }
199
202
  .kd-cascader-menus {
200
203
  -webkit-box-sizing: border-box;
201
204
  box-sizing: border-box;