@kdcloudjs/kdesign 1.7.15 → 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 (54) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/kdesign-complete.less +15 -0
  3. package/dist/kdesign.css +12 -1
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +64 -45
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +2 -2
  8. package/dist/kdesign.min.js +6 -6
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/button/group.d.ts +1 -0
  11. package/es/button/group.js +6 -3
  12. package/es/card/card.d.ts +1 -0
  13. package/es/card/card.js +3 -2
  14. package/es/color-picker/color-picker-panel.js +0 -1
  15. package/es/config-provider/compDefaultProps.d.ts +1 -0
  16. package/es/config-provider/compDefaultProps.js +1 -0
  17. package/es/form/Field.js +1 -1
  18. package/es/input-number/inputNumber.js +1 -1
  19. package/es/locale/locale.d.ts +3 -4
  20. package/es/locale/zh-CN.js +8 -8
  21. package/es/notification/index.js +2 -1
  22. package/es/notification-base/index.js +11 -8
  23. package/es/select/select.js +8 -8
  24. package/es/select/style/index.css +7 -0
  25. package/es/select/style/index.less +11 -0
  26. package/es/tree-select/interface.d.ts +1 -0
  27. package/es/tree-select/tree-select.js +4 -3
  28. package/es/upload/interface.d.ts +1 -0
  29. package/es/upload/style/index.css +4 -0
  30. package/es/upload/style/index.less +4 -0
  31. package/es/upload/upload.js +16 -6
  32. package/lib/button/group.d.ts +1 -0
  33. package/lib/button/group.js +6 -3
  34. package/lib/card/card.d.ts +1 -0
  35. package/lib/card/card.js +3 -2
  36. package/lib/color-picker/color-picker-panel.js +0 -1
  37. package/lib/config-provider/compDefaultProps.d.ts +1 -0
  38. package/lib/config-provider/compDefaultProps.js +1 -0
  39. package/lib/form/Field.js +1 -1
  40. package/lib/input-number/inputNumber.js +1 -1
  41. package/lib/locale/locale.d.ts +3 -4
  42. package/lib/locale/zh-CN.js +8 -8
  43. package/lib/notification/index.js +2 -1
  44. package/lib/notification-base/index.js +11 -8
  45. package/lib/select/select.js +8 -8
  46. package/lib/select/style/index.css +7 -0
  47. package/lib/select/style/index.less +11 -0
  48. package/lib/tree-select/interface.d.ts +1 -0
  49. package/lib/tree-select/tree-select.js +4 -3
  50. package/lib/upload/interface.d.ts +1 -0
  51. package/lib/upload/style/index.css +4 -0
  52. package/lib/upload/style/index.less +4 -0
  53. package/lib/upload/upload.js +16 -6
  54. package/package.json +1 -1
@@ -19,6 +19,7 @@ export interface ButtonGroupProps extends PopperProps {
19
19
  type?: ButtonGroupType;
20
20
  onClick?: () => void;
21
21
  onItemClick?: (data: OverlayType) => void;
22
+ loading?: boolean;
22
23
  }
23
24
  declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
24
25
  export default ButtonGroup;
@@ -31,7 +31,8 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
31
31
  size = buttonGoupProps.size,
32
32
  buttonType = buttonGoupProps.buttonType,
33
33
  disabled = buttonGoupProps.disabled,
34
- onVisibleChange = buttonGoupProps.onVisibleChange;
34
+ onVisibleChange = buttonGoupProps.onVisibleChange,
35
+ loading = buttonGoupProps.loading;
35
36
  var _useState = useState(false),
36
37
  _useState2 = _slicedToArray(_useState, 2),
37
38
  optionShow = _useState2[0],
