@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
@@ -12,6 +12,7 @@ export interface IAlertProps {
12
12
  closeNode?: ReactNode;
13
13
  delayOffTime?: number;
14
14
  className?: string;
15
+ style?: Record<string, unknown>;
15
16
  prefixCls?: string;
16
17
  onClose?: () => void;
17
18
  extra?: ReactNode;
package/es/alert/alert.js CHANGED
@@ -1,11 +1,20 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
4
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
4
5
  import _Map from "@babel/runtime-corejs3/core-js-stable/map";
5
6
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
6
7
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
7
8
  import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
8
9
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
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, useEffect, useState, useRef, useCallback } from 'react';
10
19
  import { Icon } from '../index';
11
20
  import ReactDOM from 'react-dom';
@@ -57,6 +66,7 @@ var Alert = function Alert(props) {
57
66
  showIcon = alertProps.showIcon,
58
67
  icon = alertProps.icon,
59
68
  className = alertProps.className,
69
+ style = alertProps.style,
60
70
  customPrefixcls = alertProps.prefixCls,
61
71
  closable = alertProps.closable,
62
72
  closeNode = alertProps.closeNode,
@@ -64,7 +74,8 @@ var Alert = function Alert(props) {
64
74
  onClose = alertProps.onClose,
65
75
  extra = alertProps.extra,
66
76
  banner = alertProps.banner,
67
- bannerOffset = alertProps.bannerOffset;
77
+ bannerOffset = alertProps.bannerOffset,
78
+ othersProps = __rest(alertProps, ["type", "message", "showIcon", "icon", "className", "style", "prefixCls", "closable", "closeNode", "delayOffTime", "onClose", "extra", "banner", "bannerOffset"]);
68
79
  devWarning(AlertTypes.indexOf(type) === -1, 'alert', "cannot found alert type '".concat(type, "'"));
69
80
  var _useState = useState(true),
70
81
  _useState2 = _slicedToArray(_useState, 2),
@@ -159,8 +170,9 @@ var Alert = function Alert(props) {
159
170
  var AlertComp = /*#__PURE__*/React.createElement("div", _extends({
160
171
  className: classNames(alertClasses, getAlertColorType('bg'), getAlertColorType('border'))
161
172
  }, events, {
162
- ref: alertRef
163
- }), showIcon && iconNode, /*#__PURE__*/React.createElement("div", {
173
+ ref: alertRef,
174
+ style: style
175
+ }, othersProps), showIcon && iconNode, /*#__PURE__*/React.createElement("div", {
164
176
  className: classNames((_classNames2 = {}, _defineProperty(_classNames2, "".concat(alertPrefixCls, "-message"), true), _defineProperty(_classNames2, "".concat(alertPrefixCls, "-without-icon-message"), !showIcon), _classNames2))
165
177
  }, message), extra, closable && type !== 'success' && /*#__PURE__*/React.createElement("div", {
166
178
  className: "".concat(alertPrefixCls, "-close-icon"),
@@ -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;
@@ -39,6 +39,8 @@ export interface CascaderProps extends PopperProps {
39
39
  changeOnSelect?: boolean;
40
40
  notFoundContent?: string;
41
41
  value?: CascaderValueType;
42
+ maxTagCount?: number;
43
+ maxTagPlaceholder?: React.ReactNode | ((omittedValues: number) => string);
42
44
  children?: React.ReactNode;
43
45
  mode?: 'single' | 'multiple';
44
46
  style?: React.CSSProperties;
@@ -2,11 +2,20 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
3
3
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
4
4
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
5
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
5
6
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
6
7
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
7
8
  import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
8
9
  import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/splice";
9
10
  import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
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, { useMemo, useCallback } from 'react';
11
20
  import classNames from 'classnames';
12
21
  import { tuple } from '../_utils/type';
@@ -49,7 +58,10 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
49
58
  defaultPopupVisible = allProps.defaultPopupVisible,
50
59
  onPopupVisibleChange = allProps.onPopupVisibleChange,
51
60
  onPopperVisibleChange = allProps.onPopperVisibleChange,
52
- customPrefixcls = allProps.prefixCls;
61
+ customPrefixcls = allProps.prefixCls,
62
+ otherProps = __rest(allProps
63
+ // className前缀
64
+ , ["mode", "style", "options", "bordered", "disabled", "children", "loadData", "clearIcon", "className", "fieldNames", "placeholder", "defaultValue", "maxTagPlaceholder", "displayRender", "expandTrigger", "changeOnSelect", "dropdownRender", "notFoundContent", "getPopupContainer", "defaultPopupVisible", "onPopupVisibleChange", "onPopperVisibleChange", "prefixCls"]);
53
65
  // className前缀
54
66
  var prefixCls = getPrefixCls(pkgPrefixCls, 'cascader', customPrefixcls);
55
67
  var pickerRef = React.useRef();
@@ -258,11 +270,11 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
258
270
  margin: '2px 8px 2px 0',
259
271
  maxWidth: '100%'
260
272
  };
261
- return /*#__PURE__*/React.createElement("div", {
273
+ return /*#__PURE__*/React.createElement("div", _extends({
262
274
  className: multipleCls,
263
275
  ref: triggerRef,
264
276
  style: style
265
- }, /*#__PURE__*/React.createElement("div", {
277
+ }, otherProps), /*#__PURE__*/React.createElement("div", {
266
278
  className: "".concat(prefixCls, "-multiple-wrapper"),
267
279
  ref: wrapperRef
268
280
  }, Array.isArray(currentOptions) && /*#__PURE__*/React.createElement(React.Fragment, null, _mapInstanceProperty(currentOptions).call(currentOptions, function (option, index) {
@@ -290,7 +302,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
290
302
  var renderSingle = function renderSingle() {
291
303
  return /*#__PURE__*/React.createElement("span", _extends({}, locatorProps, {
292
304
  ref: mergeRef
293
- }), React.Children.count(children) === 1 && children.type ? /*#__PURE__*/React.cloneElement(children, {
305
+ }, otherProps), React.Children.count(children) === 1 && children.type ? /*#__PURE__*/React.cloneElement(children, {
294
306
  ref: triggerRef
295
307
  }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
296
308
  ref: triggerRef
@@ -20,7 +20,7 @@ import isBoolean from 'lodash/isBoolean';
20
20
  import Icon from '../icon';
21
21
  import devWarning from '../_utils/devwarning';
22
22
  var InternalCheckbox = function InternalCheckbox(props, ref) {
23
- var _context, _context2, _context3, _classNames, _context4, _context5, _context6, _classNames2, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _classNames4, _context15, _context16, _context17, _classNames5, _context18;
23
+ var _context, _context2, _context3, _classNames, _context4, _context5, _context6, _context7, _classNames2, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _classNames4, _context16, _context17, _context18, _classNames5, _context19;
24
24
  var _useContext = useContext(ConfigContext),
25
25
  getPrefixCls = _useContext.getPrefixCls,
26
26
  prefixCls = _useContext.prefixCls,
@@ -44,6 +44,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
44
44
  var mergedDisabled = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled;
45
45
  var mergedCheckboxType = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.checkboxType) || checkboxType;
46
46
  var mergedName = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.name) || name;
47
+ var mergedSize = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.size) || size;
47
48
  var initChecked = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.groupValue) ? (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.groupValue.indexOf(value)) > -1 : isBoolean(checked) ? checked : defaultChecked;
48
49
  var _useState = useState(initChecked),
49
50
  _useState2 = _slicedToArray(_useState, 2),
@@ -54,7 +55,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
54
55
  setSelected((checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.groupValue) ? (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.groupValue.indexOf(value)) > -1 : isBoolean(checked) ? checked : defaultChecked);
55
56
  }, [checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.groupValue, checked, defaultChecked]);
56
57
  devWarning(CheckboxTypes.indexOf(mergedCheckboxType) === -1, 'checkbox', "cannot found checkbox type '".concat(mergedCheckboxType, "'"));
57
- devWarning(CheckboxSizes.indexOf(size) === -1, 'checkbox', "cannot found size type '".concat(size, "'"));
58
+ devWarning(CheckboxSizes.indexOf(mergedSize) === -1, 'checkbox', "cannot found size type '".concat(mergedSize, "'"));
58
59
  var checkboxPrefixCls = getPrefixCls(prefixCls, 'checkbox', customPrefixcls);
59
60
  var isDefaultType = function isDefaultType() {
60
61
  return mergedCheckboxType === 'default';
@@ -62,13 +63,13 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
62
63
  var getIndeterminate = function getIndeterminate() {
63
64
  return selected ? false : indeterminate;
64
65
  };
65
- var getDefaultClassName = classNames(className, (_classNames = {}, _defineProperty(_classNames, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames, "".concat(checkboxPrefixCls, "-no-child"), !children), _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(checkboxPrefixCls, "-")).call(_context, size), true && !!children), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(checkboxPrefixCls, "-")).call(_context2, mergedCheckboxType), true), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(checkboxPrefixCls, "-")).call(_context3, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames, "checked", selected), _classNames));
66
- var getSquareClassName = classNames(className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames2, _concatInstanceProperty(_context4 = "".concat(checkboxPrefixCls, "-")).call(_context4, mergedCheckboxType), true), _defineProperty(_classNames2, _concatInstanceProperty(_context5 = "".concat(checkboxPrefixCls, "-")).call(_context5, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames2, _concatInstanceProperty(_context6 = "".concat(checkboxPrefixCls, "-")).call(_context6, mergedCheckboxType, "-checked"), selected && !mergedDisabled), _defineProperty(_classNames2, "checked", selected), _classNames2));
66
+ var getDefaultClassName = classNames(className, (_classNames = {}, _defineProperty(_classNames, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames, "".concat(checkboxPrefixCls, "-no-child"), !children), _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(checkboxPrefixCls, "-")).call(_context, mergedSize), true && !!children), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(checkboxPrefixCls, "-")).call(_context2, mergedCheckboxType), true), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(checkboxPrefixCls, "-")).call(_context3, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames, "checked", selected), _classNames));
67
+ var getSquareClassName = classNames(className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames2, _concatInstanceProperty(_context4 = "".concat(checkboxPrefixCls, "-")).call(_context4, mergedCheckboxType), true), _defineProperty(_classNames2, _concatInstanceProperty(_context5 = "".concat(checkboxPrefixCls, "-")).call(_context5, mergedSize), true && !!children), _defineProperty(_classNames2, _concatInstanceProperty(_context6 = "".concat(checkboxPrefixCls, "-")).call(_context6, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames2, _concatInstanceProperty(_context7 = "".concat(checkboxPrefixCls, "-")).call(_context7, mergedCheckboxType, "-checked"), selected && !mergedDisabled), _defineProperty(_classNames2, "checked", selected), _classNames2));
67
68
  var getRootClassName = isDefaultType() ? getDefaultClassName : getSquareClassName;
68
69
  var inputClassName = classNames(_defineProperty({}, "".concat(checkboxPrefixCls, "-input"), true));
69
- var checkedWrapperClassName = classNames((_classNames4 = {}, _defineProperty(_classNames4, _concatInstanceProperty(_context7 = "".concat(checkboxPrefixCls, "-")).call(_context7, mergedCheckboxType, "-no-child"), !children), _defineProperty(_classNames4, _concatInstanceProperty(_context8 = "".concat(checkboxPrefixCls, "-")).call(_context8, mergedCheckboxType, "-wrapper"), true), _defineProperty(_classNames4, _concatInstanceProperty(_context9 = "".concat(checkboxPrefixCls, "-")).call(_context9, mergedCheckboxType, "-wrapper-size"), !!children), _defineProperty(_classNames4, _concatInstanceProperty(_context10 = "".concat(checkboxPrefixCls, "-")).call(_context10, mergedCheckboxType, "-margin"), !!children), _defineProperty(_classNames4, _concatInstanceProperty(_context11 = "".concat(checkboxPrefixCls, "-")).call(_context11, mergedCheckboxType, "-checked"), selected), _defineProperty(_classNames4, _concatInstanceProperty(_context12 = "".concat(checkboxPrefixCls, "-")).call(_context12, mergedCheckboxType, "-indeterminate"), getIndeterminate()), _defineProperty(_classNames4, _concatInstanceProperty(_context13 = "".concat(checkboxPrefixCls, "-")).call(_context13, mergedCheckboxType, "-disabled"), mergedDisabled && !selected), _defineProperty(_classNames4, _concatInstanceProperty(_context14 = "".concat(checkboxPrefixCls, "-")).call(_context14, mergedCheckboxType, "-checked-disabled"), mergedDisabled && selected), _classNames4));
70
- var triangleClassName = classNames((_classNames5 = {}, _defineProperty(_classNames5, _concatInstanceProperty(_context15 = "".concat(checkboxPrefixCls, "-")).call(_context15, mergedCheckboxType, "-triangle"), !selected), _defineProperty(_classNames5, _concatInstanceProperty(_context16 = "".concat(checkboxPrefixCls, "-")).call(_context16, mergedCheckboxType, "-triangle-checked"), selected), _defineProperty(_classNames5, _concatInstanceProperty(_context17 = "".concat(checkboxPrefixCls, "-")).call(_context17, mergedCheckboxType, "-triangle-disabled"), mergedDisabled), _classNames5));
71
- var innerIconClassName = classNames(_defineProperty({}, _concatInstanceProperty(_context18 = "".concat(checkboxPrefixCls, "-")).call(_context18, mergedCheckboxType, "-inner"), true));
70
+ var checkedWrapperClassName = classNames((_classNames4 = {}, _defineProperty(_classNames4, _concatInstanceProperty(_context8 = "".concat(checkboxPrefixCls, "-")).call(_context8, mergedCheckboxType, "-no-child"), !children), _defineProperty(_classNames4, _concatInstanceProperty(_context9 = "".concat(checkboxPrefixCls, "-")).call(_context9, mergedCheckboxType, "-wrapper"), true), _defineProperty(_classNames4, _concatInstanceProperty(_context10 = "".concat(checkboxPrefixCls, "-")).call(_context10, mergedCheckboxType, "-wrapper-size"), !!children), _defineProperty(_classNames4, _concatInstanceProperty(_context11 = "".concat(checkboxPrefixCls, "-")).call(_context11, mergedCheckboxType, "-margin"), !!children), _defineProperty(_classNames4, _concatInstanceProperty(_context12 = "".concat(checkboxPrefixCls, "-")).call(_context12, mergedCheckboxType, "-checked"), selected), _defineProperty(_classNames4, _concatInstanceProperty(_context13 = "".concat(checkboxPrefixCls, "-")).call(_context13, mergedCheckboxType, "-indeterminate"), getIndeterminate()), _defineProperty(_classNames4, _concatInstanceProperty(_context14 = "".concat(checkboxPrefixCls, "-")).call(_context14, mergedCheckboxType, "-disabled"), mergedDisabled && !selected), _defineProperty(_classNames4, _concatInstanceProperty(_context15 = "".concat(checkboxPrefixCls, "-")).call(_context15, mergedCheckboxType, "-checked-disabled"), mergedDisabled && selected), _classNames4));
71
+ var triangleClassName = classNames((_classNames5 = {}, _defineProperty(_classNames5, _concatInstanceProperty(_context16 = "".concat(checkboxPrefixCls, "-")).call(_context16, mergedCheckboxType, "-triangle"), !selected), _defineProperty(_classNames5, _concatInstanceProperty(_context17 = "".concat(checkboxPrefixCls, "-")).call(_context17, mergedCheckboxType, "-triangle-checked"), selected), _defineProperty(_classNames5, _concatInstanceProperty(_context18 = "".concat(checkboxPrefixCls, "-")).call(_context18, mergedCheckboxType, "-triangle-disabled"), mergedDisabled), _classNames5));
72
+ var innerIconClassName = classNames(_defineProperty({}, _concatInstanceProperty(_context19 = "".concat(checkboxPrefixCls, "-")).call(_context19, mergedCheckboxType, "-inner"), true));
72
73
  var handleChange = useCallback(function (e) {
73
74
  onChange && onChange(e);
74
75
  (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange) && (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange(value, e.target.checked, e));
@@ -95,7 +96,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
95
96
  };
96
97
  }, []);
