@kdcloudjs/kdesign 1.7.14 → 1.7.16

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 (102) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/kdesign-complete.less +43 -12
  3. package/dist/kdesign.css +104 -11
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +514 -468
  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/alert/alert.d.ts +1 -0
  11. package/es/alert/alert.js +15 -3
  12. package/es/button/group.d.ts +1 -0
  13. package/es/button/group.js +6 -3
  14. package/es/card/card.d.ts +1 -0
  15. package/es/card/card.js +3 -2
  16. package/es/cascader/cascader.d.ts +2 -0
  17. package/es/cascader/cascader.js +16 -4
  18. package/es/checkbox/checkbox.js +11 -10
  19. package/es/checkbox/group.d.ts +2 -1
  20. package/es/checkbox/group.js +16 -4
  21. package/es/city-picker/city-picker.js +1 -0
  22. package/es/city-picker/style/index.css +6 -0
  23. package/es/city-picker/style/index.less +8 -0
  24. package/es/color-picker/color-picker-panel.js +2 -3
  25. package/es/config-provider/compDefaultProps.d.ts +1 -0
  26. package/es/config-provider/compDefaultProps.js +1 -0
  27. package/es/dropdown/dropdown.d.ts +2 -0
  28. package/es/form/Field.d.ts +4 -0
  29. package/es/form/Field.js +3 -6
  30. package/es/form/index.js +1 -0
  31. package/es/input/input.d.ts +1 -0
  32. package/es/input/style/index.css +86 -10
  33. package/es/input/style/index.less +1 -11
  34. package/es/input/style/mixin.less +18 -0
  35. package/es/input/style/token.less +1 -1
  36. package/es/input-number/inputNumber.js +1 -1
  37. package/es/locale/locale.d.ts +3 -4
  38. package/es/locale/zh-CN.js +8 -8
  39. package/es/modal/modal.js +0 -1
  40. package/es/notification/index.js +2 -1
  41. package/es/notification-base/index.js +11 -8
  42. package/es/search/quick-search.js +13 -3
  43. package/es/search/search.js +3 -3
  44. package/es/select/select.js +8 -8
  45. package/es/select/style/index.css +7 -0
  46. package/es/select/style/index.less +11 -0
  47. package/es/transfer/list.js +1 -1
  48. package/es/tree/tree.d.ts +2 -0
  49. package/es/tree/tree.js +15 -4
  50. package/es/tree-select/interface.d.ts +6 -1
  51. package/es/tree-select/tree-select.js +5 -4
  52. package/es/upload/interface.d.ts +1 -0
  53. package/es/upload/style/index.css +4 -0
  54. package/es/upload/style/index.less +4 -0
  55. package/es/upload/upload.js +16 -6
  56. package/lib/alert/alert.d.ts +1 -0
  57. package/lib/alert/alert.js +15 -3
  58. package/lib/button/group.d.ts +1 -0
  59. package/lib/button/group.js +6 -3
  60. package/lib/card/card.d.ts +1 -0
  61. package/lib/card/card.js +3 -2
  62. package/lib/cascader/cascader.d.ts +2 -0
  63. package/lib/cascader/cascader.js +20 -8
  64. package/lib/checkbox/checkbox.js +11 -10
  65. package/lib/checkbox/group.d.ts +2 -1
  66. package/lib/checkbox/group.js +17 -7
  67. package/lib/city-picker/city-picker.js +1 -0
  68. package/lib/city-picker/style/index.css +6 -0
  69. package/lib/city-picker/style/index.less +8 -0
  70. package/lib/color-picker/color-picker-panel.js +2 -3
  71. package/lib/config-provider/compDefaultProps.d.ts +1 -0
  72. package/lib/config-provider/compDefaultProps.js +1 -0
  73. package/lib/dropdown/dropdown.d.ts +2 -0
  74. package/lib/form/Field.d.ts +4 -0
  75. package/lib/form/Field.js +4 -6
  76. package/lib/form/index.js +1 -0
  77. package/lib/input/input.d.ts +1 -0
  78. package/lib/input/style/index.css +86 -10
  79. package/lib/input/style/index.less +1 -11
  80. package/lib/input/style/mixin.less +18 -0
  81. package/lib/input/style/token.less +1 -1
  82. package/lib/input-number/inputNumber.js +1 -1
  83. package/lib/locale/locale.d.ts +3 -4
  84. package/lib/locale/zh-CN.js +8 -8
  85. package/lib/modal/modal.js +0 -1
  86. package/lib/notification/index.js +2 -1
  87. package/lib/notification-base/index.js +11 -8
  88. package/lib/search/quick-search.js +17 -7
  89. package/lib/search/search.js +3 -3
  90. package/lib/select/select.js +8 -8
  91. package/lib/select/style/index.css +7 -0
  92. package/lib/select/style/index.less +11 -0
  93. package/lib/transfer/list.js +1 -1
  94. package/lib/tree/tree.d.ts +2 -0
  95. package/lib/tree/tree.js +19 -8
  96. package/lib/tree-select/interface.d.ts +6 -1
  97. package/lib/tree-select/tree-select.js +5 -4
  98. package/lib/upload/interface.d.ts +1 -0
  99. package/lib/upload/style/index.css +4 -0
  100. package/lib/upload/style/index.less +4 -0
  101. package/lib/upload/upload.js +16 -6
  102. package/package.json +2 -1