@@ -59,14 +60,16 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
59
60
  }, isBsicType && /*#__PURE__*/React.createElement(Button, {
60
61
  type: buttonType,
61
62
  size: size,
62
- disabled: disabled
63
+ disabled: disabled,
64
+ loading: loading
63
65
  }, children, /*#__PURE__*/React.createElement("span", {
64
66
  className: "".concat(btnGroupPrefixCls, "-basic-icon")
65
67
  }, optionShow ? iconUp : iconDown)), !isBsicType && /*#__PURE__*/React.createElement(Button, {
66
68
  type: buttonType,
67
69
  size: size,
68
70
  disabled: disabled,
69
- onClick: onClick
71
+ onClick: onClick,
72
+ loading: loading
70
73
  }, children), !isBsicType && /*#__PURE__*/React.createElement("span", {
71
74
  className: "".concat(btnGroupPrefixCls, "-trigger"),
72
75
  ref: triggerRef
package/es/card/card.d.ts CHANGED
@@ -20,6 +20,7 @@ export interface CardProps {
20
20
  bodyStyle?: React.CSSProperties;
21
21
  actions?: Array<React.ReactNode>;
22
22
  extra?: Array<React.ReactNode>;
23
+ ref?: React.ForwardedRef<HTMLDivElement>;
23
24
  }
24
25
  declare const Card: React.FC<CardProps>;
25
26
  export default Card;
package/es/card/card.js CHANGED
@@ -4,7 +4,7 @@ import classNames from 'classnames';
4
4
  import Checkbox from '../checkbox';
5
5
  import { getCompProps } from '../_utils';
6
6
  import { ConfigContext } from '../config-provider';
7
- var Card = function Card(props) {
7
+ var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
8
8
  var _React$useContext = React.useContext(ConfigContext),
9
9
  getPrefixCls = _React$useContext.getPrefixCls,
10
10
  pkgPrefixCls = _React$useContext.prefixCls,
@@ -31,6 +31,7 @@ var Card = function Card(props) {
31
31
  hoverable: hoverable
32
32
  }, className);
33
33
  return /*#__PURE__*/React.createElement("div", {
34
+ ref: ref,
34
35
  className: cardClassName,
35
36
  style: style
36
37
  }, title && !avatar && /*#__PURE__*/React.createElement("header", {
@@ -58,6 +59,6 @@ var Card = function Card(props) {
58
59
  }, actions), extra && /*#__PURE__*/React.createElement("div", {
59
60
  className: "".concat(prefixCls, "-extra")
60
61
  }, extra));
61
- };
62
+ });
62
63
  Card.displayName = 'Card';
63
64
  export default Card;
@@ -193,7 +193,6 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
193
193
  value: correctColorValue,
194
194
  placeholder: "#",
195
195
  onChange: handleTypeChange,
196
- showSearch: true,
197
196
  optionLabelProp: "value",