97
98
  var getDefaultCheckbox = function getDefaultCheckbox() {
98
- var _context19, _context20;
99
+ var _context20, _context21;
99
100
  return (
100
101
  /*#__PURE__*/
101
102
  // eslint-disable-next-line
@@ -109,7 +110,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
109
110
  className: innerIconClassName
110
111
  }, /*#__PURE__*/React.createElement(Icon, {
111
112
  type: "right-bold",
112
- className: _concatInstanceProperty(_context19 = "".concat(checkboxPrefixCls, "-")).call(_context19, mergedCheckboxType, "-inner-icon")
113
+ className: _concatInstanceProperty(_context20 = "".concat(checkboxPrefixCls, "-")).call(_context20, mergedCheckboxType, "-inner-icon")
113
114
  })), /*#__PURE__*/React.createElement("input", {
114
115
  type: "checkbox",
115
116
  className: inputClassName,
@@ -127,7 +128,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
127
128
  className: innerIconClassName
128
129
  }, /*#__PURE__*/React.createElement(Icon, {
129
130
  type: "right-bold",
130
- className: _concatInstanceProperty(_context20 = "".concat(checkboxPrefixCls, "-")).call(_context20, mergedCheckboxType, "-inner-icon")
131
+ className: _concatInstanceProperty(_context21 = "".concat(checkboxPrefixCls, "-")).call(_context21, mergedCheckboxType, "-inner-icon")
131
132
  }))))