@@ -220,7 +220,6 @@ textarea {
220
220
  }
221
221
  .kd-input-borderless {
222
222
  border: 0;
223
- padding-left: 0 !important;
224
223
  }
225
224
  .kd-input-borderless:focus {
226
225
  border: 0;
@@ -248,20 +247,62 @@ textarea {
248
247
  font-size: var(--kd-c-input-font-size-small, var(--kd-g-font-size-small, 12px));
249
248
  padding: var(--kd-c-input-spacing-padding-vertical-small, 3px) var(--kd-c-input-spacing-padding-horizontal-small, 9px);
250
249
  }
250
+ .kd-input-size-small .kd-input-suffix {
251
+ margin-left: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
252
+ }
253
+ .kd-input-size-small .kd-input-prefix {
254
+ margin-right: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
255
+ }
256
+ .kd-input-size-small.kd-input-underline {
257
+ padding-right: 0;
258
+ padding-left: 0;
259
+ }
260
+ .kd-input-size-small.kd-input-wrapper-underline {
261
+ padding-right: 0;
262
+ padding-left: 0;
263
+ }
251
264
  .kd-input-size-middle {
252
265
  height: var(--kd-c-input-sizing-height-middle, 30px);
253
266
  line-height: calc(var(--kd-c-input-sizing-height-middle, 30px) - (var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2) - (1px * 2));
254
267
  font-size: var(--kd-c-input-font-size-middle, var(--kd-g-font-size-middle, 14px));
255
268
  padding: var(--kd-c-input-spacing-padding-vertical-small, 3px) var(--kd-c-input-spacing-padding-horizontal-small, 9px);
256
269
  }
270
+ .kd-input-size-middle .kd-input-suffix {
271
+ margin-left: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
272
+ }
273
+ .kd-input-size-middle .kd-input-prefix {
274
+ margin-right: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
275
+ }
276
+ .kd-input-size-middle.kd-input-underline {
277
+ padding-right: 0;
278
+ padding-left: 0;
279
+ }
280
+ .kd-input-size-middle.kd-input-wrapper-underline {
281
+ padding-right: 0;
282
+ padding-left: 0;
283
+ }
257
284
  .kd-input-size-large {
258
285
  height: var(--kd-c-input-sizing-height-large, 36px);
259
286
  line-height: calc(var(--kd-c-input-sizing-height-large, 36px) - (var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2) - (1px * 2));
260
287
  font-size: var(--kd-c-input-font-size-large, var(--kd-g-font-size-large, 16px));
261
288
  padding: var(--kd-c-input-spacing-padding-vertical-small, 3px) var(--kd-c-input-spacing-padding-horizontal-small, 9px);
262
289
  }
290
+ .kd-input-size-large .kd-input-suffix {
291
+ margin-left: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
292
+ }
293
+ .kd-input-size-large .kd-input-prefix {
294
+ margin-right: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
295
+ }
296
+ .kd-input-size-large.kd-input-underline {
297
+ padding-right: 0;
298
+ padding-left: 0;
299
+ }
300
+ .kd-input-size-large.kd-input-wrapper-underline {
301
+ padding-right: 0;
302
+ padding-left: 0;
303
+ }
263
304
  .kd-input-wrapper {
264
- padding-left: var(--kd-c-input-wrapper-padding-left, 0px) !important;
305
+ padding-left: var(--kd-c-input-wrapper-padding-left, 0px);
265
306
  width: 100%;
266
307
  min-width: 0;
267
308
  border: var(--kd-c-input-sizing-border, 1px) solid var(--kd-c-input-color-border-disabled, var(--kd-g-color-border-strong, #d9d9d9));
@@ -309,7 +350,7 @@ textarea {
309
350
  }
310
351
  .kd-input-wrapper .kd-input {
311
352
  border: none;
312
- padding-left: var(--kd-c-input-padding-left, 9px);
353
+ padding-left: var(--kd-c-input-padding-left, 0px);
313
354
  padding-right: 0;
314
355
  height: 100%;
315
356
  }
@@ -330,31 +371,66 @@ textarea {
330
371
  word-break: keep-all;
331
372
  color: var(--kd-c-input-affix-color-text, #666);
332
373
  }
333
- .kd-input-wrapper .kd-input-suffix {
334
- margin-left: 4px;
335
- }
336
- .kd-input-wrapper .kd-input-prefix {
337
- margin-right: 4px;
338
- margin-left: 8px;
339
- }
340
374
  .kd-input-wrapper-size-small {
341
375
  height: var(--kd-c-input-sizing-height-small, 20px);
342
376
  line-height: calc(var(--kd-c-input-sizing-height-small, 20px) - (var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2) - (1px * 2));
343
377
  font-size: var(--kd-c-input-font-size-small, var(--kd-g-font-size-small, 12px));
344
378
  padding: var(--kd-c-input-spacing-padding-vertical-small, 3px) var(--kd-c-input-spacing-padding-horizontal-small, 9px);
345
379
  }
380
+ .kd-input-wrapper-size-small .kd-input-suffix {
381
+ margin-left: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
382
+ }
383
+ .kd-input-wrapper-size-small .kd-input-prefix {
384
+ margin-right: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
385
+ }
386
+ .kd-input-wrapper-size-small.kd-input-underline {
387
+ padding-right: 0;
388
+ padding-left: 0;
389
+ }
390
+ .kd-input-wrapper-size-small.kd-input-wrapper-underline {
391
+ padding-right: 0;
392
+ padding-left: 0;
393
+ }
346
394
  .kd-input-wrapper-size-middle {
347
395
  height: var(--kd-c-input-sizing-height-middle, 30px);
348
396
  line-height: calc(var(--kd-c-input-sizing-height-middle, 30px) - (var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2) - (1px * 2));
349
397
  font-size: var(--kd-c-input-font-size-middle, var(--kd-g-font-size-middle, 14px));
350
398
  padding: var(--kd-c-input-spacing-padding-vertical-small, 3px) var(--kd-c-input-spacing-padding-horizontal-middle, 9px);
351
399
  }
400
+ .kd-input-wrapper-size-middle .kd-input-suffix {
401
+ margin-left: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
402
+ }
403
+ .kd-input-wrapper-size-middle .kd-input-prefix {
404
+ margin-right: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
405
+ }
406
+ .kd-input-wrapper-size-middle.kd-input-underline {
407
+ padding-right: 0;
408
+ padding-left: 0;
409
+ }
410
+ .kd-input-wrapper-size-middle.kd-input-wrapper-underline {
411
+ padding-right: 0;
412
+ padding-left: 0;
413
+ }
352
414
  .kd-input-wrapper-size-large {
353
415
  height: var(--kd-c-input-sizing-height-large, 36px);
354
416
  line-height: calc(var(--kd-c-input-sizing-height-large, 36px) - (var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2) - (1px * 2));
355
417
  font-size: var(--kd-c-input-font-size-large, var(--kd-g-font-size-large, 16px));
356
418
  padding: var(--kd-c-input-spacing-padding-vertical-small, 3px) var(--kd-c-input-spacing-padding-horizontal-large, 9px);
357
419
  }
420
+ .kd-input-wrapper-size-large .kd-input-suffix {
421
+ margin-left: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
422
+ }
423
+ .kd-input-wrapper-size-large .kd-input-prefix {
424
+ margin-right: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
425
+ }
426
+ .kd-input-wrapper-size-large.kd-input-underline {
427
+ padding-right: 0;
428
+ padding-left: 0;
429
+ }
430
+ .kd-input-wrapper-size-large.kd-input-wrapper-underline {
431
+ padding-right: 0;
432
+ padding-left: 0;
433
+ }
358
434
  .kd-input-wrapper-borderless {
359
435
  border: none !important;
360
436
  }
@@ -58,7 +58,6 @@ textarea {
58
58
 
59
59
  &-borderless {
60
60
  border: 0;
61
- padding-left: 0 !important;
62
61
 
63
62
  &:focus {
64
63
  border: 0;
@@ -98,7 +97,7 @@ textarea {
98
97
  }
99
98
 
100
99
  &-wrapper {
101
- padding-left: @input-wrapper-padding-left !important;
100
+ padding-left: @input-wrapper-padding-left;
102
101
  .input(@wrapper-prefix-cls);
103
102
  transition: border-color @transition-duration-inner;
104
103
  display: inline-flex;
@@ -122,15 +121,6 @@ textarea {
122
121
  word-break: keep-all;
123
122
  color: @input-affix-color;
124
123
  }
125
-
126
- &-suffix {
127
- margin-left: 4px;
128
- }
129
-
130
- &-prefix {
131
- margin-right: 4px;
132
- margin-left: 8px;
133
- }
134
124
  }
135
125
 
136
126
  &-size-small {
@@ -46,6 +46,24 @@
46
46
  line-height: calc(@height - (@padding-vertical * 2) - (@input-border-width * 2));
47
47
  font-size: @fonSize;
48
48
  padding: @padding-vertical @padding-horizontal;
49
+
50
+ .@{input-prefix-cls}-suffix {
51
+ margin-left: calc(@padding-vertical * 2);
52
+ }
53
+
54
+ .@{input-prefix-cls}-prefix {
55
+ margin-right: calc(@padding-vertical * 2);
56
+ }
57
+
58
+ &.@{input-prefix-cls}-underline {
59
+ padding-right: 0;
60
+ padding-left: 0;
61
+ }
62
+
63
+ &.@{input-prefix-cls}-wrapper-underline {
64
+ padding-right: 0;
65
+ padding-left: 0;
66
+ }
49
67
  }
50
68
 
51
69
  .input-clear-icon() {
@@ -40,7 +40,7 @@
40
40
  @input-large-height-inner: var(~'@{input-prefix}-sizing-height-large', 36px);
41
41
  @input-border-width-inner: var(~'@{input-prefix}-sizing-border', 1px);
42
42
  @input-wrapper-padding-left: var(~'@{input-prefix}-wrapper-padding-left', 0px);
43
- @input-padding-left: var(~'@{input-prefix}-padding-left', 9px);
43
+ @input-padding-left: var(~'@{input-prefix}-padding-left', 0px);
44
44
 
45
45
  // spacing
46
46
  @input-small-padding-vertical-inner: var(~'@{input-prefix}-spacing-padding-vertical-small', 3px);
@@ -72,7 +72,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
72
72
  return true;
73
73
  };
74
74
  useEffect(function () {
75
- setInputValue(value);
75
+ setInputValue(serialization(value + ''));
76
76
  }, [value]);
77
77
  var handleEventAttachValue = function handleEventAttachValue(event, value) {
78
78
  return _extends({}, event, {
@@ -59,14 +59,13 @@ declare class LocaleCache {
59
59
  'QuickSearch.desc': string[];
60
60
  'QuickSearch.nplDesc': string;
61
61
  'QuickSearch.emptyTip': string;
62
- /**
63
- * 获取当前语言包数据
64
- */
65
62
  'QuickSearch.or': string;
66
63
  'CityPicker.domestic': string;
67
64
  'CityPicker.internation': string;
68
65
  'CityPicker.common': string;
69
- 'CityPicker.noData': string;
66
+ 'CityPicker.noData': string; /**
67
+ * 获取所有语言包数据
68
+ */
70
69
  'ColorPicker.followFunctionalColor': string;
71
70
  'Search.placeholder': string;
72
71
  'Search.desc': string[];
@@ -14,15 +14,15 @@ var locale = _extends(_extends({
14
14
  'Progress.success': '加载成功',
15
15
  'Pagination.prevPage': '上一页',
16
16
  'Pagination.nextPage': '下一页',
17
- 'Pagination.total': '共{page}页{row}条',
18
- 'Pagination.page': '共{page}页',
19
- 'Pagination.row': '共{row}条',
17
+ 'Pagination.total': '共 {page} {row}条',
18
+ 'Pagination.page': '共 {page} 页',
19
+ 'Pagination.row': '共 {row} 条',
20
20
  'Pagination.first': '第一页',
21
21
  'Pagination.last': '最后一页',
22
- 'Pagination.perPage': '{size}条/页',
23
- 'Pagination.order': '第{order}页',
24
- 'Pagination.forward': '向前5页',
25
- 'Pagination.backward': '向后5页',
22
+ 'Pagination.perPage': '{size} 条/页',
23
+ 'Pagination.order': '第 {order} 页',
24
+ 'Pagination.forward': '向前 5 页',
25
+ 'Pagination.backward': '向后 5 页',
26
26
  'Transfer.selectAll': '全选',
27
27
  'Transfer.searchPlaceholder': ['请输入需要搜索的内容', '请输入需要搜索的内容'],
28
28
  'Transfer.leftTitle': '可选列表',
@@ -42,7 +42,7 @@ var locale = _extends(_extends({
42
42
  'CityPicker.internation': '国际',
43
43
  'CityPicker.common': '常用',
44
44
  'CityPicker.noData': '暂无数据',
45
- 'ColorPicker.followFunctionalColor': '跟随主题色',
45
+ 'ColorPicker.followFunctionalColor': '跟随功能色',
46
46
  'Search.placeholder': '请输入需要搜索的内容',
47
47
  'Search.desc': ['空格代表"或",回车代表"且"'],
48
48
  'Search.nplDesc': '智能搜索',
package/es/modal/modal.js CHANGED
@@ -224,7 +224,6 @@ var InternalModal = function InternalModal(props, ref) {
224
224
  // 没有容器应该是不用居中的
225
225
  // 但仍可拖拽
226
226
  var handleDragStart = function handleDragStart(e, data) {
227
- e === null || e === void 0 ? void 0 : e.stopPropagation();
228
227
  onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(e, data);
229
228
  };
230
229
  var defaultPosition = modalContainer ? {
@@ -129,6 +129,7 @@ var Notification = {
129
129
  },
130
130
  destroy: function destroy(key) {
131
131
  NotificationApi.destroy(key);
132
- }
132
+ },
133
+ displayName: 'Notification'
133
134
  };
134
135
  export default Notification;
@@ -48,14 +48,17 @@ var NotificationApi = {
48
48
  destroy: function destroy(key) {
49
49
  if (key) {
50
50
  _Object$keys(notificationInstance).forEach(function (placement) {
51
- var instance = notificationInstance[placement].instance;
52
- var notices = instance.notices;
53
- if (Array.isArray(notices) && notices.length) {
54
- var flag = notices.some(function (notice) {
55
- return notice.key === key;
56
- });
57
- if (flag) {
58
- instance.remove(key);
51
+ var _a;
52
+ var instance = (_a = notificationInstance[placement]) === null || _a === void 0 ? void 0 : _a.instance;
53
+ if (instance) {
54
+ var notices = instance.notices;
55
+ if (Array.isArray(notices) && notices.length) {
56
+ var flag = notices.some(function (notice) {
57
+ return notice.key === key;
58
+ });
59
+ if (flag) {
60
+ instance.remove(key);
61
+ }
59
62
  }
60
63
  }
61
64
  });
@@ -3,10 +3,19 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
3
3
  import _typeof from "@babel/runtime-corejs3/helpers/typeof";
4
4
  import _extends from "@babel/runtime-corejs3/helpers/extends";
5
5
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
6
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
6
7
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
7
8
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
8
9
  import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
9
10
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
11
+ var __rest = this && this.__rest || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
14
+ if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
15
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
16
+ }
17
+ return t;
18
+ };
10
19
  import React, { useContext, useState, useRef, useCallback, useLayoutEffect, useMemo } from 'react';
11
20
  import classNames from 'classnames';
12
21
  import debounce from 'lodash/debounce';
@@ -39,7 +48,8 @@ var InternalQuickSearch = function InternalQuickSearch(props, ref) {
39
48
  onSelect = props.onSelect,
40
49
  onSearch = props.onSearch,
41
50
  disabled = props.disabled,
42
- borderType = props.borderType;
51
+ borderType = props.borderType,
52
+ others = __rest(props, ["prefixCls", "className", "placeholder", "style", "desc", "dropdownStyle", "tags", "children", "onBlur", "onFocus", "onChange", "onSelect", "onSearch", "disabled", "borderType"]);
43
53
  var realChildren = Array.isArray(tags) && tags.length ? tags : toArray(children); // tags配置项和默认children
44
54
  var innerRef = useRef();
45
55
  var quickSearchRef = ref || innerRef;
@@ -293,12 +303,12 @@ var InternalQuickSearch = function InternalQuickSearch(props, ref) {
293
303
  !disabled && setInputFocus();
294
304
  };
295
305
  var renderSelect = function renderSelect() {
296
- return /*#__PURE__*/React.createElement("div", {
306
+ return /*#__PURE__*/React.createElement("div", _extends({
297
307
  className: quickSearchCls,
298
308
  ref: quickSearchRef,
299
309
  style: style,
300
310
  onClick: handleClickInputFosus
301
- }, /*#__PURE__*/React.createElement("span", {
311
+ }, others), /*#__PURE__*/React.createElement("span", {
302
312
  className: classNames(_defineProperty({}, "".concat(quickSearchPrefixCls, "-prefix"), true))
303
313
  }, /*#__PURE__*/React.createElement(Icon, {
304
314
  type: "search"
@@ -83,13 +83,13 @@ var InternalSearch = function InternalSearch(props, ref) {
83
83
  if (!suffix) {
84
84
  return null;
85
85
  }
86
- return !prefix && (typeof suffix === 'boolean' && suffix ? /*#__PURE__*/React.createElement("span", {
86
+ return typeof suffix === 'boolean' && suffix ? /*#__PURE__*/React.createElement("span", {
87
87
  className: "".concat(searchPrefixCls, "-suffix")
88
88
  }, /*#__PURE__*/React.createElement(Icon, {
89
89
  className: "kd-search-prefix",
90
90
  type: "search"
91
- })) : suffix);
92
- }, [suffix, prefix, searchPrefixCls]);
91
+ })) : suffix;
92
+ }, [suffix, searchPrefixCls]);
93
93
  if (type === 'quick-search') {
94
94
  return /*#__PURE__*/React.createElement(QuickSearch, _extends({}, restProps, {
95
95
  ref: ref,
@@ -108,6 +108,9 @@ var InternalSelect = function InternalSelect(props, ref) {
108
108
  _useState12 = _slicedToArray(_useState11, 2),
109
109
  focusd = _useState12[0],
110
110
  setFocusd = _useState12[1];
111
+ var isShowSearch = useMemo(function () {
112
+ return isBoolean(showSearch) ? showSearch : isMultiple;
113
+ }, [isMultiple, showSearch]);
111
114
  var selectPrefixCls = getPrefixCls(prefixCls, 'select', customPrefixcls);
112
115
  // 选择器样式
113
116
  var selectCls = classNames(selectPrefixCls, className, _defineProperty({}, "".concat(selectPrefixCls, "-visible"), optionShow));
@@ -119,7 +122,7 @@ var InternalSelect = function InternalSelect(props, ref) {
119
122
  // 多选底部样式
120
123
  var multipleFooterCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-multiple-footer"), true));
121
124
  // 多选,单选公共样式
122
- var commCls = classNames((_classNames6 = {}, _defineProperty(_classNames6, "".concat(selectPrefixCls, "-bordered"), borderType === 'bordered'), _defineProperty(_classNames6, "".concat(selectPrefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames6, "".concat(selectPrefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames6, _concatInstanceProperty(_context = "".concat(selectPrefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames6, "".concat(selectPrefixCls, "-wrapper"), true), _classNames6));
125
+ var commCls = classNames((_classNames6 = {}, _defineProperty(_classNames6, "".concat(selectPrefixCls, "-bordered"), borderType === 'bordered'), _defineProperty(_classNames6, "".concat(selectPrefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames6, "".concat(selectPrefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames6, _concatInstanceProperty(_context = "".concat(selectPrefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames6, "".concat(selectPrefixCls, "-wrapper"), true), _defineProperty(_classNames6, "".concat(selectPrefixCls, "-show-search"), isShowSearch), _classNames6));
123
126
  useEffect(function () {
124
127
  if (typeof props.visible !== 'undefined') {
125
128
  setOptionShow(props.visible);
@@ -307,7 +310,7 @@ var InternalSelect = function InternalSelect(props, ref) {
307
310
  }
308
311
  } else {
309
312
  props.visible === undefined && setOptionShow(false);
310
- onChange && onChange(labelInValue ? {
313
+ initValue !== key && onChange && onChange(labelInValue ? {
311
314
  value: key,
312
315
  label: label
313
316
  } : key, _extends(_extends({}, optionsObj), {
@@ -323,7 +326,7 @@ var InternalSelect = function InternalSelect(props, ref) {
323
326
  multipleRef.current.selectedVal = key;
324
327
  setInitValue(key);
325
328
  props.visible === undefined && setOptionShow(false);
326
- onChange && onChange(labelInValue ? {
329
+ initValue !== key && onChange && onChange(labelInValue ? {
327
330
  value: key,
328
331
  label: label
329
332
  } : key, _extends(_extends({}, optionsObj), {
@@ -500,9 +503,6 @@ var InternalSelect = function InternalSelect(props, ref) {
500
503
  className: emptyListCls
501
504
  }, emptyContent);
502
505
  };
503
- var isShowSearch = useMemo(function () {
504
- return isBoolean(showSearch) ? showSearch : isMultiple;
505
- }, [isMultiple, showSearch]);
506
506
  useEffect(function () {
507
507
  var _a;
508
508
  if (isShowSearch && autoFocus && !disabled) {
@@ -558,7 +558,7 @@ var InternalSelect = function InternalSelect(props, ref) {
558
558
  className: dropDownCls,
559
559
  style: dropDownStyle,
560
560
  ref: dropDownRef
561
- }, !dropdownRender && childrenToRender.length > 0 && dropRender(eleOptionList, heightStyle), renderNotContent(), /*#__PURE__*/React.createElement("div", null, dropdownRender && dropdownRender(dropRender(childrenToRender, heightStyle))), isMultiple && /*#__PURE__*/React.createElement("div", {
561
+ }, !dropdownRender && childrenToRender.length > 0 && dropRender(eleOptionList, heightStyle), renderNotContent(), /*#__PURE__*/React.createElement("div", null, dropdownRender && dropdownRender(dropRender(childrenToRender, heightStyle))), isMultiple && realChildren.length > 0 && /*#__PURE__*/React.createElement("div", {
562
562
  className: multipleFooterCls
563
563
  }, /*#__PURE__*/React.createElement(Checkbox, {
564
564
  style: checkboxStyle,
@@ -567,7 +567,7 @@ var InternalSelect = function InternalSelect(props, ref) {
567
567
  onChange: handleSelectAll
568
568
  }, "\u5168\u9009"), /*#__PURE__*/React.createElement("span", {
569
569
  className: "".concat(selectPrefixCls, "-multiple-footer-hadSelected")
570
- }, "\u5DF2\u9009", /*#__PURE__*/React.createElement("span", null, isMultiple ? selectedVal.length : 0), "\u9879"))));
570
+ }, "\u5DF2\u9009", /*#__PURE__*/React.createElement("span", null, selectedVal.length), "\u9879"))));
571
571
  };
572
572
  // 处理多选tag
573
573
  var handleMaxTagHolder = useCallback(function () {
@@ -350,6 +350,12 @@
350
350
  overflow-x: hidden;
351
351
  position: relative;
352
352
  }
353
+ .kd-select-show-search {
354
+ cursor: text;
355
+ }
356
+ .kd-select-show-search.kd-select-single .kd-select-selection-search .kd-select-selection-search-input {
357
+ cursor: text;
358
+ }
353
359
  .kd-select-dropdown {
354
360
  display: block;
355
361
  left: 0;
@@ -471,6 +477,7 @@
471
477
  background: transparent;
472
478
  height: 100%;
473
479
  width: 100%;
480
+ cursor: pointer;
474
481
  }
475
482
  .kd-select .kd-select-single .kd-select-selection-item {
476
483
  display: inline-block;
@@ -120,6 +120,16 @@
120
120
  position: relative;
121
121
  }
122
122
 
123
+ &-show-search {
124
+ cursor: text;
125
+
126
+ &.@{select-prefix-cls}-single .@{select-prefix-cls}-selection-search {
127
+ .@{select-prefix-cls}-selection-search-input {
128
+ cursor: text;
129
+ }
130
+ }
131
+ }
132
+
123
133
  &-dropdown {
124
134
  display: block;
125
135
  left: 0;
@@ -232,6 +242,7 @@
232
242
  background: transparent;
233
243
  height: 100%;
234
244
  width: 100%;
245
+ cursor: pointer;
235
246
  }
236
247
  }
237
248
  &-item {
@@ -89,7 +89,7 @@ var ITransferList = function ITransferList(props, ref) {
89
89
  if (filterOption) {
90
90
  return filterOption(filterValue, item);
91
91
  }
92
- return text.indexOf(filterValue) > -1;
92
+ return (text === null || text === void 0 ? void 0 : text.indexOf(filterValue)) > -1;
93
93
  };
94
94
  var renderListBody = function renderListBody(renderList, props) {
95
95
  var bodyContent = renderList ? renderList(props) : null;
package/es/tree/tree.d.ts CHANGED
@@ -41,6 +41,8 @@ export interface TreeProps {
41
41
  expandOnClickNode?: boolean;
42
42
  onlyExpandOnClickIcon?: boolean;
43
43
  showIcon?: boolean;
44
+ style?: React.CSSProperties;
45
+ className?: string;
44
46
  }
45
47
  export declare type TreeNodeData = {
46
48
  checkable?: boolean;
package/es/tree/tree.js CHANGED
@@ -2,10 +2,19 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
3
3
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
4
4
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
5
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
5
6
  import _Set from "@babel/runtime-corejs3/core-js-stable/set";
6
7
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
7
8
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
8
9
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
10
+ var __rest = this && this.__rest || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
13
+ if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
14
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
15
+ }
16
+ return t;
17
+ };
9
18
  import React, { useContext, useCallback, useEffect } from 'react';
10
19
  import classNames from 'classnames';
11
20
  import cloneDeep from 'lodash/cloneDeep';
@@ -61,16 +70,18 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
61
70
  } : _TreeProps$setTreeNod2,
62
71
  innerEstimatedItemSize = TreeProps.estimatedItemSize,
63
72
  style = TreeProps.style,
73
+ className = TreeProps.className,
64
74
  filterTreeNode = TreeProps.filterTreeNode,
65
75
  filterValue = TreeProps.filterValue,
66
76
  expandOnClickNode = TreeProps.expandOnClickNode,
67
77
  _TreeProps$onlyExpand = TreeProps.onlyExpandOnClickIcon,
68
78
  onlyExpandOnClickIcon = _TreeProps$onlyExpand === void 0 ? false : _TreeProps$onlyExpand,
69
79
  loadData = TreeProps.loadData,
70
- notFoundContent = TreeProps.notFoundContent;
80
+ notFoundContent = TreeProps.notFoundContent,
81
+ others = __rest(TreeProps, ["prefixCls", "treeData", "virtual", "showIcon", "switcherIcon", "icon", "checkable", "checkStrictly", "disabled", "draggable", "scrollToKey", "expandedKeys", "checkedKeys", "defaultExpandRoot", "defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys", "defaultCheckedKeys", "defaultSelectedKeys", "height", "onCheck", "onExpand", "onDragStart", "onDragOver", "onDragLeave", "onDragEnter", "onDragEnd", "onDrop", "onSelect", "selectedKeys", "setTreeNodeStyle", "setTreeNodeClassName", "estimatedItemSize", "style", "className", "filterTreeNode", "filterValue", "expandOnClickNode", "onlyExpandOnClickIcon", "loadData", "notFoundContent"]);
71
82
  var treePrefixCls = getPrefixCls(prefixCls, 'tree', customPrefixcls); // 树样式前缀
72
83
  var treeNodePrefixCls = getPrefixCls(prefixCls, 'tree-node', customPrefixcls); // 树节点样式前缀
73
- var treeNodeClassName = classNames(_defineProperty({}, "".concat(treePrefixCls), true));
84
+ var treeNodeClassName = classNames(className, _defineProperty({}, "".concat(treePrefixCls), true));
74
85
  var treeRootClassName = "".concat(treePrefixCls, "-root");
75
86
  var estimatedItemSize = innerEstimatedItemSize; // 节点高度
76
87
  var _React$useMemo = React.useMemo(function () {
@@ -363,12 +374,12 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
363
374
  useEffect(function () {
364
375
  setCheckedKeys(checkedKeys);
365
376
  }, [checkedKeys, setCheckedKeys]);
366
- return /*#__PURE__*/React.createElement("div", {
377
+ return /*#__PURE__*/React.createElement("div", _extends({
367
378
  className: treeNodeClassName,
368
379
  style: style,
369
380
  ref: scrollRef,
370
381
  onScroll: handleScroll
371
- }, /*#__PURE__*/React.createElement("div", {
382
+ }, others), /*#__PURE__*/React.createElement("div", {
372
383
  ref: plantomRef,
373
384
  className: "".concat(treePrefixCls, "-plantom")
374
385
  }), /*#__PURE__*/React.createElement("div", {
@@ -33,7 +33,7 @@ export interface AbstractSelectProps extends PopperProps {
33
33
  maxTagPlaceholder?: React.ReactNode | ((omittedValues: TreeNodeData[]) => React.ReactNode);
34
34
  }
35
35
  export declare type ITreeProps = {
36
- treeData?: TreeNodeData;
36
+ treeData?: TreeNodeData[];
37
37
  treeDefaultExpandAll?: boolean;
38
38
  treeDefaultExpandedKeys?: string[];
39
39
  treeExpandedKeys?: string[];
@@ -44,6 +44,10 @@ export declare type ITreeProps = {
44
44
  treeNodeFilterProp?: string;
45
45
  treeNodeLabelProp?: string;
46
46
  expandOnClickNode?: boolean;
47
+ treeCheckStrictly?: boolean;
48
+ treeExpandOnClickNode?: boolean;
49
+ showTreeIcon?: boolean;
50
+ treeLoadData?: () => void;
47
51
  };
48
52
  export declare type TreeSelectValue = string | string[] | number | number[] | undefined;
49
53
  export interface ITreeSelectProps<T extends TreeSelectValue> extends AbstractSelectProps, ITreeProps {
@@ -51,6 +55,7 @@ export interface ITreeSelectProps<T extends TreeSelectValue> extends AbstractSel
51
55
  defaultValue?: T;
52
56
  mode?: Mode;
53
57
  autoFocus?: boolean;
58
+ onlyExpandOnClickIcon?: boolean;
54
59
  onChange?: (value: T, treeNode: TreeNodeData) => void;
55
60
  onSelect?: (value: T extends (infer I)[] ? I : T, { checked, node, event }: any) => void;
56
61
  onBlur?: (value?: T) => void;
@@ -38,7 +38,7 @@ function flattenTreeData(treeData) {
38
38
  }
39
39
  return key;
40
40
  }
41
- treeData.forEach(function (node) {
41
+ treeData === null || treeData === void 0 ? void 0 : treeData.forEach(function (node) {
42
42
  flatten(node);
43
43
  });
44
44
  return map;
@@ -95,7 +95,8 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
95
95
  onTreeExpand = treeSelectProps.onTreeExpand,
96
96
  onSelect = treeSelectProps.onSelect,
97
97
  onCheck = treeSelectProps.onCheck,
98
- dropdownRender = treeSelectProps.dropdownRender;
98
+ dropdownRender = treeSelectProps.dropdownRender,
99
+ onlyExpandOnClickIcon = treeSelectProps.onlyExpandOnClickIcon;
99
100
  var isMultiple = mode === 'multiple'; // 是否多选
100
101
  var _useMergedState = useMergedState(isMultiple ? [] : undefined, {
101
102
  value: value,
@@ -310,7 +311,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
310
311
  icon: treeIcon,
311
312
  showIcon: showTreeIcon,
312
313
  switcherIcon: switcherIcon,
313
- onlyExpandOnClickIcon: true,
314
+ onlyExpandOnClickIcon: onlyExpandOnClickIcon,
314
315
  notFoundContent: renderNotContent(),
315
316
  filterTreeNode: defFilterTreeNode,
316
317
  onSelect: handleSelect,
@@ -494,7 +495,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
494
495
  }
495
496
  };
496
497
  var popperProps = _extends(_extends({}, treeSelectProps), {
497
- prefixCls: selectPrefixCls,
498
+ prefixCls: "".concat(selectPrefixCls, "-panel"),
498
499
  placement: 'bottomLeft',
499
500
  popperStyle: catchStyle(),
500
501
  defaultVisible: optionShow,
@@ -146,6 +146,7 @@ export interface IFileItem {
146
146
  prefixCls: string;
147
147
  listType: string;
148
148
  disabled: boolean;
149
+ onPreview?: (file: UploadFile) => void;
149
150
  handleReUpload: (file: UploadFile, e: React.MouseEvent) => void;
150
151
  handleRemove: (file: UploadFile, e: React.MouseEvent) => void;
151
152
  }