198
197
  getPopupContainer: function getPopupContainer() {
199
198
  return panelInputRef.current;
@@ -442,6 +442,7 @@ declare const compDefaultProps: {
442
442
  optionLabelProp: string;
443
443
  treeNodeFilterProp: string;
444
444
  treeExpandOnClickNode: boolean;
445
+ onlyExpandOnClickIcon: boolean;
445
446
  showSearch: boolean;
446
447
  switcherIcon: () => JSX.Element;
447
448
  expandOnClickNode: boolean;
@@ -456,6 +456,7 @@ var compDefaultProps = {
456
456
  optionLabelProp: 'title',
457
457
  treeNodeFilterProp: 'title',
458
458
  treeExpandOnClickNode: true,
459
+ onlyExpandOnClickIcon: true,
459
460
  showSearch: true,
460
461
  switcherIcon: function switcherIcon() {
461
462
  return /*#__PURE__*/React.createElement(Icon, {
package/es/form/Field.js CHANGED
@@ -196,7 +196,7 @@ var Field = function Field(props) {
196
196
  var inputValue;
197
197
  if (innerDisplayName === 'RadioGroup' && payload) {
198
198
  inputValue = payload[1];
199
- } else if (Object.prototype.hasOwnProperty.call(evt, 'target') && _includesInstanceProperty(FormEventValuePropNames).call(FormEventValuePropNames, innerValuePropName)) {
199
+ } else if (evt && Object.prototype.hasOwnProperty.call(evt, 'target') && _includesInstanceProperty(FormEventValuePropNames).call(FormEventValuePropNames, innerValuePropName)) {
200
200
  inputValue = (_a = evt.target) === null || _a === void 0 ? void 0 : _a[innerValuePropName];
201
201
  } else {
202
202
  inputValue = evt;
@@ -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': '智能搜索',
@@ -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
  });
@@ -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 {
@@ -55,6 +55,7 @@ export interface ITreeSelectProps<T extends TreeSelectValue> extends AbstractSel
55
55
  defaultValue?: T;
56
56
  mode?: Mode;
57
57
  autoFocus?: boolean;
58
+ onlyExpandOnClickIcon?: boolean;
58
59
  onChange?: (value: T, treeNode: TreeNodeData) => void;
59
60
  onSelect?: (value: T extends (infer I)[] ? I : T, { checked, node, event }: any) => void;
60
61
  onBlur?: (value?: T) => void;
@@ -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
  }
@@ -217,6 +217,10 @@
217
217
  .kd-upload .kd-upload-text-list-item-icon > i {
218
218
  font-size: var(--kd-c-upload-font-size, var(--kd-g-font-size-middle, 14px));
219
219
  }
220
+ .kd-upload .kd-upload-text-list-item-name,
221
+ .kd-upload .kd-upload-text-list-item-icon {
222
+ cursor: pointer;
223
+ }
220
224
  .kd-upload .kd-upload-text-list-item-name {
221
225
  display: inline-block;
222
226
  margin: 0 var(--kd-c-upload-text-list-item-name-padding-right, 8px) 0 var(--kd-c-upload-text-list-item-name-padding-left, 4px);
@@ -94,6 +94,10 @@
94
94
  font-size: @upload-font-size;
95
95
  }
96
96
 
97
+ &-name,&-icon {
98
+ cursor: pointer;
99
+ }
100
+
97
101
  &-name {
98
102
  display: inline-block;
99
103
  margin: 0 @upload-text-list-item-name-padding-right 0 @upload-text-list-item-name-padding-left;
@@ -92,7 +92,8 @@ var InternalUpload = function InternalUpload(props, ref) {
92
92
  className = allProps.className,
93
93
  itemRender = allProps.itemRender,
94
94
  showUploadList = allProps.showUploadList,
95
- customPrefixcls = allProps.prefixCls;
95
+ customPrefixcls = allProps.prefixCls,
96
+ onPreview = allProps.onPreview;
96
97
  var _React$useState = React.useState(props.fileList || props.defaultFileList || []),
97
98
  _React$useState2 = _slicedToArray(_React$useState, 2),
98
99
  fileList = _React$useState2[0],
@@ -399,7 +400,8 @@ var InternalUpload = function InternalUpload(props, ref) {
399
400
  listType: listType,
400
401
  handleReUpload: handleReUpload,
401
402
  handleRemove: handleRemove,
402
- disabled: disabled
403
+ disabled: disabled,
404
+ onPreview: onPreview
403
405
  })), file, setFileList) : /*#__PURE__*/React.createElement(Item, _extends({
404
406
  key: file.uid
405
407
  }, {
@@ -408,7 +410,8 @@ var InternalUpload = function InternalUpload(props, ref) {
408
410
  listType: listType,
409
411
  handleReUpload: handleReUpload,
410
412
  handleRemove: handleRemove,
411
- disabled: disabled
413
+ disabled: disabled,
414
+ onPreview: onPreview
412
415
  }));
413
416
  })));
414
417
  };
@@ -419,7 +422,8 @@ var Item = function Item(_ref3) {
419
422
  listType = _ref3.listType,
420
423
  handleReUpload = _ref3.handleReUpload,
421
424
  handleRemove = _ref3.handleRemove,
422
- disabled = _ref3.disabled;
425
+ disabled = _ref3.disabled,
426
+ onPreview = _ref3.onPreview;
423
427
  var mapStatus = {
424
428
  uploading: 'loadding',
425
429
  error: 'warning-solid',
@@ -427,18 +431,23 @@ var Item = function Item(_ref3) {
427
431
  success: 'attachment',
428
432
  notStart: 'attachment'
429
433
  };
434
+ var handlePreview = function handlePreview() {
435
+ onPreview && onPreview(file);
436
+ };
430
437
  return /*#__PURE__*/React.createElement("li", {
431
438
  className: classNames(_concatInstanceProperty(_context8 = "".concat(prefixCls, "-")).call(_context8, listType, "-list-item"), {
432
439
  error: file.status === 'error'
433
440
  })
434
441
  }, listType === 'text' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
435
- className: _concatInstanceProperty(_context9 = "".concat(prefixCls, "-")).call(_context9, listType, "-list-item-icon")
442
+ className: _concatInstanceProperty(_context9 = "".concat(prefixCls, "-")).call(_context9, listType, "-list-item-icon"),
443
+ onClick: handlePreview
436
444
  }, /*#__PURE__*/React.createElement(Icon, {
437
445
  spin: file.status === 'uploading',
438
446
  type: mapStatus[file.status]
439
447
  })), /*#__PURE__*/React.createElement("span", {
440
448
  className: _concatInstanceProperty(_context10 = "".concat(prefixCls, "-")).call(_context10, listType, "-list-item-name"),
441
- title: file.name
449
+ title: file.name,
450
+ onClick: handlePreview
442
451
  }, file.name), /*#__PURE__*/React.createElement("span", {
443
452
  className: _concatInstanceProperty(_context11 = "".concat(prefixCls, "-")).call(_context11, listType, "-list-item-size")
444
453
  }, "(", getFileSize(file.size), ")"), /*#__PURE__*/React.createElement("div", {
@@ -477,6 +486,7 @@ var Item = function Item(_ref3) {
477
486
  className: _concatInstanceProperty(_context20 = "".concat(prefixCls, "-")).call(_context20, listType, "-list-item-delete"),
478
487
  onClick: handleRemove.bind(_this, file)
479
488
  }, "\u5220\u9664"))) : /*#__PURE__*/React.createElement(Image, {
489
+ onClick: handlePreview,
480
490
  previewType: "upload",
481
491
  name: file.name,
482
492
  size: getFileSize(file.size),
@@ -19,6 +19,7 @@ export interface ButtonGroupProps extends PopperProps {
19
19
  type?: ButtonGroupType;
20
20
  onClick?: () => void;
21
21
  onItemClick?: (data: OverlayType) => void;
22
+ loading?: boolean;
22
23
  }
23
24
  declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
24
25
  export default ButtonGroup;
@@ -44,7 +44,8 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
44
44
  size = buttonGoupProps.size,
45
45
  buttonType = buttonGoupProps.buttonType,
46
46
  disabled = buttonGoupProps.disabled,
47
- onVisibleChange = buttonGoupProps.onVisibleChange;
47
+ onVisibleChange = buttonGoupProps.onVisibleChange,
48
+ loading = buttonGoupProps.loading;
48
49
  var _useState = (0, _react.useState)(false),
49
50
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
50
51
  optionShow = _useState2[0],
@@ -72,14 +73,16 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
72
73
  }, isBsicType && /*#__PURE__*/_react.default.createElement(_index.Button, {
73
74
  type: buttonType,
74
75
  size: size,
75
- disabled: disabled
76
+ disabled: disabled,
77
+ loading: loading
76
78
  }, children, /*#__PURE__*/_react.default.createElement("span", {
77
79
  className: "".concat(btnGroupPrefixCls, "-basic-icon")
78
80
  }, optionShow ? iconUp : iconDown)), !isBsicType && /*#__PURE__*/_react.default.createElement(_index.Button, {
79
81
  type: buttonType,
80
82
  size: size,
81
83
  disabled: disabled,
82
- onClick: onClick
84
+ onClick: onClick,
85
+ loading: loading
83
86
  }, children), !isBsicType && /*#__PURE__*/_react.default.createElement("span", {
84
87
  className: "".concat(btnGroupPrefixCls, "-trigger"),
85
88
  ref: triggerRef
@@ -20,6 +20,7 @@ export interface CardProps {
20
20
  bodyStyle?: React.CSSProperties;
21
21
  actions?: Array<React.ReactNode>;
22
22
  extra?: Array<React.ReactNode>;
23
+ ref?: React.ForwardedRef<HTMLDivElement>;
23
24
  }
24
25
  declare const Card: React.FC<CardProps>;
25
26
  export default Card;
package/lib/card/card.js CHANGED
@@ -16,7 +16,7 @@ var _utils = require("../_utils");
16
16
  var _configProvider = require("../config-provider");
17
17
  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); }
18
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
- var Card = function Card(props) {
19
+ var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
20
20
  var _React$useContext = React.useContext(_configProvider.ConfigContext),
21
21
  getPrefixCls = _React$useContext.getPrefixCls,
22
22
  pkgPrefixCls = _React$useContext.prefixCls,
@@ -43,6 +43,7 @@ var Card = function Card(props) {
43
43
  hoverable: hoverable
44
44
  }, className);
45
45
  return /*#__PURE__*/React.createElement("div", {
46
+ ref: ref,
46
47
  className: cardClassName,
47
48
  style: style
48
49
  }, title && !avatar && /*#__PURE__*/React.createElement("header", {
@@ -70,7 +71,7 @@ var Card = function Card(props) {
70
71
  }, actions), extra && /*#__PURE__*/React.createElement("div", {
71
72
  className: "".concat(prefixCls, "-extra")
72
73
  }, extra));
73
- };
74
+ });
74
75
  Card.displayName = 'Card';