132
133
  );
133
134
  };
@@ -7,6 +7,7 @@ export declare type CheckboxValueType = string | number;
7
7
  export interface CheckboxGroupContext {
8
8
  name?: string;
9
9
  isControlled?: boolean;
10
+ size?: CheckboxSize;
10
11
  groupValue?: Array<CheckboxValueType>;
11
12
  checkboxType?: CheckboxType;
12
13
  disabled?: boolean;
@@ -19,7 +20,7 @@ export interface CheckboxGroupProps {
19
20
  value?: Array<CheckboxValueType>;
20
21
  checkboxType?: CheckboxType;
21
22
  disabled?: boolean;
22
- defaultValue?: string[] | string;
23
+ defaultValue?: Array<CheckboxValueType>;
23
24
  options?: string[] | Array<{
24
25
  label?: string;
25
26
  value: string;
@@ -1,7 +1,17 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
1
2
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
3
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
2
4
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
3
5
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
4
6
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
7
+ var __rest = this && this.__rest || function (s, e) {
8
+ var t = {};
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
10
+ if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
11
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
12
+ }
13
+ return t;
14
+ };
5
15
  import React, { useContext } from 'react';
6
16
  // import { Icon } from '../index'
7
17
  import classnames from 'classnames';
@@ -15,7 +25,6 @@ export var CheckboxTypes = tuple('default', 'square');
15
25
  export var CheckboxSizes = tuple('large', 'middle', 'small');
16
26
  export var GroupContext = /*#__PURE__*/React.createContext(null);
17
27
  var CheckboxGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
18
- // const CheckboxGroup = (props: CheckboxGroupProps): FunctionComponentElement<CheckboxGroupProps> => {
19
28
  var _useContext = useContext(ConfigContext),
20
29
  getPrefixCls = _useContext.getPrefixCls,
21
30
  prefixCls = _useContext.prefixCls,
@@ -32,7 +41,8 @@ var CheckboxGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
32
41
  children = CheckboxProps.children,
33
42
  defaultValue = CheckboxProps.defaultValue,
34
43
  value = CheckboxProps.value,
35
- name = CheckboxProps.name;
44
+ name = CheckboxProps.name,
45
+ rest = __rest(CheckboxProps, ["checkboxType", "className", "style", "prefixCls", "options", "size", "onChange", "disabled", "children", "defaultValue", "value", "name"]);
36
46
  var initData = value || (Array.isArray(defaultValue) ? defaultValue : typeof defaultValue !== 'undefined' ? [defaultValue] : []);
37
47
  var _React$useState = React.useState([]),
38
48
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -72,6 +82,7 @@ var CheckboxGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
72
82
  groupValue: groupValue,
73
83
  disabled: disabled,
74
84
  name: name,
85
+ size: size,
75
86
  isControlled: isControlled,
76
87
  checkboxType: checkboxType,
77
88
  onCheckboxGroupChange: function onCheckboxGroupChange(checkedValue, isChecked, e) {
@@ -93,12 +104,13 @@ var CheckboxGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
93
104
  }, option.label || option);
94
105
  });
95
106
  };
96
- return /*#__PURE__*/React.createElement("ul", {
107
+ return /*#__PURE__*/React.createElement("ul", _extends({
97
108
  className: classnames(checkboxGroupPrefixCls, className),
98
109
  style: style,
99
110
  ref: ref
100
- }, /*#__PURE__*/React.createElement(GroupContext.Provider, {
111
+ }, rest), /*#__PURE__*/React.createElement(GroupContext.Provider, {
101
112
  value: context
102
113
  }, options && options.length > 0 ? renderByOptions() : children));
103
114
  });
115
+ CheckboxGroup.displayName = 'CheckboxGroup';
104
116
  export default /*#__PURE__*/React.memo(CheckboxGroup);
@@ -139,6 +139,7 @@ var CityPicker = function CityPicker(_ref) {
139
139
  visible: popperVisible,
140
140
  placement: 'bottomLeft',
141
141
  trigger: 'focus',
142
+ prefixCls: "".concat(cityPickerPrefixCls, "-panel"),
142
143
  onVisibleChange: handlePopperVisibleChange
143
144
  };
144
145
  var panel = inputVal.length > 0 ? searchPanel : cityPanel;
@@ -163,6 +163,12 @@
163
163
  -webkit-transform: rotate(180deg);
164
164
  transform: rotate(180deg);
165
165
  }