75
76
  var _default = Card;
76
77
  exports.default = _default;
@@ -206,7 +206,6 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
206
206
  value: correctColorValue,
207
207
  placeholder: "#",
208
208
  onChange: handleTypeChange,
209
- showSearch: true,
210
209
  optionLabelProp: "value",
211
210
  getPopupContainer: function getPopupContainer() {
212
211
  return panelInputRef.current;
@@ -442,6 +442,7 @@ declare const compDefaultProps: {
442
442
  optionLabelProp: string;
443
443
  treeNodeFilterProp: string;
444
444
  treeExpandOnClickNode: boolean;
445
+ onlyExpandOnClickIcon: boolean;
445
446
  showSearch: boolean;
446
447
  switcherIcon: () => JSX.Element;
447
448
  expandOnClickNode: boolean;
@@ -467,6 +467,7 @@ var compDefaultProps = {
467
467
  optionLabelProp: 'title',
468
468
  treeNodeFilterProp: 'title',
469
469
  treeExpandOnClickNode: true,
470
+ onlyExpandOnClickIcon: true,
470
471
  showSearch: true,
471
472
  switcherIcon: function switcherIcon() {
472
473
  return /*#__PURE__*/React.createElement(_index.Icon, {
package/lib/form/Field.js CHANGED
@@ -209,7 +209,7 @@ var Field = function Field(props) {
209
209
  var inputValue;
210
210
  if (innerDisplayName === 'RadioGroup' && payload) {
211
211
  inputValue = payload[1];
212
- } else if (Object.prototype.hasOwnProperty.call(evt, 'target') && (0, _includes.default)(FormEventValuePropNames).call(FormEventValuePropNames, innerValuePropName)) {
212
+ } else if (evt && Object.prototype.hasOwnProperty.call(evt, 'target') && (0, _includes.default)(FormEventValuePropNames).call(FormEventValuePropNames, innerValuePropName)) {
213
213
  inputValue = (_a = evt.target) === null || _a === void 0 ? void 0 : _a[innerValuePropName];
214
214
  } else {
215
215
  inputValue = evt;
@@ -84,7 +84,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
84
84
  return true;
85
85
  };
86
86
  (0, _react.useEffect)(function () {
87
- setInputValue(value);
87
+ setInputValue((0, _numberUtil.serialization)(value + ''));
88
88
  }, [value]);
89
89
  var handleEventAttachValue = function handleEventAttachValue(event, value) {
90
90
  return (0, _extends2.default)({}, 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[];
@@ -21,15 +21,15 @@ var locale = (0, _extends2.default)((0, _extends2.default)({
21
21
  'Progress.success': '加载成功',
22
22
  'Pagination.prevPage': '上一页',
23
23
  'Pagination.nextPage': '下一页',
24
- 'Pagination.total': '共{page}页{row}条',
25
- 'Pagination.page': '共{page}页',
26
- 'Pagination.row': '共{row}条',
24
+ 'Pagination.total': '共 {page} {row}条',
25
+ 'Pagination.page': '共 {page} 页',
26
+ 'Pagination.row': '共 {row} 条',
27
27
  'Pagination.first': '第一页',
28
28
  'Pagination.last': '最后一页',
29
- 'Pagination.perPage': '{size}条/页',
30
- 'Pagination.order': '第{order}页',
31
- 'Pagination.forward': '向前5页',
32
- 'Pagination.backward': '向后5页',
29
+ 'Pagination.perPage': '{size} 条/页',
30
+ 'Pagination.order': '第 {order} 页',
31
+ 'Pagination.forward': '向前 5 页',
32
+ 'Pagination.backward': '向后 5 页',
33
33
  'Transfer.selectAll': '全选',
34
34
  'Transfer.searchPlaceholder': ['请输入需要搜索的内容', '请输入需要搜索的内容'],
35
35
  'Transfer.leftTitle': '可选列表',
@@ -49,7 +49,7 @@ var locale = (0, _extends2.default)((0, _extends2.default)({
49
49
  'CityPicker.internation': '国际',
50
50
  'CityPicker.common': '常用',
51
51
  'CityPicker.noData': '暂无数据',
52
- 'ColorPicker.followFunctionalColor': '跟随主题色',
52
+ 'ColorPicker.followFunctionalColor': '跟随功能色',
53
53
  'Search.placeholder': '请输入需要搜索的内容',
54
54
  'Search.desc': ['空格代表"或",回车代表"且"'],
55
55
  'Search.nplDesc': '智能搜索',