166
+ .kd-city-picker-panel.hidden {
167
+ opacity: 0;
168
+ visibility: hidden;
169
+ -webkit-transition: all calc(0.3s - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
170
+ transition: all calc(0.3s - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
171
+ }
166
172
  .kd-city-picker-panel-container {
167
173
  width: var(--kd-c-city-picker-panel-sizing-width, 460px);
168
174
  height: var(--kd-c-city-picker-panel-sizing-height, 373px);
@@ -53,6 +53,14 @@
53
53
  }
54
54
  }
55
55
 
56
+ .@{city-picker-prefix-cls}-panel {
57
+ &.hidden {
58
+ opacity: 0;
59
+ visibility: hidden;
60
+ transition: all calc(0.3s - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
61
+ }
62
+ }
63
+
56
64
  .@{city-picker-prefix-cls}-panel-container {
57
65
  width: @city-picker-panel-sizing-width;
58
66
  height: @city-picker-panel-sizing-height;
@@ -143,7 +143,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
143
143
  }
144
144
  }
145
145
  }
146
- devWarning(!inputValType, 'color-picker', "'themeColor' must be hexadecimal, RGB, HSB, HSL or color English name");
146
+ devWarning(!inputValType, 'color-picker', "'themeColor' must be hexadecimal, RGB, HSB, HSL or English color name");
147
147
  }
148
148
  if (switchValue) {
149
149
  onChange && onChange(functionalColorName, formatArr);
@@ -166,7 +166,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
166
166
  var isTrueFormat = colorArr.every(function (hexColor) {
167
167
  return ['HEX', 'HSB', 'RGB', 'HSL', 'colorName'].indexOf(validateColor(hexColor)) !== -1;
168
168
  });
169
- devWarning(!isTrueFormat, 'color-picker', "'presetColor' must be Array of the HEX string type");
169
+ devWarning(!isTrueFormat, 'color-picker', "'presetColor' must be an array of hexadecimal, RGB, HSB, HSL or English color name string type");
170
170
  return isTrueFormat;
171
171
  };
172
172
  useOnClickOutside([panelClsRef, inputRef], function () {
@@ -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, {
@@ -14,6 +14,8 @@ export interface DropDownProps extends PopperProps {
14
14
  defaultKey?: string;
15
15
  selectedKey?: string;
16
16
  selectable?: boolean;
17
+ className?: string;
18
+ style?: Record<string, unknown>;
17
19
  children?: React.ReactNode;
18
20
  onItemClick?: (key: string) => void;
19
21
  menu: React.ReactElement | Array<MenuItem>;
@@ -18,5 +18,9 @@ export interface FormItemProps {
18
18
  wrapperWidth?: string | number;
19
19
  valuePropName?: string;
20
20
  }
21
+ export declare const INNER_VALUE_PROPS_LIST: {
22
+ name: string;
23
+ propName: string;
24
+ }[];
21
25
  declare const Field: React.FC<FormItemProps>;
22
26
  export default Field;
package/es/form/Field.js CHANGED
@@ -44,7 +44,7 @@ var generateEventHandler = function generateEventHandler(handler, validateTrigge
44
44
  }
45
45
  return eventHandler;
46
46
  };
47
- var INNER_VALUE_PROPS_LIST = [{
47
+ export var INNER_VALUE_PROPS_LIST = [{
48
48
  name: 'Radio',
49
49
  propName: 'checked'
50
50
  }, {
@@ -58,10 +58,7 @@ var INNER_VALUE_PROPS_LIST = [{
58
58
  propName: 'fileList'
59
59
  }, {
60
60
  name: 'Transfer',
61
- propName: 'targetKey'
62
- }, {
63
- name: 'RangePicker',
64
- propName: 'ranges'
61
+ propName: 'targetKeys'
65
62
  }];
66
63
  var Field = function Field(props) {
67
64
  var _context, _classnames;
@@ -199,7 +196,7 @@ var Field = function Field(props) {
199
196
  var inputValue;
200
197
  if (innerDisplayName === 'RadioGroup' && payload) {
201
198
  inputValue = payload[1];
202
- } 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)) {
203
200
  inputValue = (_a = evt.target) === null || _a === void 0 ? void 0 : _a[innerValuePropName];
204
201
  } else {
205
202
  inputValue = evt;
package/es/form/index.js CHANGED
@@ -7,6 +7,7 @@ var InternalForm = /*#__PURE__*/React.forwardRef(FieldForm);
7
7
  var RefForm = InternalForm;
8
8
  RefForm.FormProvider = FormProvider;
9
9
  RefForm.Item = Item;
10
+ RefForm.Item.displayName = 'Item';
10
11
  RefForm.useForm = useForm;
11
12
  RefForm.displayName = 'Form';
12
13
  export { Item, FormProvider };
@@ -23,6 +23,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
23
23
  readonly?: 'readonly';
24
24
  count?: boolean;
25
25
  status?: 'error';
26
+ style?: Record<string, unknown>;
26
27
  }
27
28
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<unknown>>;
28
29
  export default Input;